System Design
Recommendation System
Design a personalized recommendation system like Netflix's.
Functional requirements
- Serve a personalized, ranked list of ~50 titles for a user's homepage on request.
- Incorporate user behavior signals (watches, completions, ratings, browse/click events) into future recommendations.
- Reflect recent user activity in recommendations within minutes (e.g., a just-finished show influences the next homepage load).
- Support new titles being recommendable within hours of catalog ingestion, and provide reasonable recommendations for brand-new users.
- Allow filtering by business rules at serve time (regional licensing, maturity ratings, already-watched exclusions).
Non-functional requirements
- Recommendation serving must return within a p99 of 200ms end-to-end (it blocks homepage render).
- Serving path prioritizes availability over freshness: always return some recommendation list, degrading to less-personalized results rather than erroring.
- Behavioral event ingestion must be durable: losing interaction data degrades model quality; at-least-once delivery is acceptable.
- Model/feature updates need only eventual consistency; users may briefly see slightly stale personalization, but never a broken or empty homepage.
- User viewing history is sensitive: access-controlled, encrypted at rest, and deletable on user request (compliance).
Scaling & constraints
- 300M MAU, 120M DAU; average user loads the homepage 4 times per day, with a 3x global peak-to-average factor.
- Catalog of ~20K titles, growing ~5% per year; each title has ~2KB of metadata plus learned embeddings.
- Each active user generates ~200 behavioral events per day; each event is ~500 bytes.
- Read:write ratio at the serving layer is roughly 1:50 in favor of writes (events vastly outnumber homepage requests, but reads are latency-critical).
- Raw event data retained for 2 years for model training; user-facing history retained indefinitely until deletion request.
- Per-user feature vectors are ~5KB; per-title feature vectors are ~10KB.
Out of scope
- Video encoding, storage, and playback/CDN delivery.
- The details of ML model architectures and training algorithms (treat models as black boxes with defined inputs/outputs).
- Search and explicit browse/catalog navigation.
- Billing, subscriptions, and account management.
Sign in to save your progress
AI design evaluation
Get a grounded score, what your design does well, its gaps, and what to study next.
Sign in to get AI feedback on your design.