Back to problems

Make Rider Addition and Dispatch Safe Under Concurrency

System Design · DoorDash · Hard

Rider Dispatch Concurrency Medium · Concurrency · DoorDash · Hints: Think about check‑then‑act races, atomic blocks, and lock granularity; separate reads from mutations; design for deterministic testing. You are building a ride‑hailing platform’s backend. The system lets riders signal that they are ready to accept trips (become available) and also dispatches a rider to a trip request. When multiple add‑available and dispatch requests arrive concurrently, race conditions can…

Checking your access…