Recommendation systems, staff level
Design a real-time recommendation system for a video platform with 50 million daily active users.
17/25
Candidate answer, excerpt
I'd start with the objective. I'd optimise for expected watch time rather than clicks, since CTR rewards thumbnails, not satisfaction. At 50 million daily users and around 20 feed loads each, that's roughly a billion requests a day, so every stage needs a latency budget. I'll assume this is the home feed on mobile.
For retrieval, a two-tower model with user and video embeddings, served through approximate nearest neighbour search, pulling about a thousand candidates in under 50 ms. I'd add a second source for trending videos so the feed isn't purely personalised.
The ranker is a gradient-boosted model over watch history, freshness, creator features and device context, trained on logged impressions with watch time as the label. Clicks on the first row go straight into training. A lightweight re-ranker then enforces diversity so one creator can't fill the screen.
To evaluate, I'd track NDCG and watch time and ship if both go up. The A/B test would run for two weeks to cover weekly patterns.
For new users we'd probably just show popular videos. No plan for new videos.
- Problem framing3/5
Right objective and a scale estimate, but assumed the surface instead of asking.
Next question Before you draw anything, what are we optimising for, and for which users?
- Candidate generation5/5
Justified with a latency budget, not recited.
Next question Why two-tower instead of matrix factorisation?
- Ranking4/5
Strong features, watch time as the label and a diversity re-ranker. Loses a point for position bias: top-row clicks are mostly position, not relevance.
Next question What is the ranker actually learning from those clicks?
- Evaluation4/5
Offline and online metrics blurred together.
Next question NDCG went up offline but watch time dropped. Why?
- Cold start1/5
Mentioned in passing. Nothing for new videos. A staff-level answer raises it unprompted.
Next question A user signed up ten minutes ago. What's in their feed?
Passes at senior. Not yet at staff.
Answer this question free