Lesson 2 of 14
โฎPrev Nextโฏ

MSD-101 ยท Global taxi booking design

Rider app and driver app

โฑ 10 min ๐ŸŽฎ Hands-on โ˜ Azure

2of 14

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    โšก The 30-second answer

    A taxi platform has two mobile apps with very different jobs. The rider app is light: short sessions, location only while open, push when in the background. The driver app runs for 10-hour shifts, sends GPS with the screen off, buffers points offline and must protect the battery, so it is built as a separate app on a shared core.

    • Rider screen flow
    • Driver screen flow
    • Background location rules
    • One app or two

    Try it

    Play with the design before you read about it. Everything runs on this page.

    Both apps, one trip, side by side. Tap any step.

    Rider app

    • Local DB + outboxActive trip, saved places, unsent commands.
    • Realtime clientWebSocket only while a trip screen is open.
    • Push handlerโ€œDriver arrivedโ€ when the app is in the background.
    • Payment SDKCard goes to the payment provider; we keep a token.
    • Locale + remote configLanguage, currency, ride types per country.
    • Secure token storeKeychain / Keystore, one refresher.

    Driver app

    • Location engineForeground service (Android) / background location (iOS). Interval changes by state.
    • GPS bufferKeeps up to 5 min of points offline, sends oldest first.
    • Offer handler15 s countdown, accept is an idempotent command.
    • NavigationRoutes from Azure Maps, or hand-off to the phoneโ€™s map app.
    • Trip state machineCan finish a trip offline; the server confirms later.
    • Battery guardLowers GPS rate when battery < 20% and not on a trip.
    ๐Ÿ™‹ Rider app๐Ÿš• Driver app
    ๐Ÿ“ GPSOnly on map screensAlways while online: 15 s idle, 4 s on trip
    โธ๏ธ BackgroundPush only; sockets closeMust keep running: foreground service / background location
    ๐Ÿ”‹ BatterySmall, short sessions10-hour shifts; the biggest design constraint
    ๐Ÿ“ด OfflineBooking survives in the outboxBuffers GPS, can end a trip offline
    ๐Ÿ”” Pushโ€œDriver arrivedโ€, receiptsNew offers when the app is in the background
    ๐Ÿ” PermissionsLocation while usingBackground location: extra app store review
    ๐Ÿ‘ฅ UsersMillions, casualThousands per city, daily, often low-end phones
    1. The problemA driver starts a shift at 7 am with a full battery. By 11 am the phone is at 15% and the app is asking for location โ€œall the timeโ€. Riders, meanwhile, complain the rider app wants background location too.
    2. The design ideaTwo users, two apps, one shared core.
    3. In real lifeLarge ride and delivery companies ship separate customer and partner apps. Partner apps often target low-cost Android phones, so they keep memory use low and cache map tiles.

    Start with a question

    A driver starts a shift at 7 am with a full battery. By 11 am the phone is at 15% and the app is asking for location โ€œall the timeโ€. Riders, meanwhile, complain the rider app wants background location too.

    The two apps share a trip but not their constraints. Treating them as one app hurts both.

    Explain it like I'm 10

    A pizza shop has a customer menu and a kitchen screen. Both see the same order, but the kitchen screen stays on all day and the customer menu is opened for two minutes. You would not build them the same way.

    The technical explanation

    Rider app: cars near you โ†’ set drop-off โ†’ choose a ride โ†’ finding your driver โ†’ driver on the way โ†’ on trip โ†’ pay and rate. It needs location only on map screens, a WebSocket only while a trip screen is open, and push for โ€œdriver arrivedโ€.

    Driver app: go online โ†’ offer with a 15 s countdown โ†’ go to pickup โ†’ rider picked up โ†’ trip โ†’ earnings. It must keep sending GPS with the screen off: an Android foreground service with a visible notification, or iOS background location mode.

    The driver app changes the GPS interval by state (15โ€“30 s idle, 4 s on a trip), buffers up to 5 minutes of points offline, and can finish a trip offline while the server confirms later.

    Build two apps on a shared core (API client, auth, models, design system). Riders never see a background-location prompt, the rider app stays small, and each app ships on its own schedule.

    AspectRider appDriver app
    GPSOnly on map screens15 s idle, 4 s on trip
    BackgroundPush onlyForeground service / background location
    BatteryShort sessions10-hour shifts
    OfflineBooking in the outboxGPS buffer, end trip offline
    PermissionsLocation while usingBackground location (extra review)

    ๐Ÿ“ฑ Both apps๐Ÿค” One app or two?

    Real-world scenario

    Large ride and delivery companies ship separate customer and partner apps. Partner apps often target low-cost Android phones, so they keep memory use low and cache map tiles.

    Ready for more?The full lesson adds the technical explanation, interview questions and quick revision.

    Test yourself

    5 questions. Get 4 right and this lesson is marked complete.

    1. 1. How does an Android driver app keep sending GPS with the screen off?
    2. 2. Why should the rider app not ask for background location?
    3. 3. The driver goes through a tunnel on a trip. What should the app do with GPS points?
    4. 4. What is the best way to share code between the two apps?
    5. 5. When should the driver app use a 4 s GPS interval?

    Pass the quiz to complete this lesson.

    Next: One app, many countries โ†’

    Questions people ask

    How do I keep the driver app sending GPS with the screen off?

    Android: a foreground service with a visible notification. iOS: background location mode. Lower the rate when idle, buffer points offline, and expect the store review to ask why you need it.

    Should a taxi app be one app or two?

    Two apps on a shared core library. Riders and drivers need different permissions, battery rules and release schedules.

    Does the rider app need background location?

    No. The rider app needs location only while a map screen is open, and uses push notifications when it is in the background. Asking riders for background location scares users and slows app store review.

    How do I save battery in a taxi driver app?

    Change the GPS interval by trip state: about every 4 s on the way to a pickup or on a trip, every 15โ€“30 s while waiting. Batch points when the signal is weak, and lower the rate when the battery is low.

    Interview questions

    How this topic comes up in system design interviews. Answer out loud first, then open the model answer.

    beginner Name three differences between a rider app and a driver app.

    Driver app runs in the background for hours, sends GPS continuously and must work offline mid-trip; the rider app is short-lived and relies on push in the background.

    intermediate How would you reduce battery drain in the driver app?

    Change GPS interval and accuracy by state, batch points when the signal is weak, avoid wake-ups when idle, and lower the rate when battery is low and the driver is not on a trip.

    advanced A driver ends a trip while offline. How do you make the fare correct?

    The app records the end event and buffered GPS points in its outbox with an idempotency key. When online it sends them; the server computes the fare from the route, confirms, and the app shows the serverโ€™s fare.

    Quick revision

    Remember

    • Rider screen flow
    • Driver screen flow
    • Background location rules
    • One app or two
    • Write the app store โ€œwhy we need background locationโ€ text on day one. If you cannot explain it in two sentences, the reviewer will not accept it either.

    One line to remember

    โ€œTwo users, two apps, one shared core.โ€

    Official documentation