Design a Car Service-Center Booking System
Design a highly available service that lets drivers discover nearby service centers, view availability, and reserve a service slot without double-booking.
Problem statement
Design a car service-center booking system. Customers should be able to find nearby centers, view available appointment slots, book a slot, and cancel a booking. The design must remain available for searches while preventing two customers from confirming the same service bay and time interval.
For this exercise, assume customers search within 50 kilometers and choose a service type before viewing slots. A booking attempt creates a five-minute hold, and at most one confirmed booking may own a center, service bay, and time interval.
Search availability may lag authoritative slot state by up to two seconds, but confirmation must validate the latest state. Cancellations release the slot, and confirmed bookings must survive a single-zone failure without duplication.
What to build
- Search service centers within 50 kilometers by location and service type.
- View bookable slots for a selected center and service type.
- Create a five-minute slot hold and confirm at most one booking for a bay and time interval.
- Cancel a confirmed booking and release its slot.
At scale
- For this exercise, assume 10,000 service centers and 1 million daily active customers.
- For this exercise, assume 20,000 search requests per second and 1,000 booking attempts per second at peak.
- For this exercise, assume search availability may be two seconds stale while booking confirmation is authoritative.
- For this exercise, assume confirmed bookings must survive a single-zone failure without duplication.