← Uber Interview Insights

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

SeniorPrefer not to say
Jun 2026

Summary

Uber system design round for a software engineer role. Two pretty meaty questions back to back, one on distributed location streaming and one on consensus algorithms. Left feeling okay about the first but a bit shaky on the second.

Questions Asked (2)

Q1

Design a real-time driver heat map system that streams live driver locations over WebSocket, partitions the map into cell IDs, and efficiently returns the top-K busiest cells.

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

This one I actually enjoyed.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (scale, latency, accuracy) and then propose a high-level architecture with WebSocket ingestion, a stream processing layer, and a storage/query layer. Focus on the core algorithmic challenge of maintaining top-K busiest cells efficiently under high throughput, and discuss trade-offs between different approaches.

Pro tip: Emphasize that the top-K problem can be solved with a combination of a hash map for counts and a min-heap of size K, but also mention that for sliding windows or approximate results, data structures like count-min sketch or t-digest can be used. Show awareness of the CAP theorem and how it affects consistency vs. availability in a real-time system.

1. Clarify Requirements and Scale

Ask about the number of drivers, update frequency, expected QPS, latency requirements, and accuracy needs. This will guide design decisions.

2. High-Level Architecture

Outline components: WebSocket servers for ingestion, a stream processing system (e.g., Kafka + Flink), a storage layer for cell counts (e.g., Redis), and a query service for top-K.

3. Data Partitioning and Cell ID Design

Explain how to map geographic coordinates to cell IDs (e.g., geohash, S2, or custom grid). Discuss partitioning strategies to distribute load across nodes.

4. Efficient Top-K Computation

Describe algorithms for maintaining top-K busiest cells: using a min-heap of size K with a hash map for counts, or approximate methods for scalability. Discuss sliding windows and time decay.

5. Trade-offs and Optimizations

Discuss trade-offs: exact vs. approximate, push vs. pull for updates, consistency vs. availability, and how to handle failures and scale.

Key Points to Mention

  • WebSocket for real-time bidirectional communication and handling connection scaling (e.g., using a load balancer with sticky sessions).
  • Cell ID generation using geohashing or S2 geometry, and how to choose cell size based on desired granularity.
  • Stream processing with windowing (e.g., tumbling or sliding windows) to compute counts over time.
  • Top-K algorithms: min-heap with hash map for exact results, or count-min sketch with heap for approximate results at scale.
  • Data storage: using Redis sorted sets or in-memory databases for fast updates and queries.
  • Trade-offs: latency vs. accuracy, centralized vs. distributed computation, and handling hot cells (e.g., sharding by cell ID).

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

Q2

Explain how the Paxos and Raft consensus algorithms work, and what the main differences between them are.

System DesignTechnical Trade-offs
Author's notes

This hit me sideways.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the problem both algorithms solve: achieving consensus in a distributed system. Then explain each algorithm's core mechanism and roles, and finally compare their design philosophies, ease of understanding, and practical trade-offs.

Pro tip: Emphasize that Raft was designed for understandability, while Paxos is more general but harder to implement correctly. Mention real-world systems like etcd (Raft) and Chubby (Paxos) to show practical awareness.

1. Define the consensus problem

Briefly explain why consensus is needed in distributed systems: to ensure all nodes agree on a single value despite failures.

2. Explain Paxos

Describe the roles (proposers, acceptors, learners) and the two-phase protocol (prepare/promise, accept/accepted). Mention that Paxos is notoriously difficult to understand and implement.

3. Explain Raft

Describe Raft's leader election, log replication, and safety mechanisms. Highlight its strong leadership and simpler state space compared to Paxos.

4. Compare key differences

Contrast their design goals: Paxos is foundational and flexible but complex; Raft is engineered for understandability and used in production systems like etcd and Consul.

5. Discuss trade-offs and use cases

Explain when to choose each: Paxos for high-performance, custom consensus (e.g., Google Spanner); Raft for easier implementation and maintenance (e.g., Kubernetes, Uber's own systems).

Key Points to Mention

  • Paxos roles: proposers, acceptors, learners; Raft roles: leader, follower, candidate.
  • Paxos uses a two-phase protocol with prepare/promise and accept/accepted; Raft uses leader election and log replication.
  • Raft's strong leader simplifies log management and makes it easier to reason about safety.
  • Paxos is more general and can be used for multi-decree consensus (Multi-Paxos), but is harder to implement correctly.
  • Raft is used in etcd, Consul, and TiKV; Paxos is used in Google Chubby, Spanner, and Amazon DynamoDB.
  • Trade-offs: Raft prioritizes understandability and maintainability; Paxos offers flexibility and potentially higher performance in optimized implementations.

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