Serving features under different freshness needs
- The three freshness tiers (a daily batch job, a stream, the request itself) and what each costs in compute, state and failures
- How to test whether a feature is worth making fresher, with a staleness ablation instead of a hunch
- Online and offline stores, and why title features live in each server's memory while member features need a lookup
- Training data that matches what serving read, including the event-time against created-time trap that a default join misses
- Three ways to build training rows (log the served features, log the raw facts, or recompute later), and why logging removes skew
- The feature fetch inside a ranking budget, with fan-out, timeouts, defaults the model has seen, caching and TTLs
- Keeping the stream and the batch backfill in step, backfilling safely, and the monitors that catch a stale or broken feature
The feature layer for a homepage ranker
You're designing the feature layer for a homepage ranking model at a streaming service. For one member, the model scores a few hundred candidate titles for each row of the page. It needs features at three freshness levels: long-term taste that changes over days, what the member is doing in this session, and context from the request itself.
Design how each kind of feature is computed, stored and served inside the latency budget, and how you make sure the model trains on the same values it's served.
One Netflix MLE technical screen, reported once in October 2026, had two halves: 30 minutes of ML fundamentals and 30 of practical coding (1 report). In the coding half, the interviewer pasted a pull request for a feature pipeline whose tests all passed. The candidate had to say what would break if it landed in production (1 report). The same screen ended on how to serve those features under different real-time requirements (1 report).
That's one candidate's report, not a rule. But its two halves are one problem. A feature pipeline can pass every test and still hand the model different numbers in production than it saw in training. Or it can hand over numbers a day old when the model needed the last five minutes.
So the round wants three answers, worked out together:
- How fresh each feature has to be.
- What that freshness costs.
- How you make sure training sees what serving saw.
You start with the three freshness tiers and what each one costs. Then come the two stores, and how training gets exactly what serving read. Last are the latency budget and the monitors that catch a feature failing without an error. The lesson ends on a mock interview: eight questions in the order a 45-minute round runs.
The running example: a homepage ranker
A Netflix feature infrastructure posting says its platform takes care of computing, storing and serving feature values, for training and for low-latency inference (1 source). An Ads machine learning engineer posting asks for experience running real-time model serving at high QPS (queries per second) with latency under 20 ms (1 source). So picture a ranker at that kind of scale:
| Assumed for the ranker | Value |
|---|---|
| Ranking requests per second, at peak | 20,000 |
| Candidate titles scored per request | 500 |
| p99 budget for the ranking call | 150 ms |
| Member profiles | 250 million |
| Titles in the catalog | 20,000 |
Every design choice from here on is made for this one ranker, the one that fills a member's homepage. These aren't anyone's real figures. They're round numbers to estimate with. p99 is the time that 99 of every 100 calls finish within. The design method lesson covers how to reach numbers like these in the first minutes of a round.
In the editor, write scores_per_second(rps, candidates) for the ranker's load, and p99(times_ms) for its latency target. The last lines run them on the table's 20,000 requests a second and on 100 call times of 1 to 100 ms.
Every feature sits in one of three freshness tiers
The ranker's features don't all change at the same speed, so they don't all need the same machinery.
The tier is how old a value may be when the model reads it
| Tier | Path | Reaches |
|---|---|---|
| batch | warehouse, then a daily job | an offline table for training, and the online store |
| streaming | events, then a stream job | the online store, and a log for training |
| request | device, hour, the row itself | computed per request |
All three meet at the ranker.
Every feature the ranker reads takes one of these three paths. Call each path a freshness tier. It's set by how old the value is allowed to be at the moment the model reads it.
| Tier | Age at read time | Computed by | Stored in | Examples in the ranker |
|---|---|---|---|---|
| Batch | hours to a day | a scheduled job over the warehouse | an offline table, bulk-loaded into a key-value store | long-term genre taste, a title's plays over 7 days, daily member and title embeddings |
| Streaming | seconds to minutes | an always-on stream processor over events | an online store updated per event, plus a log for training | titles started this session, impressions of a title to this member today, a title's plays in the last 15 minutes |
| Request-time | none | the serving path, on every request | nowhere, unless you log it | device, local hour, the row being filled, each candidate's similarity to what the member just browsed |
Batch: cheap per value, old by design
A daily job reads the warehouse and computes each feature for every member or title. It writes a dated partition to the offline store. Then it bulk-loads the same values into the online store.
Uber's Michelangelo post calls this path simple and efficient. It generally works well, the post says, for historical features that only need updating every few hours or once a day.
Netflix makes its foundation model's embeddings this way. The model is pre-trained from scratch every month and fine-tuned every day. Then a batch job refreshes the profile and item embeddings and publishes them to Netflix's Embedding Store.
Airbnb's July 2026 post on its guest-journey sequence encoder says the encoder runs as a daily batch job (1 source).
Size it. Take 200 scalar features at 4 bytes each, plus a 64-number float32 embedding.
- One profile is 800 + 256 = 1,056 bytes.
- A daily snapshot of 250 million profiles is about 264 GB.
- Loading it inside a two-hour window takes 250,000,000 / 7,200 s, about 34,700 writes per second.
The job computes every profile, including the members who won't open the app today.
In the editor, write profile_bytes(scalars, dims) and load_rate(profiles, hours). The last lines size the example: 200 scalars and a 64-number embedding, then 250 million profiles loaded in a 2-hour window.
A daily feature is about 16 hours old on average
A daily job sounds fresh enough. Measure how old its values really are when the model reads them.
The data runs through midnight, and the daily load lands at 04:10. How old is the value at 04:09?
Streaming: fresh, always on, and stateful
When a day is too old, the next tier keeps values fresh as events arrive.
A 5-minute count is read at 20:40, but the stream is 40 minutes behind. What does the feature count?
Request-time: computed from the request itself
Some features can't be computed ahead at all.
A feature is computed at request time. What's the catch?
Make a feature fresher only when it pays
Fresher always costs more, so each feature needs a reason for its tier.
A staleness ablation shows what each step of freshness buys
How do you decide whether a feature needs a stream?
A hybrid feature adds a fresh edge to a batch count
One feature can also use two tiers at once.
The batch's data stops at 18:00 yesterday. Where should the stream that adds the fresh edge start counting?
Give each feature a row: tier, acceptable age, fallback
Now write the decisions down, one row per feature.
| Feature, an example | Tier | Acceptable age | When it's missing |
|---|---|---|---|
| Long-term genre taste | Batch | 30 hours | yesterday's value, still in the store |
| Impressions of this title to this member today | Streaming | 2 minutes | the last value, with its age |
| Similarity to the titles browsed this session | Request-time | none | a default the model saw in training |
In the editor, write read(value, age_s, max_age_s, fallback), the rule the ranker runs on every read, and too_old(table, store). TABLE holds two rows of the feature table as acceptable ages in seconds: 30 hours for genre taste and 2 minutes for today's impressions.
Two stores: all of history for training, the latest value for serving
Training and serving ask the feature layer very different questions.
Training scans history, and serving reads a few keys
| Offline store | Online store | |
|---|---|---|
| Holds | every value with its timestamps, for months | the latest value per key |
| Read by | training and batch scoring, as large scans and joins | the serving path, a few keys at a time |
| Latency | minutes per job | single-digit milliseconds per read |
| Typical technology | columnar tables in a warehouse or lake | a key-value store or cache |
Every tier writes to two places, because training and serving read in opposite ways.
Uber's 2017 post on Michelangelo, its ML platform, describes the pattern. Uber added a feature store: one place where teams share, find and use a curated set of features. Features for online models are computed ahead of time and stored in Cassandra, where they can be read at low latency at prediction time. The post counted about 10,000 features in the store.
The lookup costs time. Uber typically saw a p95 latency under 5 ms for models that read nothing from Cassandra, and under 10 ms for models that read Cassandra features. p95 is the time 95 of every 100 requests finish within.
Give every offline row two timestamps: when its data ends, and when it went online. Training needs both to rebuild what serving read.
Design the online keys around the request, not the feature
The online store's keys decide how many reads each ranking call makes.
| Feature kind | Values per request | Where it lives | Reads per request |
|---|---|---|---|
| Member | 1 set | the online store, under the member's key | 1 |
| Title | 500 sets, the same for every member | each server's memory | 0 |
| Member-by-title | 500 values | inside the member's value, as a map from title to value | 0 more |
A member-by-title feature describes one member and one title together, like how often this member saw this title today.
Naively, the ranker reads 1 member key and 500 title keys per request. At 20,000 requests a second, that's 20,000 × 501, about 10 million reads per second. Two changes fix that.
Title features are shared by every member. At 60 features plus a 64-number embedding, a title is about 500 bytes. So the whole 20,000-title catalog is about 10 MB. Keep it in each server's memory and refresh it every few minutes. Title reads drop to zero.
Member-by-title features go in one value per member. Impressions of each title today become a map from title to count, under the member's key. That's one read per request instead of 500.
That leaves about 20,000 member reads per second per store, a 500-fold cut.
In the editor, write reads_per_second(rps, candidates, titles_in_memory) and catalog_mb(titles, features, dims). The last lines count the reads both ways at 20,000 requests a second, and size the 20,000-title catalog.
Train on exactly what serving saw
Two copies of the same feature can quietly disagree.
Two correct implementations can disagree by a day
A member in New York last played at 23:30 local time, and asks again at 01:00. Training counts days in UTC and serving in local time. What do they say?
A label may join only values that existed at its time
Timestamps settle the data half, with one rule for the join.
A training job on Mar 3 joins the latest value of a feature for a label from Mar 2. What's wrong?
Join on when a value went online, not on the data it covers
A feature value has two times, and the join must use the right one.
| Row | Value | Event time (data through) | Created time (online from) |
|---|---|---|---|
| A | 0.31 | Mar 1, 00:00 | Mar 1, 04:10 |
| B | 0.35 | Mar 2, 00:00 | Mar 2, 04:10 |
| C | 0.52 | Mar 3, 00:00 | Mar 3, 04:10 |
This is the trap most designs walk into. Here's one member's genre-affinity feature, three daily rows. Each row carries two times. Its event time says what data it covers. Its created time says when it reached the online store.
From midnight to 04:10, a join on event time hands training row B. Serving didn't have row B yet. It was still reading row A.
Build a training set on March 3 at noon, and join three impressions four ways:
| Impression | Latest value | As-of on event time | As-of on created time | What serving read |
|---|---|---|---|---|
| Mar 2, 02:00 | 0.52 | 0.35 (B) | 0.31 (A) | 0.31 |
| Mar 2, 20:00 | 0.52 | 0.35 (B) | 0.35 (B) | 0.35 |
| Mar 3, 09:00 | 0.52 | 0.52 (C) | 0.52 (C) | 0.52 |
Taking the latest value leaks into the first two rows. The event-time join is right most of the day, and wrong between midnight and 04:10. If traffic were spread evenly over the day, that's every row in the first 4 hours 10 minutes of 24. Each of them is a day fresher in training than it was in serving. Only the created-time join matches serving on all three.
Feast's docs flag this: "By default, point-in-time joins only constrain the feature's event timestamp." So a value that was backfilled or corrected after a label's time can still be returned for it.
An option, filter_by_created_timestamp=True, adds the created-time condition. The docs say it helps keep backfilled values out of training data, and helps reproduce what the online store would have served. The option's name isn't the point. Any join can add the same condition, as the SQL in the next step does.
Streaming features hit the same problem in another form. A stream running 30 seconds behind serves values 30 seconds old. A backfill computed from the event log at exact timestamps has no lag at all. If the lag matters for a feature, train on the stream's own logged output, or shift the backfill by the lag you measured.
In the editor, write too_fresh(minute, lands) and share(minutes, lands). LANDS is 04:10 as a minute of the day, and the last line checks one impression in every minute of a day.
In SQL, join on created time and keep the online TTL
Here is the created-time join in SQL, for one member's daily genre-affinity rows.
SELECT l.member_id, l.title_id, l.shown_at, l.played,
f.value AS genre_affinity
FROM labels AS l
LEFT JOIN LATERAL (
SELECT value
FROM member_genre_affinity AS f
WHERE f.member_id = l.member_id
AND f.created_at <= l.shown_at -- online when served
AND f.created_at > l.shown_at - INTERVAL '2 days' -- the online TTL
ORDER BY f.created_at DESC
LIMIT 1
) AS f ON TRUE;
Read it from the inside out.
LATERALlets the subquery see the current label rowl, so it runs once per label.- It keeps that member's rows that were online by
shown_at, and less than 2 days old then. - It sorts them newest first and takes one.
LEFT JOIN ... ON TRUEkeeps every label.genre_affinityisNULLwhen no row qualifies.
The TTL line matters as much as the first condition. A key-value store keeps serving the last value it holds until that value expires. Say row C went online Mar 3 at 04:10, then the batch failed for 3 days, and the online TTL is 2 days. Serving reads C, 0.52, until Mar 5 at 04:10, then nothing: a default. Training must get the same, so the offline TTL must equal the online one.
In the editor, write a new as_of(rows, t, ttl) that joins on created time and keeps the online TTL, like the SQL. Each row is a (value, event time, created time) tuple of datetimes: the tests use the three daily rows A, B and C, which land at 04:10 on Mar 1, 2 and 3.
rows holds one member's feature as (value, event_time, created_time) tuples of datetimes. The online store expires a value ttl after it lands. Write as_of(rows, t, ttl): the value a request at time t read. That's the newest row already online at t and not yet expired, or None if there was none.
Log what you served, or recompute it later
There are three ways to build training rows, and they differ in what they risk.
Three ways to build training rows
| Recompute from the warehouse | Log the served features | Log the facts, regenerate | |
|---|---|---|---|
| Try a new feature on past weeks | right away | only from the day it ships | right away, over facts already logged |
| Code skew | possible: a second implementation | none | none: the encoders are shared |
| Time skew | possible: wrong timestamps, late events, missing defaults | none | none: the facts are what serving fetched |
| The catch | skew, unless every join is right | weeks of waiting, and log volume | storing the facts, and no fact you never logged |
The three differ in how fast you can try a new feature, and in how much skew they let in.
Recomputing from the warehouse is the fastest to try. Run the feature definitions over historical tables with point-in-time joins. You can try a new feature over a year of history this afternoon.
The risk is every way a mismatch slips in:
- a second implementation
- a join on the wrong timestamp
- late events that the warehouse has and the stream never saw
- the timeouts and defaults that happened online and never show up offline.
In the editor, write history_days(route, shipped_days_ago, facts_days, warehouse_days, new_fact). It puts the table's first row in numbers: how many past days a new feature can train on under each route.
Logging the served features removes skew. What does it cost?
The safest route has a price.
You log every feature vector you serve. Then you add a new feature. When can the model train on it?
Netflix logs the facts and regenerates the features
There's a route between recomputing everything and logging everything.
Netflix took the third route. It logs the raw inputs the serving path fetched, which it calls facts, such as viewing history and My List. Then it regenerates the features offline with the same encoder code.
Its fact store post describes the flow. After the recommendations are generated, the applications log the facts with a fact logging client. Later, an offline feature generator uses the logged facts to regenerate temporally accurate features. Temporal accuracy, as the post defines it, is being able to regenerate the exact features that were generated for the recommendations. The post says regeneration takes hours, where feature logging takes weeks.
That keeps both guarantees. The inputs are what the services returned at request time, so there's no time skew. The encoders are shared, so there's no code skew. And a new encoder over existing facts can be tested on past weeks right away.
In the editor, write log_facts(at, plays) and regenerate(record, encoder). The stub gives you one encoder, plays_7d, which counts the plays in the 168 hours up to at, and history gains a play after the record is logged.
Facts cost storage, so log for production and recompute to explore
Regeneration has limits. It can't produce a fact you never logged, and it moves the cost into storing and querying facts. Netflix added EVCache, a key-value store, next to its Iceberg tables, because pulling a small slice out of one large table was slow. It reported that, depending on the use case, EVCache queries can be 3 to 50 times faster than Iceberg.
The pattern is still the contract in Netflix's 2026 serving post. A model lists the facts it needs. The serving platform supplies them at serving time by calling several other microservices. During offline training, the fact store provides snapshots for bulk access.
What to say in the round:
- Log the served features or facts for everything the production model uses.
- Explore new features with warehouse recomputation.
- Switch a feature to logged inputs once it ships.
- Check the two against each other on a sample.
Netflix engineers on the time machine behind their offline features (snapshots of online services, rebuilt for any past moment), then the real-time pipeline behind trending rows. Two of this lesson's tiers in Netflix's own system, as of 2016.
Fetch features inside the latency budget
Serving adds a limit that training never has: the clock.
The fetch competes with the model for the same milliseconds
Request-time features: 20 µs per item. Ranking model: 120 µs per item.
Lay the ranking call out as stages against the p99 budget, and try the candidate sliders. With 500 candidates the call fits with 30 ms to spare: 15 + 25 + 10 + 60 + 10 = 120 ms. Push both per-candidate stages to 1,000 candidates and they double, to 20 and 120 ms. Now the call takes 190 ms, 40 over.
Anything that depends only on the member should run once per request, not once per candidate. Netflix does this when it builds its foundation model into a ranker. It splits that part of the model off so it runs only once per profile per request, shared by all the items in the request.
In the editor, write call_ms(fixed_ms, per_candidate_us, candidates) and max_candidates(fixed_ms, per_candidate_us, budget_ms). FIXED holds the widget's three fixed stages in milliseconds, and PER its two per-candidate stages in microseconds.
Fan-out sets the tail, so fetch from fewer stores
The more stores a request touches, the more often one of them is slow.
| Stores per request | Requests where at least one store is past its p99 |
|---|---|
| 1 | 1% |
| 3 | 2.97% |
| 10 | 9.6% |
The fetch goes to several stores at once: member batch features, the streaming store, an embedding store. In parallel, the stage takes as long as the slowest answer. So its tail is worse than any one store's.
Say each store is past its own p99 on 1% of requests, independently. Then
Here is the number of stores, and is the chance that all answer in time. The design method lesson works the general case from The Tail at Scale.
Fewer stores per request is the first fix. Then:
- Timeouts with fallbacks. Give each store a deadline inside the stage, say 20 ms. When it fires, use a fallback: the last value cached on the server with its age, the batch value in place of the streaming one, or a default.
- Defaults the model has seen. A fallback is a feature value, and if training never contained it, the model's output on it is a guess. Logged features handle this for free. With recomputed training data, blank the feature group in training at the rate you see online, and add an indicator that says the value was a fallback.
- Hedged requests. If a store hasn't answered by about its p95, send a second request to another replica. The Tail at Scale reports a benchmark where hedging after a 10 ms delay cut the 99.9th-percentile latency for fetching all 1,000 values from 1,800 ms to 74 ms. It sent just 2% more requests.
- One read per store. One multi-get per store per request, a single call that reads many keys. Never one call per candidate.
Netflix plans for failed fetches too. Its routing post lists fallback and client-side caching in case of failures among its goals. Its 2016 time machine tracked a confidence level for each service: the share of data fetches that succeeded, not counting fallbacks from timeouts or service failures.
In the editor, write p_any_slow(n) from the formula, and max_stores(target): how many stores a fetch can wait on before the slow share passes target.
Cache by tier, and count the cache in the feature's age
A cache cuts the fetch time, and it makes each value older.
| Feature | Changes | Cache | Extra age it adds |
|---|---|---|---|
| Title features | when the catalog snapshot refreshes | in process, refreshed every 5 minutes | up to 5 minutes |
| Member batch features | once a day | per session, TTL 30 minutes | up to 30 minutes, on a value already 4 to 28 hours old |
| Member streaming features | every few seconds | none, or a TTL well under the freshness target | a 10-minute TTL makes a 1-minute feature a 10-minute feature |
Set each TTL from how often the value changes.
The session cache pays off. Say one homepage session makes 6 ranking calls (assume: the first rows plus pagination). Reading member batch features once per session instead of once per call removes 5 reads in 6, about 83%.
In the editor, write worst_age_s(pipeline_lag_s, cache_ttl_s) and reads_saved(calls_per_session). The last line checks the 10-second stream behind a 15-minute cache, and the 6-call session.
Keep the stream and the backfill in step
A streaming feature has two implementations, even when you meant to write one. The stream computes it going forward. A batch backfill computes it over history, for training. They disagree for reasons no unit test shows.
The stream and the backfill drift apart in four ways
In the stream, last 7 days is a window that ends now. In SQL it's often 7 calendar days that end at midnight. Read both on a Thursday at 15:00. The SQL counts from last Thursday at 00:00, and the stream from last Thursday at 15:00. So 15 hours at the start count only for SQL, and 15 hours at the end only for the stream.
Pick one definition, for example 7 days moving in one-hour hops, and build both paths to it.
Three more ways the two paths drift apart:
- Event time against processing time. Window on when the event happened, not on when the processor saw it. Otherwise a 20-minute delay after a restart moves events into the wrong window.
- Late events. The stream drops events older than its allowed lateness, say 10 minutes. The warehouse keeps them. So the backfill counts a little more than the stream ever served, and the gap grows on days with outages.
- Time zones. Any feature with today or this week in it needs one stated time zone, used by both paths.
Define each feature once, then check the two paths against each other
The way out is to define each feature once and generate both paths from that definition. Airbnb's Chronon project page promises to eliminate data leakage with guaranteed point-in-time correctness (1 source).
Then check the two paths against each other. For a sample of keys and times, compare the value the stream served, from the log, with the value the backfill computes. Alert when the mismatch rate passes a threshold.
In the editor, write stream_window(t) and sql_window(t), the two meanings of last 7 days. thursday is the read time from the example, Thursday at 15:00.
Backfill a changed feature as a new version
When a feature's definition changes, recompute its history as a new version: genre_affinity_v2 next to v1. Never overwrite it in place. A model trained on v1 keeps reading v1 until it's retired.
Backfilled rows carry a created time of when the backfill ran. So a created-time join for an old impression skips them. That's right when you're reproducing what an old model saw. It's wrong when you're training a new model on the new definition, which needs the backfilled history. Decide which job you're running, and say so.
Embeddings need versions too. Netflix found that its daily fine-tuned embeddings drift. So it maps each day's embeddings into the same embedding space, and downstream models can use the precomputed embeddings as features. Its Embedding Store takes care of versioning and timestamping them.
Never give a ranker a member embedding from one version and a title embedding from another. Their dot product means nothing.
In the editor, write pick_version(member_versions, title_versions) and score(member, title). Each side is a (version, vector) pair, so score can refuse a member and a title from different versions.
Monitor what fails without an error
A feature layer usually breaks quietly, with no error anywhere.
Five monitors catch a stale or broken feature
| Monitor | How it's computed | Alert when |
|---|---|---|
| Freshness | now minus the newest event time, per feature group | daily: the load hasn't landed 2 hours after its usual time, or age passes 30 hours. Streaming: p99 lag over 2 minutes |
| Fallback and null rate | share of requests where each feature was defaulted or missing | 3 times its usual rate, or a jump right after a deploy |
| Fetch latency | p50 and p99 per store, and the timeout rate | the stage's p99 nears its slice of the budget |
| Drift against training | distance between this hour's served values and the training set, per feature | above a threshold tuned per feature |
| Parity | logged served value against the value recomputed offline, on a sample | mismatch rate over a small threshold |
Most feature failures throw no errors. The model keeps scoring on values that are stale, defaulted or shifted. These five catch them.
Drift: how far this hour's values are from the training set
| Device, an example | Share in training | Share in serving | Difference |
|---|---|---|---|
| TV | 50% | 40% | 0.10 |
| Phone | 30% | 45% | 0.15 |
| Laptop | 20% | 15% | 0.05 |
TensorFlow Data Validation (TFDV) makes a fine default to name. It measures drift with L-infinity distance for categorical features, and approximate Jensen-Shannon divergence for numeric ones.
L-infinity distance is the largest difference, over all categories, between a category's share in serving and its share in training. In this example it's 0.15, from phones. Jensen-Shannon divergence is a symmetric, bounded score for how far apart two distributions are, 0 when they match.
TFDV also warns that setting the right distance is usually an iterative process, which takes domain knowledge and experiments.
In the editor, write shares(values) and l_inf(train, serve). TRAIN and SERVE are the device shares from the table, so the distance should come out at 0.15.
Parity: compare a logged value with the same value recomputed
One monitor checks for skew head on.
A logged feature value and the same value recomputed offline differ. What does that tell you?
A worked example: the fallback rate jumps after a deploy
On a normal day the streaming store times out on 0.5% of requests. At 20,000 requests a second, that's 100 defaulted requests a second, 8.64 million a day. If the model trained with a matching share of defaults, that's fine.
Now a deploy pushes the rate to 5%. Ten times as many requests are scored on a value the model rarely saw. The fallback-rate monitor catches it in minutes. The engagement metric would catch it a day later.
In the editor, write defaulted_per_day(rps, rate) and fallback_alert(rate, baseline). The last lines check the normal day, 0.5% of 20,000 requests a second, and the deploy that pushes the rate to 5%.
What interviewers ask next
A feature is right in training and wrong in production. How do you find it?
Start from parity, not from the model. Take a sample of logged requests, recompute the feature offline for the same member and time, and diff the two. Then sort the mismatches by pattern:
| What the mismatches share | The likely cause |
|---|---|
| Wrong at certain hours of the day | a day boundary or a time zone |
| Wrong just after midnight | event time used where created time was needed |
| The served value is a default | timeouts, and training never saw defaults |
| The served value is older than it should be | a cache TTL or stream lag |
| Everything slightly off | two implementations: move to one shared definition |
It's the same skill as the pull-request review in that one reported Netflix screen: say what breaks in production in a feature pipeline whose tests pass (1 report). The usual suspects are a join on a future timestamp, days cut at UTC, and a fill value that differs from serving's.
In the editor, write cause(m), the table's sort as code, and top_cause(mismatches), which can count the causes with the imported Counter. Each dict in MISMATCHES is one mismatch from a parity check, with its minute of the day, whether serving used a default, and the value's age next to its allowed age.
The stream is down for 40 minutes. What does the ranker serve?
The last value in the online store, with its age, to a model that knows what an old value means. Pass the seconds since the last update as a feature. Or, once the age passes a threshold, switch to a fallback model trained without the streaming group.
Don't fill zeros. Zero impressions today is a real value. It means never shown, and the ranker will push the titles the member has been scrolling past all evening. When the stream recovers, it replays from its last checkpoint, and the freshness monitor shows the lag draining.
In the editor, write when_down(last_value, age_s, threshold_s): what the ranker gets during the outage. The last line asks at 40 minutes down, with a 15-minute threshold for the switch to the fallback model.
Three more follow-ups
Is real-time worth it for this feature?
Run the staleness ablation and price both sides. Say going from daily to 5 minutes buys a clear offline gain, on a metric that has tracked online results before. Then estimate the stream's state and compute, and make the call. If the curve is flat, keep it daily and say why.
How do you add a feature without waiting weeks for logs?
- Backfill it from logged facts or the warehouse with a point-in-time join. Train, and compare offline.
- Ship it to serving in shadow mode: compute it and log it, but don't feed it to the model.
- Compare the shadow values with the backfill on the same requests.
- Once they agree, start training on the logged values as they pile up, and switch the model over.
Why not compute everything at request time?
Because latency and CPU grow with candidates times features. And because history doesn't fit in a request. A 90-day taste profile needs 90 days of events, and that's what the batch and streaming tiers are for. Request time is for what the request knows, and for what's cheap to compute from data already fetched.
In the editor, write topic_at(plan, minute) and start_of(plan, topic). PLAN is the walkthrough as (topic, minutes) blocks in order, so each block starts where the one before it ends.
The practice round, start to finish
That's every piece the practice round needs. Here it is in order, from the first question to the last minute.
1.A daily feature row has event time Mar 2 00:00 and reached the online store at Mar 2 04:10. The previous row reached it at Mar 1 04:10. An impression at Mar 2 02:00 needs this feature in training. Which row matches what serving read?
2.Why does logging the served feature vector remove training-serving skew?
3.The ranker fetches from three stores in parallel. Each is independently past its own p99 on 1% of requests. On what share of requests is at least one of them past its p99?
4.A stream keeps a feature 10 seconds behind the events. Someone adds a 15-minute cache in front of the store to cut read load. How old can the value be when the model reads it?
5.At 20,000 requests a second with 500 candidates each, why keep title features in each server's memory?
Where this shows up
The reports behind this lesson, each with its source.
MLE candidate (interviewed Sep 2026, rejected): the technical screen was 30 minutes of ML fundamentals plus 30 minutes of practical coding.
Same screen, coding half: review a feature-pipeline pull request whose tests pass and say what would break in production.
Same screen ended on how to serve those features under different real-time requirements.
Netflix's feature platform computes, stores and serves feature values for both training and low-latency inference (Software Engineer 6, Feature Infrastructure).
“our platform takes care of the computation, storage, and serving of feature values”
The same posting asks for experience running real-time model serving at high QPS under 20 ms.
“Built and operated real-time model serving systems at high QPS with sub-20ms latency”
Ranker (Mar 2026), one of Netflix's largest services, powers the personalized homepage rows.
“Among many things, it powers the personalized rows you see on the Netflix homepage, and runs at an enormous scale.”
Integration post (listed by Netflix Research on 2026-02-24, possibly first published in late 2025; the feed shows a 2026-10-14 re-publish): feeding precomputed foundation-model embeddings to downstream models risks stale recommendations.
“can lead to staleness, impacting the freshness of recommendations”
The sequence encoder runs as a daily batch job that stores the resulting embeddings.
“The sequence encoder runs as a daily batch job, processing event history and storing the resulting embeddings”
Chronon real-time update (Sep 2026): streaming feature updates cut staleness from about two days to under a minute.
“cutting effective staleness from roughly two days to less than a minute”
The Chronon project site promises point-in-time correctness, so training data does not leak future values.
“Eliminate data leakage with guaranteed point-in-time correctness.”
Practice
Sources (11)
- Distributed Time Travel for Feature Generation · Netflix Tech Blog (techblog.netflix.com), read from the Internet Archive's April 2017 copy · Feb 12, 2016
“Our time machine snapshots online services and uses the snapshot data offline to reconstruct the inputs that a model would have seen online to generate features.”
- Evolution of ML Fact Store · Netflix Tech Blog, read from the Internet Archive's August 2026 copy (the post page itself returns 403) · Apr 26, 2022
“Temporal accuracy, in this context, is the ability to regenerate the exact set of features that were generated for the recommendations.”
- State of Routing in Model Serving · Netflix Tech Blog, post 'State of Routing in Model Serving' (full text read from the blog's Medium RSS feed; the post page itself returns 403) · May 1, 2026
“it relies on the model serving platform to supply these facts at serving time by calling several other microservices.”
- Integrating Netflix’s Foundation Model into Personalization applications · Netflix Tech Blog, post 'Integrating Netflix’s Foundation Model into Personalization applications' (full text read from the blog's Medium RSS feed; the post page itself returns 403) · Feb 24, 2026
“Netflix has an elaborate set up for refreshing the embeddings every day.”
- FM-Intent: Predicting User Session Intent with Hierarchical Multi-Task Learning · Netflix Tech Blog, post 'FM-Intent' (full text read from the blog's Medium RSS feed; the post page itself returns 403) · May 21, 2025
“These preferences can shift significantly between sessions, even for the same user.”
- Optimizing Recommendation Systems with JDK’s Vector API · Netflix Tech Blog, post 'Optimizing Recommendation Systems with JDK’s Vector API' (full text read from the blog's Medium RSS feed; the post page itself returns 403) · Mar 3, 2026
“This single feature was consuming about 7.5% of total CPU on each node running the service.”
- Meet Michelangelo: Uber’s Machine Learning Platform · Uber Engineering Blog · Sep 5, 2017
“Instead, we allow features needed for online models to be precomputed and stored in Cassandra where they can be read at low latency at prediction time.”
- Point-in-time joins · Feast documentation · Jul 31, 2026
“By default, point-in-time joins only constrain the feature's event timestamp.”
- Rules of Machine Learning: Best Practices for ML Engineering · Google for Developers · Aug 25, 2025
“Rule #29: The best way to make sure that you train like you serve is to save the set of features used at serving time, and then pipe those features to a log to use them at training time.”
- The Tail at Scale · Communications of the ACM 56(2) · Feb 1, 2013
“sending a hedging request after a 10ms delay reduces the 99.9th-percentile latency for retrieving all 1,000 values from 1,800ms to 74ms while sending just 2% more requests.”
- TensorFlow Data Validation: Checking and analyzing your data · TensorFlow documentation (TFX guide) · May 21, 2021
“We express drift in terms of L-infinity distance for categorical features and approximate Jensen-Shannon divergence for numeric features.”