ML SYSTEM DESIGN (DEEP DIVES) · INTERVIEW QUESTION
A home feed must retrieve from a billion items and respond within 200 ms. How would you divide the latency budget?
🔴 advanced · home-feed recommendation
Hint: Budget stage tails and failures.
Answer
Allocate explicit budgets to retrieval, feature lookup, ranking, constraints, and network overhead.
Interview reasoning
Use cached item embeddings and bounded candidate counts, with a safe fallback if a stage exceeds its deadline.
Separate retrieval, feature lookup, ranking and slate construction with deadline and freshness contracts. Train from impression-level logs with positions and delayed outcomes, not clicks alone. Retrieval sets an upper bound on ranker quality, while the feedback policy influences which future labels become available.
Worked example. A 200 ms budget might allocate 40 retrieval, 30 features, 70 ranking and 60 to merging/network slack; validate under load.
Validation
Load-test end-to-end p99 against 200 ms, including cache misses and deadline-triggered fallbacks.
Report retrieval recall, ranking quality, end-to-end p99, fallback rates and consumer/creator guardrails; validate through a staged randomized launch.
Common pitfalls
feedback loops over-amplify already popular creators
Optimizing watch time alone can reward harmful loops. Cached user features and index updates need explicit staleness limits.
Likely follow-up: Which feedback would you collect to avoid training a home feed solely on clicks?
Related questions
- Which feedback would you collect to avoid training a home feed solely on clicks?
- How would you serve personalized feed candidates without recomputing every item embedding per request?
- Popular creators get nearly all exposure after a feed launch. How would you investigate the feedback loop?
- Design a YouTube-scale video recommendation system serving billions of users.
- Design a production RAG system for an enterprise knowledge assistant (10TB docs, 50k employees, ACL-aware).