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

44.10 What would you say in the last five minutes?

3 min read+10 XP

Step 6: Wrap-up (5 minutes)

  • Bottlenecks: location ingestion (in-memory index per city, stream for history), road-ETA calls (cache popular ETAs, compute only for top candidates).
  • Single points of failure: none central: the index is rebuilt within seconds from incoming updates; matchers are stateless; trips DB has replicas per city.
  • Correctness: atomic assignment, idempotent trip events, quotes that lock prices.
  • Safety and trust: share-trip links, SOS, anomaly detection on routes (long detours), and fraud checks (fake GPS).
  • Next with more time: shared rides (matching several riders on one route), scheduled rides, driver earnings and incentives, and batch matching across a city.

Memory code: "Fresh positions, honest prices, one driver per trip, every state on record."