← Reddit Interview Insights

Reddit·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
Jun 2026

Summary

System design round at Reddit for a software engineering role. The whole session was basically one big deep dive into leaderboard architecture, which sounds contained but spiraled into a lot of territory fast.

Questions Asked (1)

Q1

Design a real-time game leaderboard that supports score updates, top-K queries, rank lookups, range queries (e.g. players ranked around a given position), and multiple leaderboard scopes like per-region or per-time-window.

System DesignTechnical Trade-offsAlgorithms & Data Structures
Author's notes

I started with Redis sorted sets because that felt obvious, but then the follow-ups kept coming and I realized I hadn't thought hard enough about the sharding story.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: scale (players, updates per second, query load), latency needs, consistency, and scope definitions. Then propose a layered architecture: an in-memory sorted structure (e.g., balanced BST or skip list) per scope for fast updates and rank queries, backed by a durable store (e.g., Redis sorted sets or a database) for persistence and recovery. Discuss trade-offs between different data structures and how to handle multiple scopes efficiently.

Pro tip: Emphasize that real-time leaderboards are read-heavy and often need approximate or eventual consistency; using Redis sorted sets (ZSET) with O(log N) operations is a common industry solution, but be ready to discuss sharding and partitioning strategies for massive scale.

1. Clarify Requirements and Scope

Ask about expected number of players, update frequency, query patterns (top-K, rank, range), latency SLAs, and how scopes (region, time window) are defined and combined. Determine if consistency can be eventual or must be strong.

2. Design Core Data Structures

Propose an in-memory sorted data structure (e.g., skip list, balanced BST, or Redis ZSET) that supports O(log N) insert/update, O(log N + K) top-K, and O(log N) rank lookup. Discuss how to handle ties and score updates.

3. Handle Multiple Scopes and Partitioning

Explain how to maintain separate leaderboards per scope (e.g., per region, per time window) and how to aggregate or query across scopes. Consider sharding by scope or player ID to distribute load.

4. Address Persistence, Recovery, and Scalability

Describe how to persist updates (e.g., write-ahead log, periodic snapshots) and recover state after failures. Discuss scaling reads via replication and caching, and scaling writes via sharding or batching.

5. Discuss Trade-offs and Optimizations

Compare alternatives (e.g., database with indexes vs. in-memory store), and mention optimizations like approximate rank, caching top-K, and using time-bucketed leaderboards for time windows.

Key Points to Mention

  • Use of Redis Sorted Sets (ZSET) or similar in-memory sorted structures for O(log N) operations.
  • Sharding and partitioning strategies to handle high write throughput and large player counts.
  • Trade-offs between strong and eventual consistency, and how to handle stale reads.
  • Time-window leaderboards: bucketing by time intervals and merging results.
  • Persistence and recovery mechanisms: snapshots, write-ahead logs, and replication.
  • Caching strategies for top-K and range queries to reduce load on the primary store.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.