Design a Ride Sharing Service like Uber.
Code Playground
JavaScript (V8)
Loading...
Console Output
// Output will appear here...
// For React: ReactDOM.createRoot(rootElement).render(<App />);
// For React: ReactDOM.createRoot(rootElement).render(<App />);
Recommended Answer
System Design Scenario:
1. Core: Driver Location Updates (high frequency).
2. Geo-Spatial Index: QuadTree or Google S2.
* Drivers send location every 3s.
* Service updates driver position in the index.
3. Matching: Find nearest available drivers (radius search on QuadTree).
4. State Machine: Request -> Matching -> Accepted -> Arrived -> InProgress -> Completed.