May we use cookies so Meta, Google, LinkedIn and ChatGPT see your visit and we learn which ads work? PrivacyMay we use cookies to see which pages help, and let Meta, Google, LinkedIn and ChatGPT see your visit, so we know which of our ads work? That way we spend less on ads that do not work. We do not sell your data, and the site works the same if you decline. You can change your answer at any time under Cookie settings at the foot of the page. Privacy policy
Loading...
System Design and AI Engineering, by Roni Das. 989 interactive lessons in two courses.: 770 in System Design and 219 in AI Engineering.
Start LearningSystem design interview guide
in this guide
7 parts open to everyone · 3 with a free account · 3 with the course
You can read 7 of 13 parts. A free account opens the deep dive; the course opens all of it.
It forces a candidate off the standard CRUD-and-cache template and into spatial data structures, graph algorithms, and precomputation tradeoffs that most web systems never touch. A strong answer shows you know that indexing a sphere is not the same as indexing a number line, that shortest-path at continent scale is a preprocessing problem and not just an algorithm choice, and that ETA is a streaming and ML problem rather than a simple lookup. It also has clean layers, so an interviewer can start easy with nearby search and push all the way into contraction hierarchies and traffic pipelines depending on your level.
This page is the free part.
₹1,111 in India$35 everywhere elseonce, for the whole course
The System Design course covers the Google Maps design across a run of lessons, not one page. These 4 alone are about 107 minutes of step-by-step reading, every one with a quiz.
Always clarify these in the first 5 minutes of the interview. Do not start drawing boxes until both lists are agreed.
This guide is built on these 5 lessons. Each one teaches one piece of the Google Maps design above, step by step.
Lifetime access for ₹1,111 in India or $35 elsewhere. Interactive diagrams, quizzes, and 20 capstone projects to practise on.
This one question is not enough for the interview.
Each question has why it is asked, a full answer, what the interviewer listens for, the follow-ups, the common mistakes and a diagram (268 diagrams in all). A PDF you keep, junior to staff level.
Two courses by the author of this page:
770 lessons · 18 free to read
₹1,111 in India · $35 elsewhere, once
Get System DesignYou own this course
219 lessons · 10 free to read
₹1,333 in India · $35 elsewhere, once
Get Generative AI and Agentic AIYou own this course
Save your progress and get the interview checklist PDF
Google Maps covers more than 200 countries and territories and, by Google's public statements, over a billion monthly active users. It renders the whole planet as a pyramid of map tiles, answers routing queries across a continent-sized road graph in a fraction of a millisecond, and folds live GPS signals from a very large fleet of phones into traffic and ETA predictions. The device counts and query rates here are estimates unless a number is explicitly published.
The problem breaks into four hard subsystems that barely share code. First, geospatial indexing: you have to store points of interest and road geometry for the entire globe and answer 'what is near this lat/long' in milliseconds, which pushes you toward a space-filling-curve index like Google's S2 rather than a naive lat/long B-tree. Second, map rendering: the visible map is a tile pyramid keyed by zoom, x, and y, served mostly from CDN, and modern clients pull vector tiles so the same bytes restyle and rotate on the GPU. Third, routing: plain Dijkstra or A* explores far too many nodes to route across a country, so production systems precompute shortcuts (contraction hierarchies and related techniques) to prune the search to a few hundred nodes. Fourth, ETA and live traffic: phones send anonymized GPS probes, a pipeline aggregates them into per-segment speeds, and a machine-learning model, in Google's case a Graph Neural Network over road Supersegments, predicts travel time and feeds those edge weights back into routing. Around all four sit place search, autocomplete, and reverse geocoding. The interview is really about picking the right spatial data structure and the right precomputation strategy for each piece.
Where it shows up
Asked at Google, Uber, Lyft, DoorDash, Amazon, and most companies that run maps, dispatch, or location features. Variants show up as 'design nearby search', 'design a routing engine', or 'design Yelp'.
Spec sheetGoogle Maps
worked through below, with the maths
The hard parts of this design are taught step by step in the System Design course: Database Indexing, Content Delivery Network (CDN) and Edge Caching.
The planner stopped using an index somewhere between 19.7 and 39.8 percent of the table. A query on the second column of a composite index took 37.269 ms against 0.054, and five indexes took the same inserts from 160 ms to 751.
A CDN is thousands of caches you do not operate, and the cache key decides everything about whether it helps you.
The same 200 URLs became 200, 501, 7,628 or 18,404 cache entries under four values of one response header, and the origin went from 200 requests to 18,706.
Process data as it arrives, real-time analytics, fraud detection, and event-driven architectures.
all part of
System Design Masterclass
770 lessons · about 290 hours · 18 free to read
₹1,111in India, by UPI
$35everywhere else, by card or PayPal
You own this course
Continue with Database Indexingpay once,
yours for life
Live from the course bench
Real interview questions, live diagrams and measured lab results, pulled at random from the lessons. A new set every time you come back.
Show your math. Pulling numbers from thin air signals you have not thought about the load.
Monthly active users
1B+ (published, order of magnitude)
Google has repeatedly described Maps as a product with over a billion users. Exact live counts are not published, so treat this as an order-of-magnitude anchor.
Tile requests per second
~1-2M tiles/sec at peak (Derived, estimate)
Assume 50M concurrent map sessions at peak and each session fetching roughly 10 tiles per active minute. 50M * 10 / 60 is around 8M/sec of demand, and CDN caching absorbs most of it, so origin sees a small fraction. Purely illustrative arithmetic, not a Google figure.
Road graph size
Hundreds of millions of nodes and edges (estimate)
The global drivable network is commonly cited in the hundreds of millions of road segments. This dwarfs main memory on one machine, which is exactly why routing is partitioned and precomputed.
GPS probes ingested
Tens of billions/day (Derived, estimate)
If 100M devices navigate daily and each emits a probe roughly every 5 seconds for an hour, that is 100M * 720 = 72B points/day. The input assumptions are estimates; the point is the pipeline is a firehose measured in tens of billions.
S2 cell id space
~6 x 10^18 leaf cells (published)
S2 subdivides the six cube faces down to level 30, giving about 6 x 10^18 leaf cells roughly 1 cm across, each addressable by a 64-bit id. This is a property of the S2 library, not a load estimate.
Route query latency budget
Sub-millisecond core search (published for CH)
Contraction-hierarchy research reports shortest-path queries that visit only a few hundred nodes and finish in a fraction of a millisecond after preprocessing. End-to-end user latency is larger because of network, ETA, and rendering.
A client request splits by concern. Map viewing hits a tile service: the client computes which tile coordinates (zoom, x, y) cover the viewport, requests them, and a CDN serves cached tiles, falling back to a tile origin that reads pre-generated or on-the-fly-rendered vector tiles from blob storage. Place search and autocomplete go to a search service backed by an inverted index plus a geospatial index, where the geospatial index uses S2 cell ids so a 'nearby' query becomes a range scan over a handful of cell-id ranges. Reverse geocoding maps a point to its enclosing S2 cells and looks up the features that cover them. Routing goes to a route service that holds the road network as a partitioned, preprocessed graph: it runs a bidirectional search accelerated by contraction-hierarchy shortcuts, weights edges with current and predicted travel times, and returns a polyline plus an ETA. Traffic and ETA run as their own pipeline off to the side: navigating devices stream anonymized GPS probes into an ingestion layer, a stream processor map-matches them to road segments and aggregates per-segment speeds, and a machine-learning model turns those into predicted travel times that are published back to the routing edge weights on a short cycle. Everything reads far more than it writes, so caching sits at every layer, from CDN tiles to cached popular routes to in-memory current-traffic tables.
In a real interview, sketch this on the whiteboard before diving into any single box.
Walk through each service. The interviewer wants to hear what each one owns, not just the names.
Serves the map as a pyramid of tiles addressed by zoom, x, and y. Vector tiles carry geometry and attributes that the client styles and rotates on the GPU, so one tile set supports day mode, night mode, and 3D. The CDN absorbs the overwhelming majority of reads because base-map tiles change slowly and are shared across all users.
Indexes points of interest and features by S2 cell id so that spatial proximity becomes numeric proximity on a 1D curve. A nearby query computes an S2 cell covering for the search area and scans a small set of contiguous cell-id ranges, then filters by exact distance. This is what makes 'restaurants within 2 km' cheap.
An inverted index over place names, addresses, and categories, combined with the geospatial index and a ranking model that blends text relevance, distance, and popularity. Autocomplete serves prefix matches with very low latency, usually from an in-memory trie or FST fronted by heavy caching of common prefixes.
Holds the road network as a directed, weighted, partitioned graph and answers shortest-path queries. It relies on precomputed shortcuts (contraction hierarchies and related overlay techniques) so a query prunes to a few hundred nodes instead of exploring an entire continent. Edge weights are refreshed from the traffic pipeline.
Accepts a firehose of anonymized GPS points from navigating devices, then map-matches each noisy point to the most likely road segment and direction. Map matching is nontrivial because GPS drifts near overpasses, tunnels, and parallel roads, so it usually uses a hidden Markov model over candidate segments.
A stream and batch pipeline that turns map-matched probes into per-segment speed distributions, then predicts travel time. Google's published approach groups adjacent segments into Supersegments and trains a Graph Neural Network to predict times across them, blending live probe data with historical patterns.
An offline pipeline that fuses satellite imagery, Street View, authoritative datasets, and user contributions into the canonical map, then compiles it into tiles and routing graphs. This is a heavy batch process that publishes new artifacts on a slow cadence measured in days to weeks per region.
places. The s2_cell_id is the workhorse index: store the leaf cell id and often a few parent-cell ids so nearby queries reduce to cell-id range scans. Text fields feed the…
Every table for Google Maps, its keys, and which store fits it and why.
Geospatial indexing with S2 versus geohash and quadtrees. The core trick for nearby search is to map two-dimensional positions onto a one-dimensional space-filling curve so that a normal ordered index can answer spatial range…
7 deep dives on the parts that break at scale: Geospatial indexing with S2 versus geohash and quadtrees; The tile pyramid, vector versus raster, and CDN delivery; Why Dijkstra and A* do not scale, and contraction hierarchies.
Vector tiles versus pre-rendered raster tiles. Vector tiles restyle, rotate, and stay sharp on any display and cut bytes for label-heavy maps, but push rendering work to the client and complicate the pipeline. Raster…
6 decisions an interviewer expects you to defend, each with the alternative and why it loses here.
A crash closes a highway. How quickly does routing react, and what has to change?
3 follow-up questions with model answers, the interview scorecard for this question, and a mock interview on Design Google Maps with the AI tutor.
Google open-sourced the S2 Geometry library, which projects the sphere onto a cube and orders cells along a Hilbert curve, and it is used across Maps, Earth, and BigQuery GIS. The routing techniques in this space trace directly to published academic work, most notably contraction hierarchies from Geisberger, Sanders, Schultes, and Delling, along with later customizable and time-dependent variants that make live traffic practical. On ETA, Google and DeepMind published their Graph Neural Network approach over Supersegments, reporting accuracy gains up to 50 percent in several major cities and describing the training tricks needed to stabilize learning across variable graph structures. The map itself is compiled offline from satellite imagery, Street View, authoritative data, and user edits, then published as tiles and routing graphs. Where a specific internal detail is not public, treat the description here as the standard system-design approach rather than a claim about Google's exact implementation.
Sources
If any of these topics are fuzzy, the interviewer will catch it. Each lesson is 15 to 60 minutes with diagrams, code, and a quiz.
interview readiness
Three questions from this guide. Answer them without scrolling up, the way you would have to in the room.
Pay by UPI, cards or netbanking through Razorpay. Pay by card or PayPal, in US dollars. Download at once from My packs.
NEWSystem Design Hands-On
Postgres Sharding: Complete Hands-On (PgBouncer + Citus). 2 h 36 min and 20 chapters: one PostgreSQL loaded until it breaks, then four shards behind a router you write, PgBouncer and Citus, with the 139-page slide deck. The first 15 minutes are free to watch.
Free PDF · 79 pages
25 real tech interview questions, answered in full
Five from each of our AI, GenAI, Inference, Maths for ML and Forward Deployed packs. Each with a diagram and a model answer. Free by email.
free tool
Check these numbers yourself
Put in your own guesses for Google Maps and see requests per second, storage, bandwidth and servers, with every sum written out.
Open the Capacity EstimatorIt is really nice and good Please join the course