Skip to content
We areTOP 1%

Design a ride-hailing service like Uber

HardConceptMedia & Commerce
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

Requirements: riders request trips, nearby available drivers are matched within seconds, both sides see live locations, and trips are priced and paid for.

  • Location updates: drivers send their position every few seconds; the latest positions are kept in memory (for example, in Redis) rather than written to a relational database each time.
  • Geospatial index: geohashes, a quadtree or a hexagonal grid such as H3 let the matching service find drivers in nearby cells quickly.
  • Trip service: manages a state machine (requested, accepted, in progress, completed) in a durable database, alongside pricing, surge and payment services.
  • Trade-off: more frequent location updates improve matching and ETAs but multiply write load; matching must also claim a driver atomically so that two riders are never assigned the same driver.

More in Media & Commerce

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account