Accept Outlook Room Bookings Only When They Do Not Overlap

Last updated: November 29, 2026

Quick Overview

Build the booking check for a single Outlook conference room: each request is a half-open interval [start, end), and it is accepted only if it overlaps no booking already accepted.

Microsoft
Coding & Algorithms
Software Engineer
Microsoft
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


Build the booking check for a single Outlook conference room: each request is a half-open interval [start, end), and it is accepted only if it overlaps no booking already accepted.

An ordered-set design question tied to Outlook and Exchange room resources. The interviewer checks that the candidate only needs to compare a new booking with its two neighbors in sorted order, and can discuss which ordered structure to use in each language.

What the Interviewer Expects
  • Keep accepted bookings sorted by start time
  • Find the insertion point with binary search
  • Compare only with the previous and next booking
  • Treat intervals as half-open so back-to-back meetings are fine
  • Discuss O(log n) with a balanced BST versus O(n) list insertion
Key Topics to Cover
ordered sets
binary search
interval overlap
Outlook scenario
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • Allow up to two overlapping bookings (a room with a backup) but never three.
  • Support cancelling a booking by ID.
  • Return the maximum number of simultaneous bookings at any time, for a floor of rooms.
  • How would you make this safe under concurrent requests?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements
  • book(start, end) with start < end returns True and stores the booking, or returns False.
  • Bookings are half-open: [10, 20) and [20, 30) do not overlap....
High-Level Design

Because accepted bookings never overlap, sorting them by start also sorts them by end. So a new booking can only collide with its immediate neighbors in that order: the last booking that starts at or ...


Submit Your Answer
Markdown supported