Show a map, find the fastest route and estimate arrival time for a whole planet of roads.
“Design Google Maps.”
It is short on purpose. Your first job is to make it specific.
| What they check | Why it matters |
|---|---|
| Splitting a huge product into services | “Maps” is at least four systems: drawing the map, finding a place, finding a route, and live traffic. A strong candidate names them, draws the line between them, and picks the one to go deep on. |
| Thinking in tiles, not in pictures | A planet cannot be sent to a phone. The interviewer wants to hear about a pyramid of tiles, what each zoom level costs, and why a CDN does almost all of the work. |
| Knowing why Dijkstra is not enough | Everyone can say “shortest path”. A senior candidate knows that plain Dijkstra on a whole continent takes seconds, and that the real answer is preprocessing the graph. |
| Live data versus precomputed data | Preprocessing makes queries fast but goes stale when traffic changes. How you keep both ideas is the heart of the problem. |
| Privacy and honest accuracy | Traffic comes from people’s phones. The interviewer wants aggregation, anonymity and an ETA you can measure, not a number made up from distance. |
Google Maps is four systems that share one map. Tiles draw the map: the world is cut into a pyramid of small vector tiles, pre-built in batch, stored in object storage and served almost entirely by a CDN. Search turns text into a place. Routing finds the fastest path on a road graph that is preprocessed so a query takes milliseconds. Traffic turns phone location pings into live speeds on every road segment, which routing uses for its costs and its ETA.
| Step | Minutes | What to get done |
|---|---|---|
| 1. Clarify | 4 | Which parts of Maps: display, search, driving routes, live ETA, rerouting. What is out: walking, transit, offline, street view. |
| 2. Estimate | 3 | Tile requests and egress, graph size in memory, route queries, and traffic pings. |
| 3. API and data | 5 | Tile, geocode, route and probe calls, and the road graph, tile and traffic data models. |
| 4. High-level design | 8 | A build pipeline, a tile path through the CDN, a routing service, a traffic pipeline. |
| 5. Deep dives | 16 | Tiles, then fast routing, then live traffic and ETA, then search, then navigation and rollout. |
| 6. Scale and failures | 6 | A CDN miss storm, a routing node down, missing traffic data, a map update mid-trip. |
| 7. Wrap up | 3 | Recap, the preprocessing trade-off, and what you would build next. |
| Ask | Why you ask it | Typical answer | How it changes the design |
|---|---|---|---|
| Which features are in scope: showing the map, searching a place, routes, live traffic, turn-by-turn? | Maps is a family of products. Without a boundary we will draw thirty boxes and go deep on none. | Display the map, search a place, driving routes with an ETA that uses live traffic, and turn-by-turn with rerouting. | Four subsystems: tiles, geocoding, routing and traffic. Navigation sits on top of routing. |
| Driving only, or also walking, cycling and public transport? | Each mode is its own graph with its own costs. Transit adds timetables, which is a different problem. | Driving. Mention that other modes reuse the same design with another graph and cost function. | One road graph, one cost function (travel time for a car). We name the extension. |
| How live must traffic be? | It sets whether we need a stream pipeline or a batch job, and how often costs change. | Speeds refreshed about every minute, and ETAs that reflect them. | A streaming pipeline with one-minute windows, and routing that accepts changing costs. |
| How many users, and how many are navigating at once? | Map browsing, search and navigation have very different loads. | 100 million daily users who open the map about 10 times a day. 40 million of them navigate, for about 25 minutes. | Tile traffic is huge and cacheable. Routing is modest. Probes come only from people who are navigating. |
| How big is the map, and how often does it change? | It decides storage, the build pipeline and how we roll out a new version. | Hundreds of millions of road junctions. The base map changes weekly. Closures and incidents change within minutes. | A batch rebuild for the base map and a separate fast path for incidents. |
| Do we need offline maps? | Offline means downloading regions and routing on the phone. | Out of scope. Mention it as an extension. | We skip on-device routing, and design the phone as a thin client of tile and route services. |
| How accurate must the ETA be? | A target we can measure turns “good enough” into a number. | Typically within 10% for trips under an hour. We track it. | We log predicted versus actual trip times and use them to tune. |
| Do we care about privacy of location data? | Traffic comes from individual phones. A design that stores everyone’s path is a liability. | Yes. Traffic must be anonymous and aggregated. | Probes are stripped of identity, trip ends are trimmed, and speeds are published only above a minimum count. |
| One region or global? What availability? | A global map is served from many regions, but a route crosses borders and data regions. | Global, 99.95% for tiles and routing, with regional data owners. | CDN everywhere, regional routing clusters, and a global graph partitioned across regions. |
| Assumption | Value |
|---|---|
| Daily users | 100 million, each opens the map about 10 times a day |
| Tiles per map view | about 15 (a screen plus a border), average 10 KB each (vector) |
| CDN hit ratio | 97% for tiles |
| Peak versus average | about 3 times |
| Road graph | 500 million nodes, 1 billion edges (illustrative) |
| Graph bytes | about 24 bytes per edge and 16 per node |
| Navigating users | 40 million a day, about 25 minutes each, 4 route queries a trip (start, reroutes) |
| Location ping | one every 5 seconds from a navigating phone, about 100 bytes |
| One route query on a preprocessed graph | about 5 ms of one CPU core (assumption) |
| Plain Dijkstra on a long trip | about 100 million nodes at about 20 million a second, so 5 s (assumption) |
| Place searches | 3 per user per day |
| What | Maths | Result |
|---|---|---|
| Tile requests per day | 100,000,000 × 10 views × 15 tiles | 15 billion per day |
| Tile requests per second | 15,000,000,000 ÷ 86,400, and × 3 at peak | about 174,000 per second, 520,000 at peak |
| Origin requests at a 97% hit ratio | 520,000 × 3%, and 174,000 × 3% | about 15,600 at peak, 5,200 on average |
| The same at a 90% hit ratio | 174,000 × 10% | about 17,400 on average (3.3 times more) |
| Tile egress | 15,000,000,000 × 10 KB | 150 TB per day, about 14 Gbps average, 42 Gbps at peak |
| Tiles in the pyramid (all of it, to zoom 18) | (4^19 − 1) ÷ 3 | about 91.6 billion, which is too many to store densely |
| What we actually store | zoom 0 to 14 in full: (4^15 − 1) ÷ 3 = 358 million; zoom 15 to 18 where there are roads, 3% of tiles = 2.7 billion | about 3.1 billion tiles × 10 KB = 31 TB per map version |
| Road graph in memory | 1,000,000,000 edges × 24 B + 500,000,000 nodes × 16 B | 24 GB + 8 GB = 32 GB (about 56 GB with shortcuts) |
| Route queries | 40,000,000 × 4 per day, then ÷ 86,400, × 3 at peak | 160 million a day, 1,850 per second, 5,560 at peak |
| CPU for routing at peak | 5,560 × 5 ms, and the plain way 5,560 × 5 s | about 28 cores busy (about 56 at half utilisation) against about 27,800 cores |
| Concurrent navigators | 40,000,000 × 25 min ÷ 1,440 min per day, × 3 at peak | about 694,000 on average, 2.1 million at peak |
| Location pings | 2,083,000 ÷ 5 s, and × 100 B | about 417,000 per second at peak, about 42 MB per second |
| Map matching CPU | 417,000 per second × about 200 microseconds | about 83 cores busy at peak (about 170 at half utilisation) |
| Place searches | 100,000,000 × 3 ÷ 86,400, × 3 at peak | about 3,500 per second, 10,400 at peak |
| Method | Path | Request | Response | Notes |
|---|---|---|---|---|
| GET | /tiles/{version}/{z}/{x}/{y}.pbf | none | 200 vector tile (compressed) | Versioned path, so it can be cached for a long time and a new map is a new path. Never personal. Served by the CDN, with the origin as a fallback. |
| GET | /v1/search?q=&near=&limit= | none | 200 { places: [{ id, name, address, lat, lon, score }] } | Text plus a location bias. Cached for common queries. Returns candidates, not a route. |
| GET | /v1/geocode/reverse?lat=&lon= | none | 200 { address, placeId } | A point to an address. Safe to cache by rounded coordinates. |
| POST | /v1/route | { origin, destination, mode: "drive", departAt?, avoid? } | 200 { routes: [{ distance, etaSeconds, polyline, steps, mapVersion }] } | The polyline is encoded to save bytes. mapVersion lets the client check that the drawn roads match the route. Returns up to 3 alternatives. |
| POST | /v1/probes | { batch: [{ t, lat, lon, speed, heading, accuracy }] } | 202 | Anonymous, batched on the phone and sent every few seconds. No account id, and a rotating random session id that changes every few minutes. |
| WS | /v1/navigate | { routeId, position } | events: reroute, incident, new ETA | Optional stream for turn-by-turn updates. A phone that is on its route sends nothing, and the server stays quiet. |
| Road graph (in memory, per region) | Fields | Why it is there |
|---|---|---|
| Node (junction) | id, lat, lon, level | A point where roads meet. level is its importance after preprocessing. |
| Edge (road segment, one direction) | from, to, length, class, speed limit, base time, profile id | The unit routing and traffic work on. Two-way roads are two edges. |
| Turn restriction | from edge, to edge, forbidden or cost | No left turn here, a U-turn costs 20 s. |
| Shortcut | from, to, cost, via node | Added by preprocessing. Standing for a whole stretch of road. |
| Other stores | Key | Value |
|---|---|---|
| Tiles (object storage) | version / z / x / y | A compressed vector tile. Immutable. A new map is a new version. |
| Live traffic (fast key-value) | edge id | speed now, sample count, updated at. About 8 bytes per edge. |
| Typical speeds (read-only table) | profile id × 168 hours of the week | A typical speed. About 11 MB for 65,536 profiles. |
| Place index | word + cell | Place ids with a text and distance score. |
cost(edge, t) = length / speed(edge, t) + turn_delay(edge)
speed(edge, t) = live if samples(edge) >= MIN_SAMPLES and fresh
typical otherwise: typical[edge.profile][hour_of_week(t)]
(blend towards typical as the live reading gets old)| Component | What it does |
|---|---|
| Build pipeline | Cleans and merges map data in batch, builds the versioned tile pyramid, and builds the road graph and its shortcuts. A new map is a new version, never an edit in place. |
| Tile store and CDN | Immutable tiles in object storage, served through a CDN with long cache lives. The CDN absorbs about 97% of requests. |
| Search service | Turns text into places with an inverted index and a spatial filter, and a point into an address (reverse geocoding). |
| Routing service | Holds a region of the road graph in memory and answers route queries with preprocessed shortcuts. Stateless, so we run many copies. |
| ETA service | Adds up edge times along a route, using live speeds where they exist and typical speeds where they do not. |
| Probe intake and stream | Accepts anonymous batches from phones and writes them to a durable log, so a slow consumer never loses data. |
| Map matching and speed aggregator | Snaps noisy GPS points to road edges, then computes a robust speed per edge per minute and writes it to the live speed store. |
| Reroute service | Watches live speeds and incidents on the routes of active navigators and tells a phone when a much better route exists. |
The problem: The map must look sharp at every zoom, load in a blink, and be served to 100 million people a day. The planet cannot be one image, and storing every zoom level densely is impossible.
| Option | How it works | Good | Bad |
|---|---|---|---|
| One big pre-rendered image per zoom | Render the world at each zoom and send the part in view. | Simple to think about. | Enormous files, no caching of parts, and it cannot be updated locally. |
| Raster tiles (small pictures) | Cut each zoom into 256 by 256 pixel PNG or JPEG tiles, addressed by z, x, y. | Easy for any client. Cacheable. | Larger (20 to 50 KB), fixed style, blurry when scaled, and a style change means rebuilding everything. |
| Vector tiles (the data, drawn on the phone) | Each tile holds roads, water and labels as shapes. The phone draws them in the chosen style. | Small (about 10 KB), sharp at any scale, rotation and styling for free, and smooth zoom between levels. | The phone does the drawing, so older devices need care. A font and style pipeline. |
| Render on demand for everything | Draw a tile when it is first asked for, then cache it. | Stores nothing that nobody looks at. | A cold miss is slow, and a launch day with no warm cache would overwhelm the renderers. |
Zoom level z has 4^z tiles. Zoom 0 is one tile for the world, zoom 10 is about a million, zoom 14 is 268 million and zoom 18 is 68.7 billion. The whole pyramid to zoom 18 is 91.6 billion tiles, so we do not store it all: the ocean and the desert are empty at deep zooms. The low zooms (0 to 14, 358 million tiles) are built in full, and zooms 15 to 18 only where there are roads and buildings, about 3% of tiles, so about 3.1 billion tiles in total, around 31 TB per version at 10 KB each.
A tile is addressed by version/z/x/y. The version is part of the path, so a tile can be cached for a very long time, and a new map is simply a new path. The CDN serves 97% of requests, and the rest go to the tile store. A phone loads about 15 tiles for a screen. It asks for the neighbours it will need next, so panning feels instant.
| Zoom | Tiles at this zoom | One tile is about | What you see |
|---|---|---|---|
| 0 | 1 | 40,000 km wide | The whole world |
| 10 | 1,048,576 | 39 km wide | A city and its region |
| 14 | 268,435,456 | 2.4 km wide | A neighbourhood |
| 18 | 68,719,476,736 | 153 m wide (at the equator) | A few streets |
| 21 | 4,398,046,511,104 | 19 m wide | A building (only where needed) |
n = 2^z x = floor( (lon + 180) / 360 * n ) y = floor( (1 - ln(tan(lat) + 1/cos(lat)) / pi) / 2 * n ) London (51.5074, -0.1278): z10 -> tile (511, 340) z14 -> tile (8186, 5448) parent of (z, x, y) = (z-1, x/2, y/2) children = (z+1, 2x..2x+1, 2y..2y+1)
The problem: A route is a shortest-path problem on a graph with 500 million nodes. Dijkstra’s algorithm explores a growing circle around the start, and for a long trip that circle swallows most of a continent. We need an answer in milliseconds, for 5,000 queries a second.
| Option | How it works | Good | Bad |
|---|---|---|---|
| Dijkstra | Grow a circle of nodes around the start in order of distance until the target is reached. | Simple and always correct. Reads live costs directly. | Looks at tens of millions of nodes for a long trip: about 5 seconds each, so about 28,000 cores at peak. |
| A* and bidirectional search | A* adds a guess of the distance left. Bidirectional search runs from both ends and meets in the middle. | Fewer nodes (often a few times fewer). Still no preprocessing, so live costs just work. | Still thousands of times too slow for a continent. The guess is weak on roads, where the fastest route is rarely straight. |
| Contraction hierarchies (preprocessing) | Rank the nodes by importance. Remove the least important first, adding a shortcut edge where its removal would lengthen a shortest path. A query searches only upward in importance from both ends. | A query looks at a few thousand nodes, so milliseconds. About 1,000 times fewer cores. | Preprocessing takes time and memory (about 24 GB more here). A change in costs makes the shortcuts stale. |
| Partition the graph into cells (customizable route planning) | Cut the map into nested regions, precompute only the structure (not the costs), and compute costs for border-to-border links quickly. A query searches the local cell in detail and the rest through the border links. | A cost change is a fast re-customisation (seconds), not a full rebuild. Live traffic fits. | A query is a little slower than the best hierarchy. More moving parts. |
The key idea is shortcuts. Most long trips use the highway network: the same few important roads. If we precompute that a stretch of important roads costs, say, 40 minutes from junction X to junction Y, a query can jump over it instead of exploring every side street. A contraction hierarchy does this systematically, and a query only ever climbs up the hierarchy from the start and from the end until the two climbs meet. Instead of looking at 100 million nodes, it looks at a few thousand. Our estimate: about 5 ms per query instead of about 5 s, so about 28 cores instead of about 28,000.
The cost is that shortcuts store costs. When an accident makes one highway segment 40 times slower, every shortcut that passes over it is now wrong. The fix is to separate structure (which shortcuts exist, built rarely, in hours) from costs (recomputed often, in seconds). Methods such as customizable route planning are built around that split. Try it in the playground: with stale shortcuts the search finds a route fast but it is not the best one.
| Method | Looks at (long trip) | Preprocessing | Handles live traffic? |
|---|---|---|---|
| Dijkstra | tens of millions of nodes | none | Yes, directly |
| A* / bidirectional | a few times fewer | none | Yes, directly |
| Contraction hierarchy | a few thousand | hours, plus 24 GB | Only after a rebuild |
| Partitioned cells, re-customised | a few thousand to tens of thousands | structure once, costs in seconds | Yes, after a fast re-customise |
The problem: A route is only as good as the speeds under it. Phones give us noisy points, not road speeds, and we must turn them into a number per road segment per minute, protect privacy, and still produce an ETA that is right.
| Option | How it works | Good | Bad |
|---|---|---|---|
| Static speed limits | Time = length ÷ speed limit. | No data pipeline. | Wrong in every city at rush hour. ETAs are far too optimistic. |
| Typical speeds by hour of week | A table per road: its normal speed for each of the 168 hours of the week. | Captures rush hour and weekends, and it is cheap and always available. | Blind to today’s accident or event. |
| Live speeds from phone probes | Snap pings to roads, take the median speed per segment per minute. | Reflects what is happening now. | Needs enough phones on a road. Noisy. Empty on quiet roads. |
| Blend: live when there is enough, typical otherwise, with prediction for the near future | Use live speed above a minimum sample count, fade back to typical as the reading ages, and project a few minutes ahead. | Good coverage, sharp where it matters, and honest when data is thin. | More logic, and a model to tune and measure. |
Every road segment gets a speed for the next minutes from three sources: the live median (if at least a minimum number of different phones contributed), the typical speed for that road at that hour of the week, and a short projection. As a live reading gets old, the answer slides back toward typical, so a road with no recent data is never treated as empty or as frozen.
The ETA is the sum of edge times along the route, plus a delay at junctions and traffic lights. For a long trip, speeds an hour away are predicted, not live, so the ETA service uses typical speeds for the far part and live speeds for the near part. We measure ETA error as predicted versus actual trip time and tune against it.
| Step | What happens | Why |
|---|---|---|
| Anonymise on the phone | A random session id that changes every few minutes. No account id. | A long trace identifies a person (it ends at their home). |
| Trim trip ends | Drop the first and last stretch of each trip. | Starts and ends are the most revealing. |
| Map matching | Choose the most likely sequence of road edges for the points (a hidden-Markov-model idea: near the point, plausible to drive between the points). | A GPS point is up to tens of metres off, and two roads can be 20 m apart. |
| Aggregate | Median speed per edge per minute, outliers dropped, count of different sessions. | A robust number that one slow car cannot move. |
| Publish if k is met | Only publish an edge if at least k different sessions contributed. | A speed from one phone is that phone’s location. |
| Blend with typical | Fade from live to typical as the reading ages. | Quiet roads must still have an answer. |
The problem: A user types “springfield” or “coffee near me” or a half address. We must turn text into a place, rank it well, and also turn a point on the map into an address.
| Option | How it works | Good | Bad |
|---|---|---|---|
| A database LIKE query | WHERE name LIKE '%text%'. | Trivial. | A full scan, no typo handling, no ranking by distance. |
| Text index only | An inverted index of words and normalised addresses, ranked by text match. | Fast and ranks by relevance. | “Springfield” returns every Springfield in the world, in random order. |
| Text index plus a spatial filter and popularity | Find matches by text, filter or boost by distance from the map centre and the user, and weight by how often people choose a place. | Sensible answers: the Springfield near you first. | More signals to tune. Needs a place popularity feed. |
| Reverse geocoding with a spatial index | Point-in-polygon on an R-tree or a cell index to find the street, district and city for a point. | Fast, exact for areas. | Needs good polygons. Boundaries change. |
Place search is an inverted index (see Inverted Index) where each posting also carries a cell id (see S2 and H3). A query is parsed and normalised (“St” and “Street”, accents, order of address parts). Candidates are found by text, then ranked by a blend of text match, distance from the map centre, and popularity. That is why “springfield” returns the one nearest to the user’s map view first.
Reverse geocoding works the other way: find the cell of the point, then check which stored polygons (district, city, postcode) and which nearest road contain it. An R-tree makes the polygon check fast (see R-Trees). Autocomplete uses the same ideas with a prefix structure (see Design Search Autocomplete).
The problem: A million people are driving at once. Each needs to be told when to turn, and some need a new route, without the server doing work for every GPS point. And a map update must not make the drawn road disagree with the route.
| Option | How it works | Good | Bad |
|---|---|---|---|
| Server follows every driver | The phone streams position and the server decides the next instruction. | Simple client, always up to date. | About 417,000 messages a second at peak that need a stateful answer, and it breaks in a tunnel. |
| Phone follows the route locally | The server sends the route and its steps. The phone matches its position to the route and speaks the next turn. | Works offline for a while, no per-GPS server cost. | The phone must be told when something changes. |
| Phone follows locally, server pushes changes | The server keeps a light record of each active route and sends an event when an incident or a traffic change makes a much better route. | Quiet when nothing changes, and it still reacts to traffic. | Needs a way to find active routes affected by a change. |
| Poll for a new route every minute | The phone asks again at a fixed interval. | Simple. | Wasteful, and still late when something happens. |
The route is a list of road edges and steps, so the phone can tell where it is on it without help. It asks for a new route only if it is off the route for more than a few seconds. On the server, an index from edge to active routes lets us find the few routes that include an edge whose speed just changed. We recompute only those, and push a new route only if it saves more than a threshold (for example 2 minutes or 10%), so people are not nagged.
For a new map version, a route carries the mapVersion it was computed on. Tiles are fetched for the same version, so the line is always drawn on the roads it was built from. We roll out by region, keep the old version live until active routes finish, and only then retire it.
| Search | Nodes looked at | Route time today | Best? |
|---|---|---|---|
| Dijkstra | 96 | 12.0 min | yes |
| A* (aim at the target) | 53 | 12.0 min | yes |
| Search from both ends | 45 | 12.0 min | yes |
| With shortcuts | 24 | 12.0 min | yes |
A simplified model with fixed numbers and no random values: 96 junctions, a local street takes 60 s, a highway hop 20 s, a slow street 150 s, and an accident makes one segment 40 times slower. The shortcuts are a real (small) contraction hierarchy: nodes are removed one by one and replaced by links that keep the distances. A real map has hundreds of millions of nodes, where looking at a few thousand instead of a hundred million is what makes a route take milliseconds.
| Bottleneck | Fix |
|---|---|
| CDN miss storm after a new map version (every tile is a miss) | Pre-warm the most visited tiles in each region before switching, roll out by region, and use an origin shield so many edge misses become one origin request. |
| Origin tile store under a cold cache | Cache in front of object storage, request coalescing, and a long cache life on versioned paths. |
| Routing CPU at the morning peak (5,560 queries a second) | Preprocessed hierarchy, many stateless copies of each region, and a short cache of very popular origin and destination pairs. |
| A very long route crosses several regions | A coordinator breaks it at the border nodes, queries each region, and joins the results using precomputed border-to-border costs. |
| Probe stream spikes (417,000 a second at peak) | Partition the log by map cell, scale map matching with the partitions, and drop the lowest-value points under overload. |
| Hot places in search (a stadium after a match) | Cache popular queries for a few seconds and spread the shards by cell so one event is not one shard. |
| Reroute thundering herd when a main road closes | Rate-limit reroutes per edge and add jitter to pushes, so a million phones do not all recompute in the same second. |
| Failure | How the design copes |
|---|---|
| A routing node dies | Stateless and replicated per region. The load balancer retries on another copy, and a new one loads the graph file from storage. |
| The live traffic feed stops | Fall back to typical speeds by hour of week. ETAs get a little less accurate but never fail. Alert on feed freshness. |
| Map matching is behind | The stream is durable, so it catches up. Late speeds are published when ready, and routing keeps using the last good value until then. |
| The CDN has an outage in one region | Fail over to another CDN or to the origin with a rate limit, and serve lower zoom tiles first. |
| A bad map build (a missing bridge) | Validate every build against the previous one (a large change in road count or a broken connectivity check blocks release). Keep the previous version live and roll back by version. |
| Region-wide outage of routing | Route queries go to a neighbouring region, which loads the missing region’s graph. Slower, but it answers. |
Maps is four services over one map. Vector tiles in a versioned pyramid, served by a CDN, draw it. A search index with spatial cells finds places. Routing runs on an in-memory road graph preprocessed with shortcuts, so a query takes milliseconds, and costs are re-customised when traffic changes. Phone probes are anonymised, snapped to roads and aggregated into live speeds, which feed routing and the ETA.
| Decision | What we gain | What it costs |
|---|---|---|
| Vector tiles instead of raster | Small, sharp at any scale, easy to restyle | The phone draws them, and there is a style and font pipeline |
| Dense low zooms, sparse high zooms | 31 TB per version instead of trillions of tiles | Some on-demand work for a place with no pre-built deep tile |
| Preprocessed shortcuts | About 1,000 times less CPU per route | Hours of preprocessing, 24 GB more memory, and stale costs after a change |
| Separate structure from costs | Live traffic without a full rebuild | A more complex routing stack |
| k-anonymity for published speeds | Privacy for individual drivers | No live data on quiet roads, so we fall back to typical speeds |
| Phone follows the route locally | No server work per GPS point and tolerance to dead zones | The server must push changes, and the phone needs more logic |
Show that you can size the traffic and that you know why tiles are small, versioned and cached.
The core of the question. Be able to say why Dijkstra fails and what you do instead, in plain words.
Show you can turn noisy phone data into a trustworthy number, and protect people while doing it.
Place search, rolling out changes safely, and what you would not build in 45 minutes.
A change in requirements is a test of whether you understand why your design looks the way it does.
| New requirement | What changes in the design |
|---|---|
| Add walking and cycling routes | Separate graph profiles with their own cost functions (sidewalks, steps, bike paths) and their own preprocessing. Speeds are almost constant, so live traffic matters little. |
| Add public transport | A time-dependent graph with timetables: edges that exist only at certain times, transfers with waiting. A different algorithm family, with the schedule data as a new input feed. |
| Offline navigation | Download tiles, a compact graph and a place index per region. Route on the phone with typical speeds. Needs versioning and a download manager. |
| Predict traffic one hour ahead | Use history by hour of week, events and weather to forecast edge speeds, and use predicted speeds for the later parts of a long route. |
| Truck and delivery routing with many stops | A vehicle profile with size and weight limits, and a multi-stop optimisation (a travelling-salesman style problem) on top of fast point-to-point queries. |
| Add business search and reviews | A separate place store with a large text corpus, ranking signals and a moderation pipeline. It reuses the spatial index. |
| Crowd-sourced incident reports | A verification step (several independent reports, or a speed drop to confirm), a short life for each report, and abuse protection against fake closures. |
| Area | Weak | Good | Great |
|---|---|---|---|
| Scoping | Treats Maps as one thing. Starts drawing boxes. | Names tiles, search, routing and traffic, and picks the focus. | Also settles vehicles, offline, freshness and privacy, and states what is out. |
| Estimation | No numbers, or only a user count. | Tile requests per second, graph size, route queries. | Derives the pyramid size, the dense-versus-sparse storage, the CDN hit-ratio effect on the origin, and the Dijkstra versus preprocessed core counts. |
| Tiles | One big image, or storing every zoom densely. | Tile pyramid with z/x/y, and a CDN. | Vector tiles, versioned paths, sparse high zooms, overzoom and safe updates. |
| Routing depth | “Use Dijkstra” or “use A*”. | Knows that Dijkstra is too slow and that preprocessing helps. | Explains contraction or partition methods in plain words, the stale-cost problem, and the structure-versus-cost split. |
| Traffic and ETA | Speed limits, or “ask the phones”. | Probes, aggregation per segment, a typical-speed fallback. | Map matching, minimum sample counts, privacy by design, blending and measuring ETA error. |
| Trade-offs and operability | Does not mention failure or cost. | Handles CDN and routing failures. | Map-version consistency, reroute herds, build validation, canary regions and a phased plan. |
| Mistake | Do this instead |
|---|---|
| Serving the map as one large image per zoom | Use a pyramid of small tiles addressed by z, x, y, and vector tiles drawn on the phone. |
| Saying “Dijkstra” and stopping | Give the numbers (seconds per query, thousands of cores), then preprocess the graph so queries take milliseconds. |
| Precomputing shortcuts and forgetting live traffic | Separate structure from costs, and recompute costs quickly when speeds change. |
| Using the speed limit for the ETA | Blend live speeds, typical speeds by hour of week and a projection, and measure ETA error. |
| Streaming every GPS point to the server for navigation | Let the phone follow the route locally and push only changes that matter. |
| Storing identifiable location traces | Anonymise on the device, trim trip ends, and publish only aggregates above a minimum count. |
| Editing tiles in place on a map update | Publish a new version path, keep the old one for active trips, and check route and tile versions match. |
Uses this routing and ETA service to rank drivers and price trips.
Cells that index places and group probes by area.
A simple text code for a cell, the idea behind spatial keys.
Fast point-in-polygon for reverse geocoding.
Serves 97% of tile requests.
The structure inside Dijkstra’s algorithm.
Windowing and late data for the speed aggregator.
The type-ahead layer on top of place search.