Meeting Scheduler
Calendar-Based Meeting Coordination
Design a meeting scheduler that finds common free time across people in different time zones, books them and a suitable room in one atomic step, and handles replies and cancellations.
Overview
A meeting scheduler answers two questions. When are all these people free for an hour? And can I book that hour for all of them and a room with a screen, right now, without someone else grabbing it first? The first is an interval problem. The second is a concurrency problem, because one booking touches several calendars at once.
The interviewer listens for four things: a clean interval model (every time stored in UTC, working hours converted from each person's zone), a free-slot algorithm you can state and give a cost for, a booking that locks several calendars without deadlocking, and sensible behavior for replies, cancellations and recurring meetings.
Scoping the problem
Ask these questions first, because each answer shapes the model.
- Are attendees in different time zones? Usually yes, so working hours must be converted per person and per date.
- Only working hours, or any time? This sets the search window. The usual answer is working hours, per person.
- Rooms: capacity, equipment? Usually yes, seats and a video screen, which adds a second resource to book along with the people.
- What if a room and people are free but a second booking arrives at the same time? Booking must be atomic across calendars. One of them wins, and the other gets a clear error.
- Does a declined invite free the person's time? Usually yes, which changes their availability.
- Recurring meetings? You either store a rule or every instance. The usual answer is a rule, expanded on demand, as a follow-up.
- Notifications? This decides who is told what, and when. The usual answer is invite and cancel events sent to a listener.
Functional requirements
- free_slots(people, day, minutes) returns every gap of at least that length inside everyone's working hours
- book(title, organizer, attendees, start, minutes, needs) books all people and the smallest suitable free room, or fails with SlotTaken or NoRoom
- Rooms have a capacity and a set of equipment; a booking needs enough seats and every item asked for
- respond(meeting, person, answer): accepted, declined or pending; a decline frees the person's time
- cancel(meeting) frees every attendee and the room and notifies attendees
- People work in their own time zones; all times are stored in UTC
Non-functional requirements
- Two bookings that share a person or a room never both succeed for overlapping times
- No deadlock: locks are always taken in one global order
- Free-slot search is O(B log B) in the number of busy intervals
- Correct across daylight saving changes: zone names, not fixed offsets
- Notification channels are pluggable listeners; the scheduler does not know about email
Interview questions
- Your first version intersected calendars two at a time. Is the sweep better?
- How do you avoid deadlock when a booking locks several calendars?
- How do you store a weekly meeting that runs for a year?
- There is no slot where everyone is free. What does the scheduler offer?
Sign up free to read the full topic
More Low-Level Design topics
Start free on Cariara · Coding problems · System design studio