Design a game leaderboard service
Company: Reddit
Role: Software Engineer
Category: System Design
Difficulty: easy
Interview Round: Onsite
## System Design: Game Leaderboard
Design a backend service that powers leaderboards for an online game.
### Core functionality
- Players submit score updates (or score deltas) for a given **game mode** and **season**.
- Clients can query:
- **Top K** players for a leaderboard (e.g., top 100)
- A given player’s **current rank** and **score**
- A **range around a player** (e.g., ranks 9,950–10,050)
- Support **ties** deterministically (e.g., same score → break ties by earliest timestamp or player_id).
### Non-functional requirements (you may assume numbers)
- Large scale (e.g., tens of millions of players; up to hundreds of thousands of score updates/sec at peak).
- Low read latency (e.g., p95 < 100 ms for top-K queries).
- “Near real-time” freshness (e.g., leaderboard reflects updates within a few seconds).
- High availability across regions.
### Constraints / discussion points
- Score update semantics: only allow **monotonic increase** (best score) vs allow arbitrary overwrites.
- How to handle **seasons/resets**, **multiple regions**, and **multiple game modes**.
- How to prevent/mitigate **cheating** and abusive update patterns.
Provide APIs, data/storage design, scaling strategy, and consistency tradeoffs.
Quick Answer: This question evaluates a candidate's ability to design scalable, low-latency backend systems and distributed data architectures, covering competencies such as API and data model design, consistency and availability trade-offs, partitioning and caching strategies, multi-region deployment, and operational concerns like freshness and abuse mitigation. Commonly asked in the system design domain, it probes both conceptual understanding of architectural trade-offs and practical application of scaling, storage and consistency choices for real-time leaderboards across seasons and game modes.