Backend system design · about 40 minutes
Leaderboard
Design the leaderboard of an online game. After each match, the score of a player changes, and each player can see the top 10 and their own rank. The game has a board for today, a board for this week and a board for all time. A new score must show in a few seconds, and no score can be lost.
Ask first
- How many players does the game have, and how many score updates come each second at the peak?
- Does a score only increase, or can it decrease? Is it a sum of points or the best result?
- Must each player see an exact rank, or is an estimate sufficient far from the top?
- Which boards do we need: all time, each day, each week, each region, friends only?
- Two players have the same score. Which of them is first?
The outline
Write your own outline for each part first.
The strong answer, the pitfalls and the follow-ups opens with a year in the app. What a year includes