44. Design Ride-Hailing with Surge Pricing (Uber / Rapido)
The interview prompt
This chapter is a full interview round, played out step by step. The interviewer's lines are in quotes. At each step you'll see what a strong candidate says, the pushback the interviewer throws, and how to answer it. At the end, grade yourself with the rubric.
How to use this chapter
- Read only the prompt below. Then stop.
- Set a 45-minute timer and do the whole round yourself, on paper or a whiteboard, out loud. Use the framework from Chapter 1: READ, then Draw, Dive, Defend.
- Then read the walkthrough and compare. Score yourself with the rubric at the end.
Chapter 18 built the geospatial index; Chapter 17 the atomic assignments; Chapter 21 the live connections. This round puts them together into a system where things move: drivers, riders and prices all change by the second.
The prompt
"Design a ride-hailing app like Uber or Rapido: riders request a ride, the system finds a nearby driver, tracks the trip, and prices it, including surge pricing when demand is high."
Stop here. Start your timer.