ML SYSTEM DESIGN (DEEP DIVES) · INTERVIEW QUESTION
How would you serve personalized feed candidates without recomputing every item embedding per request?
⚫ expert · home-feed recommendation
Hint: Separate offline embeddings from request work.
Answer
Precompute item embeddings into a versioned ANN index, compute or cache user context, retrieve a bounded pool, then rank with fresh features.
Interview reasoning
Keep encoder and index versions compatible.
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. Precompute item vectors, version the index with the encoder, and score only a bounded candidate pool.
Validation
Measure index refresh lag, encoder compatibility, cache misses and bounded candidate latency under load.
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: Popular creators get nearly all exposure after a feed launch. How would you investigate the feedback loop?
Related questions
- A home feed must retrieve from a billion items and respond within 200 ms. How would you divide the latency budget?
- Which feedback would you collect to avoid training a home feed solely on clicks?
- 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).