MSD-101 · Global taxi booking design
Design lab: same app, different problems
⏱ 15 min 🎮 Hands-on ☁ Azure ✓ Completed
⚡ The 30-second answer
Once you know the base design, new requirements are changes to it: what to keep, what to add, what to drop. Use the same six steps every time (requirements, estimate, split, draw, break, review) and the same patterns appear in food delivery, wallets, chat and games.
- A six-step design recipe
- Six new problems
- Keep, add, drop
- Patterns in other apps
Try it
Play with the design before you read about it. Everything runs on this page.
A rider books tonight for a 6:00 am airport pickup tomorrow. Nobody should hold a socket open all night, and a driver must really turn up.
Which building blocks belong in your design? Pick all that apply.
- Book = command: save SCHEDULED trip, return at once.
- Service Bus fires at pickup − 20 min and starts normal matching.
- Push to rider and driver; from here it is the same live flow.
Same app in a market with cheap 2 GB phones, prepaid data and networks that drop to 2G between buildings.
Which building blocks belong in your design? Pick all that apply.
- The backend barely changes; the phone does the hard work.
- Batch and compress GPS, cache tiles, keep the outbox.
- Design for the worst network, not the office Wi-Fi.
At the airport, drivers wait in a holding area and must be served first-come, first-served, not by distance.
Which building blocks belong in your design? Pick all that apply.
- Same stream, different matching rule.
- Geofence → join a FIFO queue with an idempotent call.
- Offer to the head of the queue; on no answer, move to the next driver.
Two or three riders going the same way share one car and split the fare.
Which building blocks belong in your design? Pick all that apply.
- Model a trip as a car route with several rider legs.
- Match by detour cost, not only distance.
- Each rider gets their own state, ETA and fare.
At 00:05 on 1 January, booking requests jump from 200 to 2,000 a second for 30 minutes.
Which building blocks belong in your design? Pick all that apply.
- Absorb: queue the commands. Scale: autoscale on lag.
- Protect: rate limits, idempotency, honest UI.
- Load-test the 10× day before it happens.
The business adds parcel delivery: no rider in the car, and the driver must take a photo as proof of delivery.
Which building blocks belong in your design? Pick all that apply.
- Same platform, new trip type.
- Files go straight to Blob Storage; the API only stores the link.
- Proof upload uses the outbox, so offline is fine.
Stream vs command
- Food deliveryCourier location streams; “place order” is a command
- LogisticsTruck telemetry streams; “assign load” is a command
- Trading appPrice ticks stream; “buy” is a command
Idempotency key
- E-walletA transfer retried on bad network moves money once
- ShoppingDouble-tap on “Pay” creates one order
- TicketingOne seat, even if the request is sent twice
Outbox + backoff
- ChatMessages typed offline send when signal returns
- Notes / field formsInspections saved in a basement sync later
- BankingBill payments queued, retried safely
Geo index + expiry
- Scooter rentalNearby scooters that pinged in the last minute
- Food deliveryNearest free courier to the restaurant
- Field serviceClosest available technician
Pub/sub fan-out
- Group chatOne message to 200 members
- Live scoresOne goal event to a million fans
- Multiplayer gameOne move to every player in the room
Push to wake + re-sync
- E-wallet“You received RM 50”, then the app reads the balance
- ChatNew message push, then fetch the conversation
- Delivery“Parcel at your door”, then show proof photo
- The problemYour manager says: “Next quarter we add scheduled rides, parcel delivery and a bike taxi in a new country.” Three features, one platform, one week to propose a design.
- The design ideaNew feature = keep, add, drop. Never start from zero.
- In real lifeRide platforms grew into food, parcels and payments by reusing the same live location, matching and payment building blocks, with new rules on top.
Start with a question
Your manager says: “Next quarter we add scheduled rides, parcel delivery and a bike taxi in a new country.” Three features, one platform, one week to propose a design.
Architects rarely design from zero. They change a working design without breaking it.
Explain it like I'm 10
You built a Lego house. Now you need a garage. You do not knock the house down; you add pieces and maybe move a wall.
The technical explanation
The recipe: requirements → estimate → split streams from commands → draw boxes → break it → review AI-written code. Run it for every new feature.
Scheduled rides add a durable timer (Azure Service Bus scheduled messages) and a SCHEDULED status. Airport queues change the matching rule from nearest to first-come, first-served.
Pooling turns a trip into a route with several rider legs. Parcels reuse the stream and matching, and upload proof photos straight to Blob Storage. 2G markets batch GPS and fall back to HTTPS.
The patterns travel: idempotency keys protect wallet transfers, outboxes send chat messages typed offline, fan-out delivers group chat and live scores, and push-to-wake tells you money arrived.
| New problem | Main change |
|---|---|
| Scheduled rides | Service Bus scheduled message, SCHEDULED status |
| Bike taxi on 2G | Batch GPS, HTTPS fallback, cached tiles |
| Airport queue | Geofence + FIFO queue instead of nearest |
| Pooling | Multi-stop routes, per-rider legs |
| New Year surge | Queue + autoscale + rate limits |
| Parcel delivery | Blob upload with SAS, DELIVERED + photo |
Real-world scenario
Ride platforms grew into food, parcels and payments by reusing the same live location, matching and payment building blocks, with new rules on top.
Test yourself
5 questions. Get 4 right and this lesson is marked complete.
Pass the quiz to complete this lesson.
Next: Live driver location at scale →Questions people ask
How do I practise mobile system design?
Take a working design and change one requirement at a time: a new country, a new product, 10× load, a weak network. Write what you keep, add and drop, then check it against failures.
How do I add scheduled rides to a taxi app?
Save the trip with a SCHEDULED status and an idempotency key, then put an Azure Service Bus message scheduled for 20 minutes before pickup. When it arrives, normal matching starts and both apps get a reminder push.
Are the same patterns used outside ride apps?
Yes. Idempotency keys in payments, outboxes in chat and field apps, geo indexes in scooter rental and delivery, fan-out in group chat and live scores, push-to-wake almost everywhere.
Interview questions
How this topic comes up in system design interviews. Answer out loud first, then open the model answer.
intermediate Add scheduled rides to an existing ride app.
Save the trip as SCHEDULED with an idempotency key, put a Service Bus message scheduled for pickup minus 20 minutes, start normal matching when it fires, and push reminders to rider and driver.
intermediate Add shared rides (pooling).
Model a trip as a car route with rider legs, match by detour cost with a limit, keep state, ETA and fare per rider, and compute fares on the server.
advanced Prepare the platform for a 10× New Year spike.
Queue booking commands, autoscale on queue length and Event Hubs lag, rate-limit per user, keep idempotency on, show an honest high-demand screen, and load-test the spike weeks before.
Quick revision
Remember
- A six-step design recipe
- Six new problems
- Keep, add, drop
- Patterns in other apps
- Before adding a box, ask which existing box can do the job with a new rule. The best design change is often the smallest one.
One line to remember
“New feature = keep, add, drop. Never start from zero.”
Official documentation
- Azure Service Bus (Microsoft Learn)
- Azure Well-Architected Framework: reliability (Microsoft Learn)