Design a gaming leaderboard
Rank millions of players by score in real time and show each player their position, like a mobile game’s global leaderboard.
Functional requirements
- Update a player’s score after each match
- Show the top 100 players
- Show a player’s own rank and the players around them
Non-functional requirements
- Rank lookups in under 50 ms
- Score updates appear within a second
- The leaderboard survives a cache restart
Scale
- 50M players, 5M daily active
- 10K score updates per second at peak
- Leaderboards reset every month
How you’ll be scored
8 checks covering your diagram and your notes, and any valid approach counts. Hints appear for anything you miss. Common mistakes, such as single points of failure or components you never explain, cost points. How grading works
What interviewers look for
- Clarify before you draw. State what is in and out of scope. For “Design a gaming leaderboard”, that starts with: Update a player’s score after each match; Show the top 100 players; Show a player’s own rank and the players around them. Interviewers notice candidates who pin the requirements down first.
- Turn the scale into numbers. The scale (50M players, 5M daily active; 10K score updates per second at peak; Leaderboards reset every month) should become requests per second, storage and bandwidth, and those figures should drive your choices. Estimates with units carry more weight than adjectives.
- Show how each quality is met. Your design should visibly deliver: Rank lookups in under 50 ms; Score updates appear within a second; The leaderboard survives a cache restart. Saying that it does isn’t enough; point to the part of the design that makes it true.
- Expect follow-ups on the hard parts. Interviewers usually probe sorted sets, caching and real-time here. This is an easy problem, so interviewers expect the fundamentals done cleanly: a clear request path, the right kind of data store, and a reason for each component.
- Explain failure and trade-offs. Say what happens when a component fails, where a single point of failure would hurt, and what you chose not to build. Naming a trade-off is a stronger answer than claiming there isn’t one.