System design interview: design Google Maps

Designing a service like Google Maps means three systems that share a road graph: map tiles served from a CDN so the map draws quickly, a routing service that finds the best path and an ETA over a graph too large for plain Dijkstra, and a location pipeline that turns phones in moving cars into live traffic. In the interview, scope to tiles, routing and navigation, and show how live traffic feeds back into ETAs.

By Published 7 min read

1. Clarify the requirements

"Design Google Maps" is too large for 45 minutes. Offer a scope and let the interviewer adjust it.

  • Functional: show a pannable, zoomable map; get directions between two points for driving (walking and transit if time allows) with an ETA and alternatives; turn-by-turn navigation that reroutes on a missed turn or a jam.
  • Non-functional: the map appears in about a second on a phone network; a route comes back within a second or two; ETAs are accurate enough that people trust them; navigation keeps working through brief signal loss.
  • Out of scope unless asked: place search and reviews (covered in design a proximity service), Street View, building the map data itself from imagery, offline map downloads.

2. Estimate the scale

Rough numbers for a global maps product (assumed figures)
QuantityAssumptionResult
Map views300 million map opens a day, about 30 tiles eachabout 104,000 tile requests a second on average, far more at peak; almost all served by the CDN
Tiles at one deep zoom levelzoom 18 has 4^18 tiles, about 69 billion; assume 10% contain anything but water or empty landabout 7 billion tiles at that level alone
Tile storage at that levelabout 20 KB per non-empty tileabout 140 TB; vector tiles and one shared blank tile cut this sharply
Navigation sessions50 million a day, 25 minutes eachabout 870,000 concurrent on average, about 2.6 million at a 3x peak
Location updatesone every 5 seconds while navigatingabout 520,000 a second at peak
Route requestsassume 100 million a day, plus reroutesabout 1,200 a second on average plus reroutes, each a graph search
Rough numbers for a global maps product (assumed figures). Scroll sideways on a small screen.

Each subsystem has a different bottleneck: tiles are a bandwidth and caching problem, routing is a compute problem on a large graph, and traffic is a high-volume stream problem.

3. Define the API

GET  /tiles/{style}/{z}/{x}/{y}.pbf          -> vector tile (cacheable for days)

POST /v1/routes
     { origin: {lat, lng}, destination: {lat, lng}, mode: "drive", depart_at }
  -> { routes: [ { polyline, distance_m, eta_s, steps: [...] } ], route_id }

POST /v1/navigation/{session_id}/location   { lat, lng, speed, heading, ts }
  -> { on_route: true, eta_s, reroute: null | { polyline, steps } }
Tiles are static files; routing and navigation are services.

Tile URLs carry zoom, column and row. The phone computes which ones it needs from the viewport, so the server never decides what to send.

import math

def tile_for(lat, lng, zoom):
    n = 2 ** zoom                                  # tiles per side at this zoom
    x = int((lng + 180.0) / 360.0 * n)
    lat_r = math.radians(lat)
    y = int((1 - math.asinh(math.tan(lat_r)) / math.pi) / 2 * n)
    return zoom, min(x, n - 1), min(y, n - 1)

tile_for(10, 10, 1)              # (1, 1, 0): north-east quarter at zoom 1
tile_for(51.5007, -0.1246, 15)   # (15, 16372, 10897)
Which tile covers a point at a given zoom (Web Mercator; run with python3).

4. Sketch the data model

The main data sets
DataShapeWhere it lives
Map tilesBlob per (style, z, x, y)Object storage behind a CDN
Road graphNodes (intersections) and directed edges (segments) with length, speed limit, turn restrictionsPartitioned into routing tiles, loaded into routing servers' memory
Live segment speedssegment_id -> current speed, sample count, updated_atIn-memory store, refreshed every minute or so
Historical speedssegment_id, hour of week -> typical speedBatch-built table, loaded with the graph
Navigation sessionssession_id -> route, current position, last ETAShort-lived key-value store with a TTL
The main data sets. Scroll sideways on a small screen.

5. Routing on a graph this large

Plain Dijkstra explores outward in every direction until it reaches the destination. Across a continent that means millions of nodes per request, which is too slow at thousands of requests a second. The standard answers combine two ideas.

Ways to speed up shortest-path search
TechniqueIdeaCost
A*Steer the search toward the destination with a lower-bound estimate (straight-line distance at top speed)Easy; helps, but still explores a lot on long trips
Hierarchical routing tilesSplit the graph into tiles at levels: local streets, arterials, highways; search detail only near the endsNeeds a build pipeline; slightly less than optimal on rare trips
Contraction hierarchiesPrecompute shortcut edges that skip unimportant nodes, then search upward from both endsVery fast queries; shortcuts must be rebuilt or patched when weights change
Bidirectional searchSearch from both ends and stop when they meetRoughly halves the explored area; combines with the others
Ways to speed up shortest-path search. Scroll sideways on a small screen.

A clear interview answer: partition the graph into routing tiles at three levels, run bidirectional A* that uses local tiles near the origin and destination and only the highway level in the middle, and use live segment speeds as edge weights. Routing servers keep hot tiles in memory and load the rest on demand from storage, so no single machine needs the whole planet.

ETA. For each edge on the chosen path, predict travel time at the moment the car will reach it: blend the live speed (strong for the next few minutes) with the historical speed for that hour of the week (better for segments an hour away), and add time for turns and lights. Many teams then correct the total with a learned model trained on completed trips; mention it, but do not design the model.

6. The architecture

  1. Clients
    • Phone app
    • Web map
  2. Static
    • CDN
    • Tile storage
    • Offline tile renderer
  3. Routing
    • API gateway
    • Routing service (graph tiles in memory)
    • Historical speeds
  4. Live traffic
    • Location ingestion
    • Stream
    • Traffic aggregation (map matching)
    • Live speed store
  5. Navigation
    • Navigation session service
    • Push channel to phone
Tiles, routing and the traffic loop. Phones fetch map tiles from a CDN backed by object storage, filled by an offline tile rendering pipeline from map data. Route requests go through an API gateway to a routing service whose servers hold routing tiles and read live segment speeds. During navigation, phones send positions to a location ingestion service, which writes them to a stream. A traffic aggregation job snaps positions to road segments, computes current speeds per segment and updates the live speed store; a navigation service compares each session's position and the latest speeds with its route and pushes reroutes or new ETAs.

7. Deep dives

  • Vector or raster tiles. Raster tiles are images: simple, but one copy per style and per screen density, and labels cannot rotate with the map. Vector tiles send geometry and let the phone draw it, so one tile serves every style and rotation, at the cost of rendering work on the device.
  • Map matching. GPS points drift into the next street. Snap each trace to the most likely sequence of connected segments (a hidden Markov model is the textbook method) before computing speeds, or a highway looks jammed because some points landed on the service road.
  • Privacy. Strip identities before aggregation, keep raw traces only briefly, and publish a segment's speed only when enough distinct phones contributed.
  • Rerouting. The navigation service checks each position against the route. Off route by more than a threshold for a few updates: compute a new route from the current position. On route but a segment ahead slowed sharply: compute alternatives and offer one only if it saves meaningful time, so drivers are not bounced between roads.
  • Updating the graph. New roads and closures arrive as edits. Rebuild affected routing tiles in a pipeline, version them, and roll new versions to routing servers gradually; a route must never mix two versions of one tile.

8. What breaks, and what you do about it

Failure modes
FailureEffectMitigation
Phone loses signal mid-routeNo reroutes, no new ETASend the full route and steps up front; the app keeps guiding from GPS alone and resyncs on reconnect
Traffic pipeline stallsLive speeds go staleFall back to historical speeds once data is older than a few minutes, and mark ETAs as less certain
Bad routing tile versionRoutes through closed or missing roadsValidate with test routes before rollout; keep the previous version to roll back
Event traffic (a stadium emptying)Sudden local slowdowns that history does not predictWeight live data more when it strongly disagrees with history
CDN miss storm after a style changeOrigin overloadPre-warm popular zoom levels and cities; roll styles out gradually
Failure modes. Scroll sideways on a small screen.

9. Trade-offs to discuss

  • Precomputation or flexibility. Contraction hierarchies answer fastest but are costly to update as traffic changes; tile hierarchies with live weights adapt better. Many systems precompute structure and apply traffic as a separate layer.
  • Freshness or stability. Rerouting on every speed change gives the theoretical best ETA and an annoying drive. A minimum saving before suggesting a switch is a product choice worth stating.
  • Server or device work. Vector tiles and on-device routing for short trips cut server load and survive bad signal, at the cost of app size and battery.

10. How to talk through it in the interview

Fictional example

The "why not Dijkstra" probe
Interviewer
Why can't you just run Dijkstra on the road network?
Candidate
It is correct, but on a cross-country trip it explores a huge circle of nodes, and I need thousands of these a second. I would split the graph into tiles at three levels, search local tiles near both ends and only the highway level in the middle, and run it bidirectionally with A*. That keeps each search to a small slice of the graph.
Interviewer
Where do the edge weights come from?
Candidate
Live speeds from navigating phones, matched to segments and aggregated per minute, blended with the typical speed for that hour of the week. Near the car I trust live data; an hour down the route I lean on history.
  • Split the prompt into tiles, routing and traffic in the first minute.
  • Know one speed-up beyond A* and what it costs to maintain.
  • Close the loop: phones produce traffic data that changes the routes they receive.

Practicing this design with Natively

A maps prompt has more parts than most, so the risk is spending twenty minutes on tiles. Rehearse with someone playing the interviewer while Natively transcribes the call; afterwards the transcript shows where the time went. In the moment you can ask it to brainstorm approaches to routing or to draw the traffic loop as a diagram, and a screenshot of your own sketch can be read and critiqued.

Questions people ask

How do you design Google Maps in a system design interview?

Scope it to three parts: map tiles served from a CDN, a routing service that finds paths and ETAs on a partitioned road graph, and a location pipeline that turns navigating phones into live traffic. Spend most of the time on routing and on how traffic data feeds back into ETAs.

Why not use Dijkstra's algorithm for map routing?

Dijkstra is correct but explores outward in every direction, which is far too much work on a continental road graph at thousands of requests a second. Interview answers add A*, bidirectional search and a hierarchy, such as routing tiles by road class or contraction hierarchies, so each search touches a small part of the graph.

How is ETA calculated in a maps system?

Sum the predicted travel time of each road segment on the route at the time the car will reach it. Near segments use live speeds from phones, distant ones lean on historical speeds for that hour of the week, and turn and signal delays are added. A learned correction on completed trips is a common refinement.

What are map tiles?

The map is cut into square tiles for each zoom level, where zoom z has 4 to the power z tiles. Phones request the tiles that cover the screen by zoom, column and row, and a CDN serves them as static files. Vector tiles send geometry and let the device draw it.

Where to go next

Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.

Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.

Keep reading

Put it on your own machine.

A live-conversation assistant that runs locally. Your conversations stay on your machine.

macOS 12+ · Windows 10/11

© 2026 Natively AI Private Limited

Source-available under the Natively Personal Use Source License v1.0 · IP geolocation by DB-IP