Design Google Maps
Understanding the Problem
🗺️ What is Google Maps? Google Maps shows an interactive map of the world that you can pan and zoom from the whole planet down to a single street, and it gives you directions: by car with a live-traffic ETA, by public transit with real departure times, by bike or on foot. Waze, its sister app, leans on its drivers to report accidents, police and hazards, which show up for everyone nearby and feed into the routes. Under the hood it's three very different systems: a giant static content delivery problem (the map), a graph search problem (routing), and a real-time stream processing problem (traffic).
Interviewers may phrase this as "design Google Maps," "design Waze," or "design a navigation system." They're the same system with different emphasis. Waze questions push harder on crowdsourced reports and live traffic; Maps questions push on tiles and transit. We'll cover all of them.
Functional Requirements
Core Requirements
- Users should be able to view the map at any location and zoom level, panning and zooming smoothly.
- Users should be able to get driving directions between two points, with an ETA that reflects live traffic, and follow turn-by-turn navigation with rerouting.
- Users should be able to get public transit directions using schedules and real-time vehicle data.
- Users should be able to report incidents (accidents, hazards, closures) and see other users' reports along their route.
Below the line (out of scope)
- Place search, business listings and reviews (see proximity service).
- Street View and satellite imagery capture.
- How the base map data is collected and edited (survey cars, imagery, map editors).
- Offline maps beyond a mention.
Non-Functional Requirements
Ask about scale. We'll assume 1B monthly users, about 200M daily, and at peak about 10M users actively navigating at once.
Core Requirements
- Map tiles should load in under 100-200ms worldwide so panning feels instant. Tile traffic is huge and must come from caches near the user.
- Route requests should return in under 1 second at p99, including for long cross-country routes.
- Live traffic should be reflected in routes and ETAs within about 1-2 minutes of conditions changing.
- Incident reports should appear for nearby drivers within a few seconds to a minute.
- The system should be highly available. Navigation in progress must keep working even if parts of the backend are degraded.
Below the line (out of scope)
- Strong consistency anywhere. Every part of this system tolerates slightly stale data.
- Exact turn-lane-level guidance details.
Some quick math to see which parts are big:
- Tiles: at zoom level
z, the world is a grid of2^z × 2^ztiles. Zoom 14 is about 268M tiles; zoom 18 is about 69 billion. Most are ocean or empty land, and most requests hit a small fraction (cities). If 200M daily users each load ~300 tiles while panning, that's 60B tile requests a day, about 700k per second on average and a few million at peak. That's a CDN workload. - Routes: 200M users asking for ~3 routes a day is 600M requests, about 7k per second on average, perhaps 20-30k at peak, plus reroutes.
- Location probes: 10M navigating users sending a GPS point every 5 seconds is 2M points per second into the traffic pipeline. Each point is small (~50 bytes), so about 100MB/s.
Three workloads, three architectures: tiles are a read-only content delivery problem, routing is CPU-bound graph search over an in-memory graph, and traffic is a high-volume stream aggregation. Naming that split up front gives the interview a clear structure.