Problem statement
Design the object model and core APIs for the slot engine a multi-doctor clinic uses to turn each physician's stated availability into bookable appointment slots that patients reserve without ever double-booking a doctor.
Operating context. Each doctor declares recurring availability (e.g. Mon–Fri 09:00–13:00) plus one-off blocks and time-off. From that the system materializes discrete slots of a per-doctor duration (say 15 or 20 minutes). A patient searches open slots for a doctor or specialty and books one; the slot becomes unavailable. Patients cancel or reschedule, releasing the freed slot. A doctor is never assigned two overlapping appointments. Single clinic, in-process service, one wall clock.
Out of scope. EHR / records integration, insurance eligibility checks, the HTTP / REST surface, notifications and reminders, and the storage engine (assume in-memory for v1).
What to produce. The class hierarchy (availability templates, slots, appointments, doctor, scheduler service), each class's public API, and the state transitions for a slot (available → held → booked → released) and an appointment (requested → confirmed → completed / cancelled / no-show). Be explicit about: how availability rules expand into concrete slots for a queried date range, how overlap is detected so a doctor is never double-booked under concurrent bookings, and how the slot-duration and buffer rules are pluggable per doctor.
Requirements
This assessment is a Premium feature.
The statement above is free to read. The functional and non-functional requirements, and the graded canvas that scores your design against them, come with Premium.
Topics
- System Design LLD
- Oop Solid
- Patterns Strategy
- Algorithms Interval-Tree
- Concurrency Optimistic-Locking