Design a game leaderboard service
Company: Meta
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Onsite
Design a **game scoring leaderboard** system.
### Core requirements
- Players can submit/update their score.
- A player can view:
1. **Their own score and rank**.
2. **Friends leaderboard**: ranks/scores among their friends.
3. **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
Quick Answer: This question evaluates a candidate's ability to design scalable, low-latency ranking services, testing competencies in distributed systems, data modeling, API design, and consistency and performance trade-offs in the System Design domain.