Design a Doctor Appointment Booking System for Sudden Demand
Garner HealthSoftware Engineer · Technical ScreenLast updated
Design a doctor appointment system with searchable availability, atomic booking, cancellation, and protection against double booking. The follow-up examines a vaccine-demand spike through waiting-room admission, fairness, throttling, hot-slot partitioning, caching, autoscaling, load shedding, and reconciliation.
Design a Doctor Appointment Booking System for Sudden Demand
Design a system where patients search for doctors, view available time slots, book appointments, and cancel bookings. Doctors or authorized staff manage schedules and blocked time.
The system must prevent two patients from booking the same slot. As a follow-up, a new vaccine becomes available and demand for a limited set of appointments rises sharply in a short period.
Clarifying Questions to Ask
- Are appointments fixed slots, arbitrary time ranges, recurring schedules, or a combination?
- Can a visit require multiple resources such as a clinician, room, and equipment?
- Is availability allowed to be slightly stale, and what confirmation guarantee does booking provide?
- Are waitlists, rescheduling, eligibility, reminders, and payment in scope?
- What traffic increase and geographic distribution should the vaccine launch assume?
Follow-up questions
- How do you stop a stale cached availability result from causing a double booking?
- How would you implement a fair waiting room for a small number of vaccine appointments?
- What happens if a cancellation and a booking request race for the same slot?
- How would you support an appointment requiring both a doctor and a room?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.