Start Here

Tier 1 · Building Blocks

Scale Reads

Scale Writes

Database Selection

Traffic Control

Consistency & Coordination

Estimation

Tier 2 · Core Systems

Tier 3 · Location & Real-Time

Tier 4 · Infrastructure & Data

Tier 5 · Finance & Commerce

Tier 6 · Advanced & Collaborative

Phase 1 — Clarify & Scope

Interviewer: Design a recommendation system — think Netflix's "What to Watch" or Amazon's "Customers Also Bought." What do you want to clarify?

Candidate: Key questions:

  1. What are we recommending — movies, products, articles, music?
  2. What signals do we have — explicit ratings, implicit clicks/views, purchase history?
  3. Real-time personalization (recommendations change within seconds of a new action) or batch (daily recompute)?
  4. Cold start: how do we handle new users with no history and new items never interacted with?
  5. What's the scale — users, items, interactions per day?

Interviewer: Netflix-style movie/show recommendations. Signals: implicit (watch history, ratings, search queries, pause/skip behavior). Real-time personalization — a user finishing a show should affect recommendations immediately. Cold start for both new users and new content. 200 million users, 50,000 items (movies/shows), 1 billion interactions per day.

Candidate: Let me size this:

Interactions/sec=10986,400≈11,574 events/sec\text{Interactions/sec} = \frac{10^9}{86{,}400} \approx 11{,}574 \text{ events/sec}

User-item interaction matrix=200M users×50,000 items=10 trillion cells\text{User-item interaction matrix} = 200\text{M users} \times 50{,}000 \text{ items} = 10 \text{ trillion cells}

The full matrix is extremely sparse (each user watches ~200 items on average):

Sparsity=1−200M×200200M×50,000=99.6%\text{Sparsity} = 1 - \frac{200\text{M} \times 200}{200\text{M} \times 50{,}000} = 99.6\%

Interviewer: What are the core requirements?

Candidate:

  • Return top-N recommendations for a user in < 100 ms
  • Personalize based on full watch history and recent behavior
  • Handle cold start: recommend popular/trending content to new users
  • Content diversity: don't recommend 10 versions of the same…

In the full tutorial

  • Phase 2 — High-Level Architecture
  • Phase 3 — Deep Dive & Evolution
  • Phase 4 — Robustness & Operations

Glossary history

Click dotted jargon to save explanations here.