Count Conference Rooms Needed at Peak Meeting Load
Last updated: November 29, 2026
Quick Overview
Given a day's meetings as (start, end) times, return the minimum number of rooms needed so no two overlapping meetings share a room, and the time at which that peak is first reached.
Microsoft
November 29, 20260
0
0 solved
Given a day's meetings as (start, end) times, return the minimum number of rooms needed so no two overlapping meetings share a room, and the time at which that peak is first reached.
A scheduling question that fits Microsoft's Outlook room booking and Teams Rooms device planning. Interviewers look for the sweep-line insight, correct ordering of simultaneous start and end events, and the ability to reason about why the peak overlap equals the room count.
What the Interviewer Expects
- Explains why the maximum number of simultaneous meetings equals the rooms needed
- Implements a sweep over start and end events
- Orders an end before a start at the same timestamp
- Mentions the min-heap of end times as an alternative that also assigns rooms
- Handles zero-length and empty inputs
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- Return an actual room assignment for each meeting.
- Rooms have capacities and meetings have attendee counts: how does the problem change?
- Meetings are booked and cancelled live all day: how would you answer peak load queries quickly?
- How would you find every time window where more than R rooms are needed?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Meetings are half-open [start, end), so a meeting ending at 10:00 frees its room for one starting at 10:00. Return (rooms, time), where time is when the maximum concurrency first occurs, useful fo...
High-Level Design
Rooms needed is a lower bound of the maximum overlap at any instant, and greedy assignment achieves it (interval graphs are perfect), so the answer is exactly the peak overlap. To find the peak, turn ...