Game Leaderboard

Design a real-time game leaderboard that ranks millions of players by score, supports regional and time-windowed boards, and serves both top-N and a given player’s rank cheaply.

00

Practice checkpoints

The requirements are open as a taste. From the numbers onward, the full guide opens in the app.

  1. 01
    Clarify scope
  2. 02
    Requirements + scale
  3. 03
    API + data modelUnlocks in the app
  4. 04
    Draw architectureUnlocks in the app
  5. 05
    Deep diveUnlocks in the app
  6. 06
    Trade-off decisionUnlocks in the app
01

Requirements that shape the design

Do not only state requirements. Ask for them. Each card pairs the design constraint with a clarification question you can say out loud before drawing the architecture.

Functional requirements

01When a match ends, what is the score event — latest score, best score, or cumulative points?

Keep-highest score semantics: an update only ever raises a player’s recorded best (ZADD GT does this in one atomic step), so replays and out-of-order submissions can never lower it.

02Does a player see only the top-100, or their own exact position on the board?

Two read shapes: a public top-N board, and every player’s own position — “you are #48,231” — which is a different and much harder query than the top list.

03Where do score writes come from — the game client, or a server we trust?

Only trusted game servers submit scores, and every submission passes anti-cheat validation before it can touch any public ranking.

04Is the board permanent, or does it reset every week or season?

Weekly and seasonal boards reset on schedule: the new season opens instantly at rollover while the closed board stays readable for rewards.

05Do players compete against strangers, or against their friends?

A friends view ranks the player among their own friends list — a per-user slice over the same scores, not another scoreboard to maintain.

06Two players land on exactly the same score — who shows up higher?

Ties break deterministically — earlier achieved-at timestamp wins — so two equal scores never swap places between two refreshes.

Out of scopeMatchmaking and skill rating (Elo/MMR) — this board ranks scores, not skill · Reward fulfillment and payouts when a season closes · The anti-cheat detection models themselves (we design the gate, not the detector)

Non-functional requirements

01My match just ended — how soon must my new rank show up?

A new score is visible in rankings within seconds — players check right after a match, and a stale rank reads as a bug.

02How fast do the board and my-rank screens have to load?

p95 under 100 ms for both read shapes: top-N from a cached snapshot, my-rank from one indexed lookup — never a scan.

03A tournament closes and two million players finish at once — then what?

The write path absorbs a 10-50× burst at event end by buffering and batching, so scores queue for a few seconds instead of dropping.

04The Redis node holding a board dies — are those scores gone?

Durable score rows are the source of truth; every sorted set is a derived cache that can be rebuilt after a node loss.

05Can a tampered client put itself at #1?

No score reaches a public board without server-side validation — a leaderboard is a trophy case, which makes it the #1 tampering target.

Keep asking — the interview is a conversation

Real interviews probe far more than a tidy list. These are the scope questions that separate candidates who interrogate the problem from those who recite it.

  • Before I size this: how many daily players and games per day, and how spiky is the end of an event?
  • Is exact global rank a hard requirement for all 100M players, or is “top 1%” acceptable below the top bands?
  • How long must a closed season stay queryable, and does anything ever write to it again?
  • For the friends view — how big is a typical friends list, and do we own the social graph or call another service?
  • When a score looks suspicious, do we hold it invisible pending review, or show it and retract later?
01

Unlock the full playbook for Game Leaderboard

Numbers, architecture diagram, API and data model, deep dives, expected topics, self-check, whiteboard starter, and common mistakes unlock inside the app.

02

Numbers that force architecture decisions

Locked in the app

03

Architecture path

Locked in the app

04

API and data model

Locked in the app

05

Deep dive directions

Locked in the app

+Series

Practice the related series