codebaobab
Python workspace

All problemsData & Systems

Meeting Room Booking

Build a meeting-room booking service with no overlaps and a next-free suggestion from a one-page spec.

Python60 minutesData & Systems

Challenge brief

Read before you begin

Your mission · Build from a spec

Build the booking service that keeps meeting rooms free of overlaps, inside business hours, and suggests the next free slot.

Tidewell's room app checks clashes with a nightly script, so two teams often arrive for the same room. Members logged 61 double bookings in November, and 9 of them were client meetings. A rejected request just says no, so members retry by hand. The new Harbor Street building opens December 14 with 12 more rooms.

  • Target · All public checks
  • Mode · Build from scratch
Skip to round setup

Your assignment

  1. Read docs/spec.md and choose the data model.
  2. Check business hours and overlaps.
  3. Add the next free start, cancel and the agenda.
  4. Handle the new requirement when it arrives.
  5. Write the model and next steps in NOTES.md.

The problem

Clashes found overnight

Overlaps are only caught by a script that runs at 2 a.m.

Impact: 61 double bookings in November, 9 of them with clients waiting.

A rejection is a dead end

The app says the room is taken and nothing else.

Impact: Members try times by hand, and 1 in 5 gives up and books a bigger room.

Hours and search are stubs

Every book request fails with NotImplementedError.

Impact: Harbor Street cannot open its rooms in the app.

Context

Double bookings in Nov
61
Meeting rooms
58
Harbor Street opens
Dec 14

Requirements

  • Bookings are half-open: touching ones do not clash.
  • Weekdays only, from open to close.
  • A booking may end exactly at closing.
  • Hours are checked before overlaps.
  • next is the earliest start of the same length.
  • A rejected request books nothing.
  • A booked ID is never used again.
  • Bad input raises ValueError naming the field.

System overview

Edit the components marked “Your work”. The other components show where your changes fit.

Member appSends book and cancel
Booking service(Your work)Accepts or rejects bookings
Room calendarLive bookings per room
Building directoryRooms and opening hours
Front-desk tabletShows the day per room
Reminder serviceSends reminders
Read the connections
  • Member app → Booking service: book, cancel
  • Building directory → Booking service: rooms, hours
  • Booking service → Room calendar: bookings
  • Front-desk tablet → Booking service: agenda
  • Room calendar → Reminder service: upcoming
  • Member app: Sends book and cancel requests for 4,200 members.
  • Booking service: simulate(config, requests) in booking/service.py; the Calendar in booking/services/bookings.py.
  • Room calendar: Every live booking per room, as start and end times.
  • Building directory: Rooms, seats, equipment and opening hours per building.
  • Front-desk tablet: Shows each room's agenda for the day.
  • Reminder service: Emails members 15 minutes before a booking starts.

Details

Full requirements

Functional

  1. simulate(config, requests) runs the requests in order on a new calendar and returns one result per request. config is {rooms, open, close} for one building. Times are "YYYY-MM-DDTHH:MM" in the building's local time.
  2. A book request {op: "book", id, room, start, end} covers [start, end), so a meeting that ends at 10:00 and one that starts at 10:00 can both happen in the same room, as members expect.
  3. A booking must lie inside one weekday's business hours, from open to close, and may end exactly at close, because the building locks its rooms at closing. Outside hours the result is reason hours, checked before overlaps.
  4. A booking that overlaps one in the same room is rejected with reason overlap and next: the earliest start at or after the requested one where the same length fits in that room, on a later weekday if need be, so the app can offer it with one tap.
  5. A rejected request books nothing and its ID may be sent again. An ID that was ever booked cannot be booked again (ValueError mentioning duplicate), because reminders and invoices refer to it. A cancel of an ID that is not booked raises ValueError mentioning unknown.
  6. An agenda {op: "agenda", room, day} lists the room's live bookings that start that day, by start time, and changes nothing. Bad input raises ValueError naming the field: rooms, open, close, id, room, start, end, day; any other op raises ValueError mentioning op.

Non-functional

  • Scale: 70 rooms after Harbor Street opens, about 1,100 bookings a weekday, and up to 400 live bookings per room over the next eight weeks.
  • Latency: the app shows the result while the member waits. A book request with a suggestion must answer in under 200 ms.
  • Consistency: two requests are never both accepted for overlapping times in one room. Requests are applied one at a time in the order received.
  • Determinism: replaying the request log must reproduce every result exactly. Times are whole minutes in local time, so nothing depends on the server clock.
  • Cost of a wrong answer: a double booking costs a meeting, sometimes a client; a wrong rejection sends the member to a bigger room that costs Tidewell about $18 an hour in lost rentals.

Out of scope

  • Time zones and daylight saving. Each building runs on its own local time.
  • Holidays and buildings with different hours per day.
  • Seats and equipment. They are in the config but not used yet; matching meetings to rooms may arrive as a new requirement.
  • Repeating bookings. They may arrive as a new requirement.
Data model

Room

FieldTypeNotes
namenon-empty stringUnique in the building, for example "Pier".
seatsinteger >= 1Not used by the core rules.
equipmentstring[]For example ["screen", "video"]. Not used by the core rules.

Book request

FieldTypeNotes
op"book"
idnon-empty stringBooking ID from the app, for example "bk_3101".
roomstringA room name from the config.
start, end"YYYY-MM-DDTHH:MM"The half-open interval [start, end). end is after start.

Book result

FieldTypeNotes
idstring
state"booked" or "rejected"
reason"hours" or "overlap"Only when rejected.
next"YYYY-MM-DDTHH:MM"Only for overlap: the earliest start that fits.
Files you are given · 5
  • config/harbor-street.json The rooms and hours of the Harbor Street building, which opens December 14.
    {
      "building": "Harbor Street",
      "opens": "2026-12-14",
      "rooms": [
        {
          "name": "Lighthouse",
          "seats": 4,
          "equipment": [
            "screen"
          ]
        },
        {
          "name": "Pier",
          "seats": 8,
          "equipment": [
            "screen",
            "video"
          ]
        },
        {
          "name": "Boathouse",
          "seats": 14,
          "equipment": [
            "video",
            "whiteboard"
          ]
        }
      ],
      "open": "08:00",
      "close": "18:00"
    }
  • samples/friday-requests.json A Friday at Harbor Street: clashes, a too-late booking, a cancel and an agenda. Arguments for Preview.
    [
      {
        "rooms": [
          {
            "name": "Lighthouse",
            "seats": 4,
            "equipment": [
              "screen"
            ]
          },
          {
            "name": "Pier",
            "seats": 8,
            "equipment": [
              "screen",
              "video"
            ]
          },
          {
            "name": "Boathouse",
            "seats": 14,
            "equipment": [
              "video",
              "whiteboard"
            ]
          }
        ],
        "open": "08:00",
        "close": "18:00"
      },
      [
        {
          "op": "book",
          "id": "bk_3101",
          "room": "Pier",
          "start": "2026-12-11T09:00",
          "end": "2026-12-11T10:00"
        },
        {
          "op": "book",
          "id": "bk_3102",
          "room": "Pier",
          "start": "2026-12-11T10:00",
          "end": "2026-12-11T11:30"
        },
        {
          "op": "book",
          "id": "bk_3103",
          "room": "Pier",
          "start": "2026-12-11T09:30",
          "end": "2026-12-11T10:30"
        },
        {
          "op": "book",
          "id": "bk_3104",
          "room": "Pier",
          "start": "2026-12-11T13:00",
          "end": "2026-12-11T17:00"
        },
        {
          "op": "book",
          "id": "bk_3105",
          "room": "Pier",
          "start": "2026-12-11T12:00",
          "end": "2026-12-11T14:00"
        },
        {
          "op": "book",
          "id": "bk_3106",
          "room": "Lighthouse",
          "start": "2026-12-11T17:00",
          "end": "2026-12-11T18:30"
        },
        {
          "op": "book",
          "id": "bk_3107",
          "room": "Pier",
          "start": "2026-12-11T16:00",
          "end": "2026-12-11T17:30"
        },
        {
          "op": "cancel",
          "id": "bk_3101"
        },
        {
          "op": "book",
          "id": "bk_3108",
          "room": "Pier",
          "start": "2026-12-11T09:00",
          "end": "2026-12-11T10:00"
        },
        {
          "op": "agenda",
          "room": "Pier",
          "day": "2026-12-11"
        }
      ]
    ]
  • samples/friday-requests-expected.json What the spec says those requests return. Two suggestions skip the weekend to Monday at 08:00.
    [
      {"id": "bk_3101", "state": "booked"},
      {"id": "bk_3102", "state": "booked"},
      {"id": "bk_3103", "state": "rejected", "reason": "overlap", "next": "2026-12-11T11:30"},
      {"id": "bk_3104", "state": "booked"},
      {"id": "bk_3105", "state": "rejected", "reason": "overlap", "next": "2026-12-14T08:00"},
      {"id": "bk_3106", "state": "rejected", "reason": "hours"},
      {"id": "bk_3107", "state": "rejected", "reason": "overlap", "next": "2026-12-14T08:00"},
      {"id": "bk_3101", "state": "cancelled"},
      {"id": "bk_3108", "state": "booked"},
      {"room": "Pier", "day": "2026-12-11", "bookings": [{"id": "bk_3108", "start": "2026-12-11T09:00", "end": "2026-12-11T10:00"}, {"id": "bk_3102", "start": "2026-12-11T10:00", "end": "2026-12-11T11:30"}, {"id": "bk_3104", "start": "2026-12-11T13:00", "end": "2026-12-11T17:00"}]}
    ]
  • logs/clash-report-2026-11-20.log The nightly clash script at Quayside, including a false clash between two bookings that only touch.
    2026-11-20T02:00:04-05:00 clash-check building=quayside rooms=11 bookings=212
    2026-11-20T02:00:05-05:00 CLASH room=Dockside a=bk_2240 09:00-10:00 b=bk_2251 09:30-10:30
    2026-11-20T02:00:05-05:00 CLASH room=Dockside a=bk_2251 09:30-10:30 b=bk_2263 10:00-10:45
    2026-11-20T02:00:05-05:00 FALSE-CLASH room=Gantry a=bk_2270 13:00-14:00 b=bk_2271 14:00-15:00 note=touching
    2026-11-20T02:00:06-05:00 clash-check done clashes=2 false_clashes=1 emailed=front-desk
  • metrics/double-bookings-2026-11.csv Double bookings per week in November, and how many rejected members retried by hand.
    week,bookings,double_bookings,client_meetings_hit,rejections_retried_by_hand
    2026-11-02,5310,14,2,388
    2026-11-09,5452,17,3,402
    2026-11-16,5508,16,2,421
    2026-11-23,5287,14,2,395
Tickets · 4
  • TASK-201 Read docs/spec.md and decide the data model Reported by Kofi (member apps)

    Expected NOTES.md says what the calendar stores for a booking, how two bookings are tested for overlap, and why touching bookings are free.

    Actual Calendar stores bookings by ID, but nothing writes down the overlap test, and the hours rules and the search are stubs.

  • TASK-202 Core: business hours and the overlap test Reported by Kofi (member apps)

    Expected Bookings that touch are both booked, a booking that ends at closing is booked, and the Saturday one is rejected with reason hours.

    Actual Every book request fails with NotImplementedError: "Implement within_hours using the request contract".

  • TASK-203 Then the next free start, then cancel and the agenda Reported by Aisha (Harbor Street manager)

    Expected Every result matches the expected file, and bk_3105 is offered Monday December 14 at 08:00.

    Actual Every clash fails with NotImplementedError from Calendar.conflicts or Calendar.next_free.

  • TASK-204 Write down anything you chose to leave out or would do next Reported by Marcus (engineering manager)

    Expected A short list of what the service does not handle yet and what you would build next, with a reason for each.

    Actual NOTES.md has no entry.

What you hand in
  • Every public check passing, including the new requirement when it arrives.
  • NOTES.md: the data model and the overlap test in a few lines, the order you built it in, and what you left out or would do next.
  • Your answer to the interviewer's follow-up and the debrief questions.
How the work is judged
Breaking down the work
States the overlap test and the data model before asking for code, then builds hours and overlaps, the next free start, and cancel and the agenda in that order, with the checks run after each.
Directing the assistant
Hands the assistant one function at a time with the exact rule: the half-open overlap test, hours before overlaps, and a search that always moves forward.
Checking the work
Works small request lists by hand first, checks the Friday sample against its expected file, and tries touching bookings, a booking that ends at closing and a Friday afternoon clash.
Judging the assistant
Rejects a closed-interval overlap test, a suggestion past closing or on a weekend, a search that stops at the first clash, or a rejected request that keeps its slot.
Correct result
All checks pass, including touching bookings, hours before overlaps, suggestions across days and weekends, and the follow-up weekly series.
Explaining the work
Explains the overlap test and the search in a few sentences a building manager could follow, and names what was left out.
Trade-offs to discuss
  • Scanning every booking in a room versus keeping each room's bookings sorted by start, at 400 live bookings a room.
  • Suggesting the next start in the same room versus the same time in another room.
  • All-or-nothing weekly series versus booking the free weeks and reporting the rest.
  • Never reusing a booking ID versus letting the app reuse it after a cancel.
How you are graded
  • Decomposition 25%
  • Prompting the assistant 15%
  • Verification 20%
  • Judgment about AI output 10%
  • Correctness 20%
  • Communication 10%

Scores use evidence from your session. A short or incomplete session may not provide enough evidence for every skill. See a sample scorecard

Interview guidance

Build the booking service behind our meeting-room app. Bookings cannot overlap, must sit inside business hours, and when a room is taken the member should get the next time it is free. The spec is one page. Start with a working core and grow it. Use the AI assistant however you like, and tell me how you test two bookings for overlap before you ask it for code.

  • AI is allowed and expected: your own Claude, OpenAI or Gemini key, or the free in-browser model.
  • You are graded on how you drive and check the AI, not on how much you prompt.
  • Run the checks; read what fails.
  • A new requirement will arrive partway through.
  • Too little AI use is reported as “not enough to grade”, never as a fail.
Debrief · 8 questions
  • What did you delegate to the AI, and why?
  • Name one AI suggestion you rejected or changed, and why.
  • Choose one block the AI helped write. Explain what each line does and which test verifies it.
  • What is still risky, and what would you test or ship next?
  • What was your core, and how long did it take to get its first check passing?
  • How do you test two bookings for overlap, and what did you decide yourself before asking the assistant?
  • Which edge case did you test that the assistant's first version got wrong?
  • What did you leave out, and what would you build next for a real booking app?