<aside>
This section is part of the 5-hour System Design course by Mukul Raina
Section 7: Matching and Dispatch

Matching is the core problem that separates a ride-sharing platform from every other type of system you will design in an interview. Content platforms distribute static content. E-commerce platforms match buyers with inventory. A ride-sharing platform must match two moving entities in real time, under tight latency constraints, while preventing conflicts across concurrent requests. The engineering is in the matching, not the map.
This section builds directly on two previous sections. The spatial index from Section 6 provides the “find nearby drivers” query that feeds into matching. The Trip Service orchestrator from Section 4 coordinates the flow between Matching, Dispatch, and ETA. Here, we go inside those services to understand how candidate selection, scoring, offer dispatch, and conflict resolution actually work.
What We’ll Cover:
Interview Pacing:
In a 45-minute interview, matching and geospatial together occupy minutes 20-28. You have approximately 4-5 minutes for matching. Lead with the candidate pipeline (filter, score, rank), explain greedy vs batch as a trade-off, and describe the dispatch offer-accept-decline cycle. If the interviewer pushes on concurrency, discuss the locking strategy for preventing double-booking.