Question presented to candidate:
"Design a maps product like Google Maps. Users pan and zoom a map of the world, search for a place, ask for driving directions with an ETA, and get rerouted when traffic changes. Pick the parts you think are hardest and go deep."
What a strong answer should cover:
Scope it into three systems: map rendering (tiles), routing and ETA (a road graph), and live traffic (location pings turned into road speeds); places search as a fourth, smaller one
Tiles: the z/x/y tile pyramid (4^z tiles at zoom z), pre-rendered or vector tiles rendered on the device, served from a CDN with long cache lifetimes
Routing: the road network as a weighted graph; Dijkstra is correct but explores too much, A* uses a distance heuristic, and contraction hierarchies precompute shortcuts so continental queries touch few nodes
Traffic: phones send GPS pings, map matching snaps them to road segments, a streaming job computes current speed per segment, and edge weights are updated; ETA = sum of segment times, rerouting when a better route appears
Capacity numbers (tiles, graph memory, pings per second, route requests per second) and what breaks first at 10x
Clarifying questions expected:
Which features are in scope: viewing, search, directions, live navigation, offline maps?
How many daily users and route requests, and how many users navigating at once?
Driving only, or also walking, cycling and transit?
Code / implementation expected: Optional โ the design with numbers; the example computes tile coordinates and compares Dijkstra and A* on a road grid with a traffic jam.
system-design
case-study
2
Try it yourself
Sketch your approach before you read the solution. That is what the interview tests.
Stuck? Get a hint.
A short nudge toward the approach. It will not give the answer away.
3
Solution
Target Audience: Developers preparing for system design interviews. You know what a CDN and a graph are; shortest-path algorithms are explained from scratch.
Difficulty: Hard
Verified with: Node 22.22, Python 3.12, Go 1.24 and Java 21 (all four print identical output).
How to read this doc: Every idea is explained in plain language first, then tagged with ๐ Interview term: so you also learn the exact words an interviewer expects. All behaviour shown comes from running the example; the Verified section quotes the full output. Capacity numbers are worked from stated assumptions; nothing here describes Google internals, which are not public in this detail.
1. Why This Even Matters โ A Story First
A paper road atlas has a page for the whole country, then pages for each region, then city pages with every street. You never unfold the whole country at street level
The solution is hidden so you can try first
15 min read ยท 14 sections
4
Read the code
Maps core: slippy-map tile math, Dijkstra vs A* on a road grid, and rerouting around a traffic jam