Design per-player game high scores and efficient score-neighbor queries with explicit ties, friend filtering, update consistency, and hot-game scaling.
Find Nearby High Scores in a Large Game Leaderboard
Company: Meta
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Onsite
Design a video-game score leaderboard with players, games, friendship relationships, and one stored high score per player-game pair. After a player finishes a game, the service should efficiently show nearby scores in a large dataset.
### Constraints
The meaning of nearby, the number of neighbors, ranking ties, score direction, and whether results are global or friend-filtered are unspecified. Clarify these policies. Preserve a single high-score record per player-game pair rather than treating every play as an independent leaderboard entry.
### Clarifying Questions
- Does nearby mean closest numeric scores, immediately higher/lower ranked players, or a range around the new score?
- Is a higher score always better, and how should equal scores be ordered?
- Are results global, friends-only, or both?
- Is the lookup centered on the latest play's score or the player's stored high score?
```hint Separate high-score updates from neighbor queries
An atomic best-score update and a range query over an ordered index solve different parts of the request.
```
### What a Strong Answer Covers
- Player-game score identity, atomic high-score changes, and a clear tie policy.
- An ordered index supporting range or predecessor/successor queries.
- Friend filtering, partitioning, hot games, and consistency between updates and displayed neighbors.
### Follow-up Questions
- What if a player's latest score is below their personal best?
- How would a friends-only leaderboard change the indexing or query strategy?
Overview: Design per-player game high scores and efficient score-neighbor queries with explicit ties, friend filtering, update consistency, and hot-game scaling.
Find Nearby High Scores in a Large Game Leaderboard
Meta
Sep 4, 2026
hardSoftware EngineerOnsiteSystem Design
0
0
Design a video-game score leaderboard with players, games, friendship relationships, and one stored high score per player-game pair. After a player finishes a game, the service should efficiently show nearby scores in a large dataset.
Constraints
The meaning of nearby, the number of neighbors, ranking ties, score direction, and whether results are global or friend-filtered are unspecified. Clarify these policies. Preserve a single high-score record per player-game pair rather than treating every play as an independent leaderboard entry.
Clarifying Questions Guidance
Does nearby mean closest numeric scores, immediately higher/lower ranked players, or a range around the new score?
Is a higher score always better, and how should equal scores be ordered?
Are results global, friends-only, or both?
Is the lookup centered on the latest play's score or the player's stored high score?
What a Strong Answer Covers Guidance
Player-game score identity, atomic high-score changes, and a clear tie policy.
An ordered index supporting range or predecessor/successor queries.
Friend filtering, partitioning, hot games, and consistency between updates and displayed neighbors.
Follow-up Questions Guidance
What if a player's latest score is below their personal best?
How would a friends-only leaderboard change the indexing or query strategy?