Design a driver location heatmap
I was asked this
No reports yet. Sign in to say where you were asked it.
A system design interview question asked in Uber's system design round and at Amazon, last asked May 2026. It tests geospatial, streaming and aggregation.
Design a live map of a city that shows, every few seconds, where available drivers are dense and where rider demand is high, built from millions of driver location pings. The map is divided into grid cells; clients (operations dashboards and the driver app) subscribe to a region and receive updates, including the busiest cells.
Requirements
- Functional: ingest driver pings (driver id, position, status, time) and ride requests; count available drivers and demand per cell over a recent window; publish updates for each region to subscribed clients over a persistent connection; return the top K busiest cells in a region; subscribe and unsubscribe as a client moves the map.
- Non-functional: millions of pings per minute at peak; updates visible within a few seconds; scales to many cities and many viewers; tolerates node failures without wrong counts for long.
Clarifying questions
- What is the ping rate per driver, and how many active drivers in the busiest city?
- How fresh must the map be, and how long is the counting window?
- Which cell system and size, and do clients zoom between levels?
- Who are the viewers: thousands of operations staff, or every driver?
- Do we need history (replay yesterday's heatmap) or only live data?
What a strong answer covers
- A cell scheme (geohash, S2 or H3) and why; counting a driver once per window even if it pings many times or crosses cells.
- An ingestion path: a gateway into a partitioned log keyed by city or cell, stream processors keeping windowed counts per cell, and dropping late or duplicate pings.
- Where aggregation happens (on the device, at the edge, or on the server) and how often results are published.
- Top K per region from the cell counts, maintained incrementally.
- Fan-out to clients: WebSocket servers, subscriptions by region and zoom level, sending deltas, and handling many viewers of one city.
- Failure handling: rebuilding counts from the log after a processor fails, and how stale data is shown.
Follow-ups
- Show the heatmap at several zoom levels without recomputing every level from raw pings.
- A city event creates a sudden spike in one area. What breaks first?
- The cell counts are kept by several replicas that must agree on which one leads. How do consensus protocols such as Paxos and Raft decide that, and how do they differ?
Where it's asked
- Uber · System design · Last asked May 202660 min · Whiteboard and discussion
- Amazon
What it tests
geospatial · streaming · aggregation
Sign in to see the worked answer
The full answer, chapter by chapter, with what interviewers expect at each level. New accounts get 5 credits: each one unlocks a question for good.
What the labs asked this week
A weekly email of what OpenAI, Anthropic and the other top AI labs asked engineers, round by round.

