Courses / Machine Coding and Low-Level Design in TypeScript / Chapter 13
Module 6 · Design problems III: meetings, cinemas and car rental · Chapter 13 of 28
Meeting Scheduler: Rooms, Calendars, Conflicts and Invites
Builds on Solving a Design Problem: Requirements to Tested Code in Six Steps, Design Patterns in TypeScript: Creational, Structural and Behavioural and Parking Lot: Floors, Spots, Tickets and Fees. Next up: Movie Ticket Booking: Shows, Seat Holds and No Double Booking.
Part 1 · Requirements
What the scheduler must do
A shared office has more meetings than rooms and more invitations than hours. This chapter builds a scheduler that finds a free hour for several people, books a room that fits and tracks every reply.
As in the parking lot chapter, the functional requirements come first. For a Pune office with five people and three meeting rooms, they are these.
- Every person and every room has a calendar: the list of meetings they are part of, each with a start and an end.
- An organiser asks for a free slot of a given length for a group of people, inside a time window. The answer is the earliest start that works for everyone.
- An organiser books a meeting at a chosen time with a list of attendees and, optionally, a room. The booking is refused when anyone is busy or when no room fits.
- The room is the smallest free room whose capacity covers the people attending.
- Each attendee receives an invitation and answers accepted, tentative or declined. A decline gives that person's time back.