← Uber Interview Insights

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

SeniorPrefer not to say
May 2026

Summary

Uber onsite system design round centered entirely on the classic driver location heatmap problem. The depth expected here is real, they want numbers, pipeline decisions, and geo-index knowledge all in one go.

Questions Asked (7)

Q1

Design a service that ingests live driver location updates and serves city-scale heatmap queries showing driver density across a viewport.

System DesignTechnical Trade-offsData Modeling
Author's notes

This is the whole round basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying functional and non-functional requirements, such as update frequency, query latency, and accuracy. Then propose a high-level architecture that separates ingestion (write path) from query serving (read path), using a streaming pipeline and a spatial index. Finally, dive into data modeling, trade-offs (e.g., consistency vs. availability), and scaling considerations.

Pro tip: Emphasize that heatmap queries are approximate by nature, so you can trade precision for performance by using geohash-based aggregation and pre-computed tiles, which also simplifies scaling.

1. Clarify Requirements

Ask about scale (number of drivers, updates per second), query patterns (viewport size, frequency), latency requirements, and accuracy expectations. This sets the stage for design decisions.

2. High-Level Architecture

Propose a write path (ingestion) using a message queue (e.g., Kafka) and a stream processor (e.g., Flink) to aggregate updates into spatial buckets. Propose a read path using a spatial database or in-memory store (e.g., Redis with geohashes) to serve heatmap queries.

3. Data Modeling & Indexing

Choose a spatial indexing scheme (e.g., geohash, S2, or Uber's H3) to bucket driver locations. Decide on the granularity (e.g., geohash precision) balancing accuracy and storage/query cost. Model the heatmap as a grid of cells with counts.

4. Query Serving & Caching

Design the query API to accept a viewport (bounding box) and return density per cell. Use pre-aggregated tiles or on-the-fly aggregation from the spatial index. Implement caching (e.g., CDN or Redis) for popular viewports.

5. Trade-offs & Scaling

Discuss trade-offs: consistency vs. latency (e.g., eventual consistency for updates), accuracy vs. performance (approximate counts), and cost. Explain scaling strategies: partitioning by geohash, sharding, and handling hot spots.

Key Points to Mention

  • Use of a streaming pipeline (Kafka + Flink) for real-time ingestion and aggregation.
  • Spatial indexing with geohash or H3 for efficient bucketing and querying.
  • Pre-computation of heatmap tiles at multiple zoom levels to serve queries quickly.
  • Caching strategy for frequently requested viewports to reduce load.
  • Trade-offs between consistency, latency, and accuracy (e.g., approximate counts).
  • Scaling considerations: partitioning, sharding, and handling skewed driver distributions.

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

Q2

How would you choose between Geohash and Uber's H3 hexagonal index for this heatmap use case?

System DesignTechnical Trade-offs
Author's notes

Knew H3 from reading Uber's engineering blog beforehand and name-dropped it early.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the heatmap's requirements: data volume, query patterns, update frequency, and accuracy needs. Then compare Geohash and H3 on key dimensions like cell shape, hierarchical indexing, neighbor traversal, and performance. Finally, recommend a choice based on the specific use case, acknowledging trade-offs and potential hybrid approaches.

Pro tip: Mention that H3's hexagonal grid provides uniform neighbor distances and better visual appeal for heatmaps, but Geohash's simplicity and widespread support may be sufficient if the use case doesn't require advanced spatial operations. Also, note that Uber developed H3 for their own geospatial needs, so it's battle-tested for ride-sharing heatmaps.

1. Clarify Requirements

Ask about the heatmap's scale (number of data points), query patterns (e.g., real-time vs. batch), required precision, and whether hierarchical aggregation is needed.

2. Compare Geohash and H3

Evaluate both systems on cell shape (rectangular vs. hexagonal), neighbor traversal, hierarchical indexing, distortion, and support for spatial operations like k-ring queries.

3. Assess Trade-offs

Discuss performance implications: H3 offers uniform adjacency and better visual representation, while Geohash is simpler, more widely supported, and easier to implement with existing libraries.

4. Consider Integration and Ecosystem

Factor in existing infrastructure, team familiarity, and whether the company (Uber) already uses H3 internally, which could reduce development effort.

5. Make a Recommendation

Choose based on the analysis, possibly suggesting H3 for Uber's use case due to its advantages in spatial analysis and alignment with Uber's tech stack, but remain open to Geohash if requirements are simple.

Key Points to Mention

  • Cell shape and adjacency: Hexagons have uniform distance to neighbors, reducing edge effects in heatmaps; rectangles in Geohash have varying neighbor distances.
  • Hierarchical indexing: Both support multiple resolutions, but H3's hierarchy is more consistent for aggregation and drill-down.
  • Performance: H3 may have higher computational overhead for encoding/decoding, but offers efficient k-ring queries; Geohash is lightweight and fast for simple point lookups.
  • Ecosystem and tooling: Geohash is widely supported in databases (e.g., PostGIS) and libraries; H3 is Uber's own, with growing support but less ubiquitous.
  • Use case alignment: For Uber's ride-sharing heatmaps, H3's design for spatial analysis and Uber's internal adoption make it a natural fit.
  • Hybrid approaches: Consider using Geohash for storage and H3 for analysis, or vice versa, depending on the pipeline.

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

Q3

How do you prevent double-counting a driver who moves between geo cells during aggregation?

System DesignAlgorithms & Data Structures
Author's notes

Blanked for a second here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the aggregation goal (e.g., unique drivers per time window) and the data model (event stream with driver_id, geo_cell, timestamp). Then propose a deduplication strategy such as windowed aggregation with a set of seen driver IDs or a stateful stream processing approach with keyed state and time-based eviction.

Pro tip: Mention that deduplication must be scoped to the aggregation window and that using a probabilistic data structure like HyperLogLog can trade accuracy for scalability, but be explicit about the trade-off.

1. Clarify requirements and constraints

Ask about the definition of 'double-counting' (e.g., same driver in multiple cells within a window), the time window, and whether exact or approximate counts are acceptable.

2. Model the data and identify the deduplication key

Treat the input as a stream of events (driver_id, geo_cell, timestamp). The deduplication key is driver_id, and the scope is the aggregation window (e.g., 5 minutes).

3. Choose a deduplication technique

For exact counts, use a stateful operator that maintains a set of seen driver IDs per window, with time-based eviction. For approximate counts, use a probabilistic structure like HyperLogLog per window.

4. Handle late and out-of-order events

Use event-time processing with watermarks to define window boundaries and allow late events to update the correct window, ensuring no double-counting across windows.

5. Scale and optimize

Partition the stream by driver_id to ensure all events for a driver go to the same stateful operator, enabling parallel deduplication. Consider memory management and state TTL.

Key Points to Mention

  • Windowed aggregation with event-time semantics and watermarks
  • Stateful stream processing (e.g., Flink, Spark Streaming) with keyed state
  • Deduplication using a set of driver IDs per window or probabilistic structures (HyperLogLog, Bloom filter)
  • Partitioning by driver_id to ensure correct state locality
  • Time-to-live (TTL) for state to avoid unbounded memory growth
  • Trade-offs between exact and approximate counting

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

Q4

The heatmap is an internal ops tool with two modes: a live view over the last 20 minutes and a historical replay over the past hour at one-minute granularity. How do you design the storage and serving layer for both?

System DesignData ModelingTechnical Trade-offs
Author's notes

This is the variant where geo-index stuff becomes secondary.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: data volume, read/write patterns, latency needs, and consistency requirements for both live and historical views. Then propose a dual-storage architecture: a fast in-memory store for the live view and a durable time-series database for historical replay, with a pipeline that aggregates and downsamples data. Finally, discuss trade-offs around cost, complexity, and scalability.

Pro tip: Emphasize the importance of a unified data model and ingestion pipeline to avoid duplication and ensure consistency between live and historical views. Mention that you would monitor and adapt the design based on actual usage patterns, showing a pragmatic approach.

1. Clarify Requirements

Ask about data volume (events per second), read patterns (queries per second, query types), latency requirements (live view should be sub-second, historical can be slightly slower), and retention (20 minutes vs 1 hour).

2. Design Data Model

Define a schema that captures events with timestamps, dimensions (e.g., region, service), and metrics. For live view, store raw events or 1-second aggregates; for historical, store 1-minute aggregates.

3. Choose Storage Technologies

For live view: use an in-memory data store like Redis with TTL for automatic expiration. For historical: use a time-series database like Cassandra or InfluxDB, or a columnar store like Parquet on S3 with a query engine.

4. Design Ingestion and Processing Pipeline

Ingest events via a message queue (e.g., Kafka). Use a stream processor (e.g., Flink) to compute aggregates in real-time: write raw events to live store and 1-minute aggregates to historical store.

5. Address Serving and Query Patterns

For live view, serve directly from Redis with low latency. For historical replay, query the time-series DB with time-range filters and downsampling. Consider caching frequent queries.

Key Points to Mention

  • Data partitioning and sharding strategies for scalability (e.g., by time and dimensions).
  • Trade-offs between pre-aggregation and on-the-fly computation for historical queries.
  • Use of TTL for automatic data expiration in the live store.
  • Ensuring consistency between live and historical views (e.g., by deriving both from the same stream).
  • Cost considerations: in-memory storage is expensive, so limit live data to 20 minutes.
  • Monitoring and alerting on pipeline lag and query performance.

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

Q5

How do you handle drivers who stop sending heartbeats? When and how do you remove them from the active count?

System DesignTechnical Trade-offs
Author's notes

Two options: lazy expiry (reconcile on next heartbeat) or timer-based (schedule a decrement after 20 minutes of silence).

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the context: what is a heartbeat, why drivers send them, and what the active count represents. Then propose a time-based expiration mechanism with a grace period, and discuss trade-offs between accuracy and availability, including how to handle false positives and ensure idempotent removal.

Pro tip: Emphasize that you would use a distributed, eventually consistent approach with a TTL-based expiry and a secondary verification step (e.g., a quick ping) before removal to avoid flapping, and mention that you'd monitor the removal rate as a health metric.

1. Clarify requirements and constraints

Ask about the expected heartbeat interval, acceptable latency for removal, and the impact of false positives/negatives on the system. Confirm whether the active count is used for real-time dispatch or just analytics.

2. Design a timeout-based expiration

Propose a TTL (time-to-live) for heartbeats, typically 2-3 times the heartbeat interval, after which the driver is considered inactive. Use a distributed store like Redis with TTL or a scheduled job to expire entries.

3. Implement a grace period and verification

Before removing, send a lightweight verification request (e.g., a ping) to confirm the driver is truly down. If no response within a short window, proceed with removal. This reduces false positives due to transient network issues.

4. Ensure idempotent and atomic removal

Use atomic operations (e.g., compare-and-delete) to avoid race conditions when multiple nodes try to remove the same driver. Make removal idempotent so repeated attempts don't cause errors.

5. Monitor and adjust

Track metrics like removal rate, false positive rate, and time-to-removal. Use these to tune the TTL and grace period. Consider a feedback loop to adjust dynamically based on network conditions.

Key Points to Mention

  • Heartbeat interval and TTL relationship (e.g., TTL = 3 * interval)
  • Trade-off between accuracy (removing quickly) and availability (avoiding false positives)
  • Use of distributed cache with TTL (e.g., Redis) or a database with periodic cleanup
  • Grace period and verification ping to handle transient failures
  • Idempotent and atomic operations to handle concurrency
  • Monitoring and alerting on removal rates to detect systemic issues

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

Q6

What happens if the aggregation logic or geo-bucketing definition changes and last week's heatmap data is wrong? How do you reprocess it?

System DesignData Modeling
Author's notes

Treat backfill as a first-class concern, not an afterthought.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that such changes require a systematic reprocessing strategy. Outline a pipeline that detects the change, versions the logic, backfills the affected data, and validates the results. Emphasize idempotency, data lineage, and minimizing disruption to downstream consumers.

Pro tip: Proactively mention that you would design the system to support reprocessing from day one, using immutable raw data and versioned logic. This shows foresight and prevents future reprocessing headaches.

1. Detect and Assess Impact

Identify the change and determine which data partitions and time ranges are affected. Assess the scope of impact on downstream systems and users.

2. Version and Isolate Logic

Ensure the new aggregation or geo-bucketing logic is versioned and can be applied independently. Keep the old logic available for comparison and rollback.

3. Reprocess Data

Trigger a backfill job that reprocesses the raw data for the affected period using the new logic. Ensure the job is idempotent and can handle large volumes efficiently.

4. Validate and Compare

Validate the reprocessed data against expected outcomes and compare with the old data to quantify differences. Use automated tests and sanity checks.

5. Publish and Communicate

Atomically swap the corrected data into production, update metadata, and notify stakeholders. Document the incident and update runbooks.

Key Points to Mention

  • Idempotent and restartable backfill jobs
  • Data versioning and lineage tracking
  • Incremental vs. full reprocessing trade-offs
  • Validation and quality checks (e.g., checksums, row counts)
  • Minimizing downtime and impact on downstream consumers
  • Automated alerting and monitoring for data quality issues

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

Q7

How do you handle hotspot cities like NYC or SF that generate 10x the traffic of an average city without overloading a single partition or shard?

System DesignTechnical Trade-offs
Author's notes

Sub-partition hot cells by appending a random bucket suffix to the cell key, then aggregate across buckets on the read side.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the hotspot problem and its impact on partition skew, then propose a multi-layered strategy: dynamic sharding with consistent hashing, geographic partitioning, and caching. Emphasize trade-offs between consistency, latency, and complexity, and how you would monitor and adapt to traffic patterns.

Pro tip: Mention that hotspots are often temporal (e.g., rush hour, events) and that solutions should be elastic, not just static partitioning. Also, highlight the importance of load testing and chaos engineering to validate your design under realistic skew.

1. Identify the bottleneck

Explain how a single partition or shard can become a bottleneck due to uneven key distribution, and quantify the impact (e.g., 10x traffic causing latency spikes or failures).

2. Choose a sharding strategy

Propose a sharding scheme that avoids hotspots, such as consistent hashing with virtual nodes, range-based sharding with dynamic splits, or a hybrid approach. Discuss how to handle rebalancing.

3. Leverage geographic partitioning

Suggest partitioning data by geographic region (e.g., city) so that NYC and SF traffic are isolated, but be careful about cross-region queries and data locality.

4. Implement caching and read replicas

Use caching (e.g., Redis) and read replicas to offload read traffic from the primary shards, especially for hot keys. Discuss cache invalidation and consistency trade-offs.

5. Monitor and auto-scale

Describe how to monitor per-shard load and automatically split or migrate shards when thresholds are exceeded. Mention tools like Prometheus and auto-scaling groups.

Key Points to Mention

  • Consistent hashing with virtual nodes to distribute load evenly and minimize rebalancing impact.
  • Geographic sharding (e.g., by city) to isolate hotspot traffic, but consider cross-region data access patterns.
  • Dynamic shard splitting and merging based on real-time load metrics.
  • Caching strategies (e.g., write-through, read-through) and CDN for static content to reduce backend load.
  • Trade-offs between consistency (e.g., eventual vs. strong) and availability/latency in hotspot scenarios.
  • Use of load testing and chaos engineering to validate the system under skewed traffic.

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