Design a ride-sharing (UberPool-like) system focused on matching and routing.
You are operating on a grid where travel distance is Manhattan distance:
d((x1,y1),(x2,y2))=∣x1−x2∣+∣y1−y2∣.
A driver starts at S and wants to go to destination T. The driver is willing to pick up additional riders only if doing so does not increase the driver’s total travel distance, i.e., the final driven distance must remain exactly d(S,T).
Goal
-
Serve as many additional riders as possible while respecting the “zero extra Manhattan distance” constraint.
What to cover
-
Clarify product requirements and constraints.
-
Core APIs (request ride, accept match, updates).
-
High-level architecture and key components.
-
Data model and storage choices.
-
Matching strategy/algorithm under the zero-detour Manhattan constraint.
-
Scalability, latency, consistency, and failure handling.
-
Metrics and edge cases.