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 real-time gaming leaderboard — think a global leaderboard for a mobile game or an esports tournament ranking system. What do you want to clarify?

Candidate: A few questions:

  1. What's the leaderboard scope — global (all players), regional (per country), or per-game-session (temporary)?
  2. What triggers a score update — end of match, continuous score during gameplay, or daily aggregation?
  3. What's the read pattern — top-N query, or arbitrary rank lookup (where am I ranked among 100M players)?
  4. How many players and score updates per second?
  5. Does the rank need to be exact, or can it be approximate?

Interviewer: Global leaderboard for a mobile game. 100 million players, each with a cumulative lifetime score. Score updates happen at match end — about 10 million matches completed per day. Reads: display top-100 globally, plus the requesting player's rank and score. Exact ranks required. Near real-time updates — rank should reflect the latest completed match within 30 seconds.

Candidate: Let me size this:

Score updates/sec=10M matches/day86,400≈116 updates/sec average\text{Score updates/sec} = \frac{10\text{M matches/day}}{86{,}400} \approx 116 \text{ updates/sec average}

Peak updates (10× average)=1,160 updates/sec\text{Peak updates (10× average)} = 1{,}160 \text{ updates/sec}

Read queries=100M DAU×5 leaderboard views/day/86,400≈5,787 reads/sec\text{Read queries} = 100\text{M DAU} \times 5 \text{ leaderboard views/day} / 86{,}400 \approx 5{,}787 \text{ reads/sec}

For rank calculation: 100M players sorted by score. A naive SQL COUNT(*) WHERE score > player_score takes O(N) — unacceptable at 100M rows.

Interviewer: What are the core requirements?

Candidate:

  • Update player score (atomic increment, not absolute…

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.