“Design a personalized video recommendation system for a short-video app.”
This prompt leaves the important decisions open. Are we recommending the next video or assembling a home feed? What does a good session look like? How quickly must new content appear?
We will design a home feed. The architecture below is one defensible answer under explicit assumptions, rather than a description of any company's current production system.
New to ML design? Read in order and use the linked fundamentals guide. Experienced? Outline your answer first, then compare the decisions and work through the advanced follow-ups.
01. Define the outcome before the model
Start by asking the interviewer what user behavior signals a useful recommendation. Watch time is easy to measure, but it can reward long videos, repeated content, or sessions that users regret.
For this exercise, propose meaningful engagement per active user as the primary short-term outcome, supported by return rate and explicit satisfaction signals. Define a meaningful watch using duration-aware thresholds agreed with the product team. Monitor hides, reports, and latency as guardrails. These are proposed choices to validate, not universal metrics.
| Clarify | Assumption for this design |
|---|---|
| Surface and output | A home feed returning 20 eligible video IDs per request. |
| Scale | 10 million daily active users; 10 feed requests per user per day. |
| Latency | Target a 200 ms p95 server response, excluding video delivery. |
| Freshness | New eligible videos should enter candidate pools within minutes. |
| Scope | Recommendation selection; video encoding and playback are out of scope. |
The assumed traffic is 100 million requests per day: roughly 1,160 per second on average. A hypothetical 10× peak implies about 11,600 requests per second. This estimate motivates horizontal serving capacity and bounded model work; it does not determine the infrastructure by itself.
02. Establish a useful baseline
Begin with recent, popular videos grouped by language and broad interests, filtered for eligibility and previously seen items. Popularity should be time-decayed so yesterday's success does not permanently dominate.
This baseline gives the team something measurable to beat. It also provides a fallback when personalized retrieval or inference fails. A more complex model earns its place only if it improves the agreed outcomes within the serving budget.
“I would ship a popularity baseline first, then measure the incremental value of personalization against it. The baseline remains useful for new users and degraded service.”
03. Decide what the model can learn from
Record impressions, position, watch duration, skips, likes, hides, and the request context. An impression means an item was actually shown; a candidate that was generated but never displayed should not be treated as a rejected recommendation.
Join outcomes to impressions using stable request and item identifiers. Deduplicate retries, allow for delayed events, and record model and feature versions so an unexpected result can be investigated later.
- User signals: recent viewing history, explicit interests, and session context.
- Item signals: topic, language, duration, content embeddings, and publication time.
- Cross signals: similarity to recent interests, prior creator exposure, and repeated-topic frequency.
Keep the timeline honest
Train on features that existed when the recommendation was made. A video's eventual lifetime popularity is not a valid feature for predicting its first-day performance. Use chronological train, validation, and test windows; construct historical features point in time.
For a first ranker, define a meaningful-watch label on displayed impressions. Treat early skips as a separate signal, and document the observation window. Do not silently classify missing or delayed logs as negatives.
Logged data reflects what the previous system chose to show. That exposure bias limits what offline evaluation can establish. Preserve some controlled exploration traffic if the product can support it, and interpret results by cohort.
04. Separate retrieval from ranking
A common recommendation architecture uses candidate generation, scoring, and re-ranking. Retrieval reduces the search space; ranking spends more computation on the smaller set; re-ranking applies final constraints such as diversity and freshness. Google's recommendation overview explains this division.
~1,000 itemsRank
~100 itemsRe-rank
20 items
Retrieval: find plausible candidates cheaply
Combine several sources: embedding similarity, recently popular content, followed creators, and fresh uploads. Merge and deduplicate their candidates. Multiple sources help cover different needs; they also let the system continue if one source is unavailable.
A two-tower model is a possible retrieval choice: encode user context and items separately, precompute item embeddings, then use approximate nearest-neighbor search. Refresh item embeddings and indexes together with compatible model versions. For a small catalog, a simpler retrieval method may be sufficient.
Ranking: spend computation where it helps
Start with a tabular ranker over available features, predicting the chosen engagement label. Evaluate a more expressive model only when there is evidence that the extra complexity helps. Batch candidate scoring rather than issuing one network call per item.
Keep negative-feedback and satisfaction signals visible in the decision. If multiple objectives are combined, explain how their weights are selected and tested rather than presenting arbitrary weights as a fact.
Re-ranking: consider the whole feed
Remove unavailable and ineligible videos, reduce near-duplicates, cap repeated creators, and reserve limited exposure for fresh content. Apply eligibility filters early when possible and check again before returning the feed. Monitor underfilled responses after filtering.
05. Evaluate each stage separately
Retrieval needs to keep useful items available for the ranker. Ranking needs to order those items well. Product evaluation asks whether the resulting feed helps users. A single aggregate metric hides these different failure modes.
- Retrieval: Recall@K on held-out positives, segmented by user and item cohorts.
- Ranking: NDCG@K against a clearly defined relevance label, plus checks of any calibrated probability outputs.
- Product: a controlled online experiment on the primary outcome with negative-feedback and reliability guardrails.
Keep candidate pools, label windows, and evaluation populations comparable across model versions. Report both aggregate results and cold-start performance. An offline gain is a reason to investigate further, not a guarantee of online improvement.
Connected fundamentalHow do you know a recommendation is good? ↗
Worked examples for Recall@K and NDCG, plus the limits of logged data.
06. Make the serving path resilient
Set separate latency budgets for retrieval, feature lookup, ranking, and final filtering. Profile realistic traffic before assigning capacity. A p95 target alone can hide severe tail behavior, so inspect p99 latency and timeouts as well.
| Failure or edge case | Proposed response |
|---|---|
| New user | Use optional explicit interests, language, and diversified popular content; adapt as session signals arrive. |
| New video | Use content features and a controlled freshness pool before behavioral evidence accumulates. |
| Slow ranking service | Fall back to a simpler scorer or eligible baseline candidates within a request deadline. |
| Stale feature values | Track feature age, use defined defaults, and alert on missingness and freshness violations. |
| Bad model release | Canary the model, monitor guardrails, and keep a compatible previous model and index for rollback. |
Cache reusable item features and consider short-lived candidate caches. Invalidate or re-filter cached results for deleted content and changed eligibility. A cache must not bypass the current availability checks.
Monitor data quality, feature freshness, prediction distributions, catalog coverage, per-source retrieval counts, error rates, and latency. Distribution shifts trigger investigation; they do not automatically prove that retraining is the correct fix.
07. Defend the design under new constraints
“Your offline metric improves, but retention falls.”
Verify experiment assignment and instrumentation first. Then examine affected cohorts, repeated-topic exposure, novelty, and objective mismatch. The model may be exploiting a short-term signal at the expense of long-term usefulness. Roll back if pre-agreed guardrails are breached.
“The item index is hours out of date.”
Use a small, fresher candidate source alongside the main index and preserve final eligibility checks. Explain the consistency contract between the model and embedding index, and the additional serving cost of merging candidate sources.
“Traffic grows tenfold.”
Measure the actual bottleneck before redesigning. Options include smaller candidate sets, cached features, model distillation, and regional serving. Each trades relevance, freshness, or operating complexity for capacity.
Choosing a neural network before defining success; treating unseen items as explicit negatives; ignoring cold starts; evaluating only aggregate metrics; drawing a serving pipeline without a learning loop.
A concise answer you can build on
“I would clarify the feed objective and latency budget, establish a popularity baseline, and log impressions with time-correct outcomes. I would use multiple retrieval sources, a bounded ranker, and final diversity and eligibility checks. I would evaluate each stage separately, validate product impact online, and keep explicit fallbacks for cold starts and serving failures.”
Before moving on, check that you can justify the baseline, label, retrieval approach, metrics, and fallback behavior without relying on a memorized diagram.
Sources & further reading
This is an original teaching scenario. Traffic assumptions, budgets, and suggested decisions are illustrative.
- Google Developers: recommendation system stages — the roles of retrieval, scoring, and re-ranking.
- Covington et al., 2016: Deep Neural Networks for YouTube Recommendations — a historical production-system paper, not a specification of today's YouTube.
A reported interview variant
A submitted Meta Senior MLE account describes a short-video recommendation design discussion focused on model choice and offline versus online evaluation. The page viewed September 26, 2026 labels the interview eight months earlier and the submission five months earlier; exact dates were unavailable. This is candidate-reported, not employer-confirmed, and not evidence of a newly asked September question.
For an original timed drill, explain the product objective and label construction in five minutes, the retrieval/ranking architecture in ten, and evaluation in ten. Defend why an offline ranking improvement might fail online: exposure bias, stale features, altered inventory, latency, or a metric that rewards unwanted behavior. Keep model complexity subordinate to the objective and measurement contract.
Read the candidate account. This exercise supplements the existing solution rather than claiming to reproduce the interviewer's expected answer.
Continue your preparation
Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.