Code Room
System designHardsd-g594
Subject Two stage recommenderLevel Senior–Staff~55 minCommon in ML systems interviewsIndustries Technology

Question

Design a two-stage candidate-generation + rerank recommender for a short-video app with 200M DAU and a 1B-video corpus, where each 'next videos' request must return a diverse, fresh slate in under 120ms p99. Stage one retrieves a few thousand candidates from a billion-item corpus; stage two reranks to a final ~20 with a heavier model. Cover both stages, how candidate generation stays unbiased and diverse, and how the two stages are kept aligned.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.

Narrate your design
Loading whiteboard…
Run or narrate your approach, then ask the coach.