Lesson 13 of 15
44. Design Ride-Hailing with Surge Pricing (Uber / Rapido)

Variations to practise

3 min read+10 XP

Chapters used

Approach (1), Estimation (2), Transactions and atomic assignment (17), Geospatial indexing (18), Real-time connections (21), Message queues and streams (22), APIs and idempotency (24), Failures (29), Checkout and payments (42).

Try these variations

Each is a common follow-up. Answer in two minutes, then check the sketch.

  1. "Shared rides." → Match riders whose routes overlap; insert pickups into an existing trip if the detour stays under a limit; split the fare.
  2. "Airport queue." → Drivers at the airport join a FIFO queue in a geofenced zone; trips there are offered by queue order, not distance.
  3. "Food delivery instead of rides." → Same index and matching, plus restaurant prep time: dispatch the rider so they arrive when the food is ready.
  4. "10× drivers." → More index shards per city (by cell range), lower update rates for idle drivers, and batch ETA computation.