← Reddit Interview Insights

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

SeniorPrefer not to say
May 2026Remote

Summary

Reddit system design round focused entirely on a game leaderboard service. Pretty deep dive, covered a lot more ground than I expected for a single question.

Questions Asked (6)

Q1

Design a leaderboard service for a game with tens of millions of players. Walk through the API, storage layer, and how you'd keep core operations fast.

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

I jumped straight to Redis sorted sets which felt right, but I spent too long justifying skip lists internally before they nudged me toward tradeoffs with a sharded relational store.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (e.g., leaderboard scope, update frequency, read/write ratio) and then propose a high-level architecture that separates write-heavy score updates from read-heavy leaderboard queries. Focus on using in-memory data structures like sorted sets for fast ranking and discuss trade-offs between consistency and latency. Walk through the API design, storage choices, and optimization techniques like sharding and caching.

Pro tip: Emphasize the read-heavy nature of leaderboards and propose a write-optimized ingestion pipeline that asynchronously updates the ranking structure, ensuring low latency for both writes and reads. Mention real-world examples like Redis sorted sets and how you'd handle sharding to scale beyond a single node.

1. Clarify Requirements

Ask about leaderboard scope (global, regional, friends), update frequency (real-time vs. periodic), and read/write patterns. Determine if approximate rankings are acceptable or if exact ordering is needed.

2. Design API

Define endpoints for submitting scores, retrieving top N players, and getting a player's rank. Consider pagination, filtering, and batch operations.

3. Choose Storage & Data Structures

Select an in-memory store like Redis with sorted sets for O(log N) inserts and rank queries. Discuss persistence and backup strategies for durability.

4. Scale with Sharding & Caching

Shard the leaderboard by player ID or score range to distribute load. Use caching for top N queries and consider read replicas for high read throughput.

5. Optimize Core Operations

Ensure fast writes via asynchronous updates and fast reads via precomputed rankings. Discuss trade-offs between consistency and latency, and how to handle hot keys.

Key Points to Mention

  • Use of Redis sorted sets for O(log N) score updates and rank queries
  • Sharding strategies to distribute the leaderboard across multiple nodes
  • Caching top N results to reduce load on the primary data store
  • Asynchronous processing of score updates to decouple writes from ranking computation
  • Trade-offs between strong consistency and eventual consistency for leaderboard updates
  • Handling hot keys and ensuring fault tolerance with replication

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

Q2

How would you design time-windowed leaderboards, like separate daily and weekly rankings that reset on a schedule?

System DesignData Modeling
Author's notes

Went with separate sorted sets per window and a background job to rotate them.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: what defines a leaderboard (e.g., score, upvotes), how often windows reset, and expected scale. Then propose a data model that partitions scores by time window (e.g., daily and weekly keys) and a storage solution optimized for fast range queries and updates, such as Redis sorted sets or a time-series database. Finally, discuss how to handle resets, aggregation, and read patterns to ensure low-latency access.

Pro tip: Mention that you would use a lazy reset approach—computing the current window on read—to avoid a thundering herd of writes at reset boundaries, and consider pre-aggregating weekly leaderboards from daily data to reduce write load.

1. Clarify Requirements and Scale

Ask about the expected number of users, updates per second, and read patterns. Determine if leaderboards are global or per-community, and whether scores are cumulative or event-based.

2. Design Data Model and Storage

Choose a storage system like Redis sorted sets for real-time ranking, with keys scoped by time window (e.g., 'leaderboard:daily:2023-10-05'). For persistence, consider a time-series database or periodic snapshots to cold storage.

3. Handle Window Resets and Aggregation

Implement lazy resets by computing the current window on read, or use scheduled jobs to roll over windows. For weekly leaderboards, aggregate daily scores to avoid recomputing from raw events.

4. Optimize for Read and Write Performance

Use in-memory stores for hot data, shard by time window or user ID, and cache top-N results. For writes, batch updates and use pipelines to reduce latency.

5. Address Scalability and Fault Tolerance

Discuss replication, persistence, and how to handle failures (e.g., Redis cluster with AOF). Consider trade-offs between consistency and availability for leaderboard updates.

Key Points to Mention

  • Use of Redis sorted sets (ZSET) for O(log N) insert and O(1) rank retrieval.
  • Time-windowed keys (e.g., daily:2023-10-05, weekly:2023-W40) to isolate windows.
  • Lazy reset vs. scheduled reset to avoid spikes at boundaries.
  • Aggregation of daily scores into weekly leaderboards to reduce write load.
  • Sharding and caching strategies for scalability.
  • Persistence and recovery mechanisms for durability.

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

Q3

How do you handle ties in the leaderboard rankings?

System DesignTechnical Trade-offs
Author's notes

Short answer: tiebreak on timestamp of when the score was achieved.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the product requirements and scale, then propose a tie-breaking strategy that balances fairness, performance, and simplicity. Discuss common approaches like stable sorting with secondary criteria, dense vs. competition ranking, and how to handle ties in real-time updates.

Pro tip: Mention that ties are often a product decision, not just a technical one—propose a default (e.g., earliest achievement time) but emphasize the need to align with product managers on user expectations.

1. Clarify Requirements

Ask about scale (number of users, updates per second), ranking criteria (score, time, etc.), and product expectations for tie handling (e.g., should tied users share the same rank or be ordered by a secondary metric?).

2. Choose a Ranking Method

Decide between competition ranking (1,2,2,4), dense ranking (1,2,2,3), or ordinal ranking with tie-breakers. Explain the trade-offs and suggest a default like competition ranking for simplicity.

3. Define Tie-Breaking Criteria

Propose secondary criteria such as earliest achievement time, user ID, or alphabetical order. Ensure the criteria are deterministic and stable to avoid confusion.

4. Implement Efficiently

Discuss data structures (e.g., balanced trees, sorted sets) and algorithms to handle ties at scale, including real-time updates and pagination. Consider using Redis sorted sets with composite scores.

5. Handle Edge Cases and Updates

Address scenarios like ties changing over time, bulk updates, and consistency across distributed systems. Mention caching and eventual consistency if applicable.

Key Points to Mention

  • Competition vs. dense ranking and their user experience implications
  • Stable sorting with secondary tie-breaker (e.g., timestamp, user ID)
  • Performance considerations for large-scale leaderboards (e.g., Redis sorted sets, composite scores)
  • Real-time updates and consistency in distributed environments
  • Product alignment: ties are often a product decision, not just technical
  • Edge cases: ties at boundaries (top 10), ties after score updates

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

Q4

Walk me through how you'd support regional leaderboards alongside a global one.

System DesignTechnical Trade-offs
Author's notes

I proposed routing players to region-local Redis instances and then periodically syncing top scores up to a global aggregator.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: what defines a region, how many regions, update frequency, and consistency needs. Then propose a design that ingests events into a stream processor, computes both global and regional aggregates, and serves them via a low-latency store, discussing trade-offs like precomputation vs. on-demand queries and consistency vs. availability.

Pro tip: Emphasize that regional leaderboards are essentially partitioned views of the same event stream, so you can reuse the global pipeline with a region key—this shows you think in terms of scalable, maintainable systems rather than one-off solutions.

1. Clarify Requirements

Ask about scale (number of regions, users, events per second), update frequency (real-time vs. batch), consistency requirements (eventual vs. strong), and how regions are defined (geography, community, etc.).

2. High-Level Architecture

Propose an event-driven pipeline: events go to a message queue (e.g., Kafka), then a stream processor (e.g., Flink) computes aggregates per region and globally, writing to a fast read store (e.g., Redis or Cassandra).

3. Data Modeling & Partitioning

Explain how to key events by region and user, and how to partition the processing to scale horizontally. Discuss whether to store separate leaderboards per region or a single table with region as a partition key.

4. Trade-offs & Optimizations

Discuss trade-offs: precomputing all regions vs. computing on demand; handling hot regions; using approximate algorithms (e.g., count-min sketch) for memory efficiency; and consistency models (e.g., eventual consistency for leaderboards).

5. Failure Handling & Monitoring

Mention how to handle failures (e.g., idempotent processing, checkpointing), backfill historical data, and monitor for lag or anomalies in regional leaderboards.

Key Points to Mention

  • Event streaming with Kafka and stream processing with Flink/Spark Streaming
  • Partitioning by region to enable parallel computation and scalability
  • Storage choices: Redis sorted sets for real-time leaderboards, or Cassandra for durability
  • Trade-offs between precomputation (low latency, higher cost) and on-demand computation (flexible, higher latency)
  • Consistency models: eventual consistency is often acceptable for leaderboards
  • Handling hot regions and skew via techniques like sharding or approximate counting

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

Q5

How would you implement a 'nearby players' feature that returns players ranked just above and below a given player?

System DesignAPI & Integrations
Author's notes

Redis sorted sets make this pretty clean with range-by-rank queries.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what defines 'nearby' (e.g., rank difference, score proximity), how often the leaderboard updates, and the expected scale. Then propose a data structure like a balanced BST or skip list that supports efficient rank queries and range retrieval, and discuss how to handle updates and consistency.

Pro tip: Mention that you'd cache the nearby results for hot players and use a read-through cache with a short TTL, since leaderboards are read-heavy and slight staleness is usually acceptable.

1. Clarify requirements and constraints

Ask about the definition of 'nearby' (e.g., fixed number of players above/below, score range), update frequency, read/write ratio, and scale (number of players, queries per second).

2. Choose a data structure

Select a structure that supports efficient rank queries and range retrieval, such as a balanced binary search tree (e.g., red-black tree) or a skip list, where each node stores subtree size to compute ranks.

3. Design the API and query logic

Define an endpoint like GET /players/{id}/nearby?count=5 that returns the player and the specified number of players above and below. Explain how to find the player's rank and then traverse the tree to collect neighbors.

4. Address updates and consistency

Discuss how to handle score updates: update the tree (remove and reinsert) and consider using a write-ahead log or periodic snapshots for durability. For distributed systems, consider sharding by player ID or using a global sorted set with eventual consistency.

5. Optimize for performance and scale

Propose caching frequently requested nearby lists, using read replicas, and possibly precomputing nearby lists for top players. Mention trade-offs between consistency and latency.

Key Points to Mention

  • Balanced BST or skip list with subtree sizes for O(log n) rank queries and O(log n + k) range retrieval.
  • Handling ties in scores: define a tie-breaking rule (e.g., by player ID or timestamp) to ensure deterministic ordering.
  • Caching strategy: use Redis or Memcached to cache nearby results for hot players, with appropriate invalidation on updates.
  • Sharding and distribution: if the leaderboard is too large for a single machine, shard by player ID or use a distributed sorted set like Redis Sorted Sets.
  • Consistency trade-offs: eventual consistency may be acceptable for leaderboards; discuss how to handle stale reads.
  • API design: include parameters for count, direction (above/below), and possibly a score range instead of fixed count.

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

Q6

How do you handle persistence and recovery for the leaderboard if the in-memory store goes down?

System DesignTechnical Trade-offs
Author's notes

Talked through Redis AOF and RDB snapshotting, plus the idea of rebuilding from a durable write-ahead log in a backing database if you need full recovery.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what consistency, durability, and recovery time are acceptable? Then describe a layered persistence strategy, such as write-through to a durable store (e.g., Redis with AOF/RDB or a database) and periodic snapshots, and explain how recovery works on restart. Finally, discuss trade-offs between performance and durability, and mention how you would handle failures gracefully.

Pro tip: Emphasize that the leaderboard is often eventually consistent and that you can rebuild it from the durable store, so you don't need synchronous writes on every update. Also, mention that you would monitor and alert on persistence failures to avoid silent data loss.

1. Clarify requirements and constraints

Ask about expected read/write patterns, acceptable latency, durability guarantees, and recovery time objectives (RTO/RPO). This shows you don't jump to solutions without understanding the problem.

2. Choose a persistence strategy

Describe options like write-through caching to a durable store (e.g., Redis with AOF, DynamoDB), periodic snapshots, or event sourcing. Explain how each affects performance and durability.

3. Design the recovery process

Explain how the system reloads data on restart: e.g., replaying logs, loading snapshots, or rebuilding from the source of truth. Mention how to handle partial failures and ensure consistency.

4. Discuss trade-offs and failure handling

Compare synchronous vs asynchronous persistence, latency vs durability, and cost. Describe how to degrade gracefully (e.g., serve stale data) and how to alert on failures.

5. Summarize and validate

Recap your approach, highlighting how it meets the requirements, and invite feedback or further questions to show collaboration.

Key Points to Mention

  • Write-through vs write-behind caching and their impact on durability and latency
  • Using Redis with AOF (append-only file) or RDB snapshots for persistence
  • Periodic snapshots to object storage (e.g., S3) for backup and recovery
  • Event sourcing or change data capture (CDC) to rebuild the leaderboard
  • Trade-offs between strong consistency and eventual consistency
  • Monitoring, alerting, and automated failover for persistence failures

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