Design a game scoring leaderboard system.
Core requirements
-
Players can submit/update their score.
-
A player can view:
-
Their own score and rank
.
-
Friends leaderboard
: ranks/scores among their friends.
-
Global leaderboard
: ranks/scores among all players.
-
Support showing:
-
Top 10 friends
(and include the user if needed).
-
Top 10 global
.
-
“Around me”
: e.g., show the user and ~10 entries above/below them.
-
The leaderboard UI can
scroll/paginate
through global rankings.
Clarifications to cover
-
Define tie-breaking (same score).
-
Latency/throughput targets (assume large scale).
-
Consistency expectations (how fresh must ranks be?).
Provide:
-
API design
-
Data model
-
High-level architecture
-
Storage/algorithm choices for ranking and scrolling
-
Scaling, caching, and failure/edge cases