Layer 3 · Go deeper · 11 min
Go deeper
Size it, build it, then make the calls an interviewer will push you on.
Back of the envelope
Size it up
Tap through each step of the arithmetic.
How many drivers are online at the evening peak?
How many location writes a second, and how much memory?
How many trips are in progress, and how many pushes a second?
Build-up · 5 steps
Build the high-level design
One functional requirement at a time, ending with a design that works for one city before any scaling.
Step 1 of 5
Quote, then book
The fare service gets a route time from the routing and ETA service, reads the surge and stores a quote that expires in minutes. “Book” sends only the quote ID, and the ride starts in MATCHING.
6 interview moments
You’re the candidate
The interviewer pushes on the hard parts. Pick an approach and see how it holds up.
Deep dive 1 of 6
Interviewer
“Drivers send 750,000 position updates a second, and dispatch makes about 1,000 nearby searches. How do you index live drivers?”
Your move. Pick an approach:
Deep dive 2 of 6
Interviewer
“Dispatch has the available drivers around a pickup. How do you choose which one gets the ride?”
Your move. Pick an approach:
Deep dive 3 of 6
Interviewer
“Two dispatchers near a boundary both see driver d_7 as available. How do you make sure d_7 never gets two rides?”
Your move. Pick an approach:
Deep dive 4 of 6
Interviewer
“A pickup search in Indiranagar should touch one machine, not fifty. How do you split dispatch across machines?”
Your move. Pick an approach:
Deep dive 5 of 6
Interviewer
“A ride is driven by timers: 15 seconds for an offer, 5 minutes before a no-show fee. How do you survive a crash mid-ride?”
Your move. Pick an approach:
Deep dive 6 of 6
Interviewer
“1.6 million riders watch their driver’s car move every 4 seconds. How do you get positions to their phones?”
Your move. Pick an approach:
Build-up · 8 steps
Follow one ride through it
Two pipelines meet at dispatch: a lossy, in-memory location pipeline and a strongly consistent ride pipeline on durable storage.
Step 1 of 8
Quote
The rider app asks for a fare. The fare service gets a route ETA, reads the surge multiplier for the pickup’s cell and stores a quote valid for 5 minutes.