Meeting Rooms II
Reported by candidates from Bloomberg's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
The detail that trips people on this Bloomberg OA, reported in February 2026, is the half-open interval. A meeting ending at time t frees its room for one starting at t. Example 3 exists to catch you on exactly that: [1,5] and [5,9] share a room, but [5,6] needs a second one. It's Meeting Rooms II, and the pattern is sorting plus a sweep over start and end times. With up to 100000 intervals, brute force won't pass. If you blank on the tie-breaking in the live assessment, StealthCoder is the invisible safety net that reads the problem and hands you a working solution.
The problem
You are given meeting time intervals where each row [start, end] uses a half-open interval: a meeting occupies a room from start up to, but not including, end. Return the minimum number of meeting rooms required so that every meeting can take place. A room whose meeting ends at time t may be reused by another meeting that starts at time t. Function minMeetingRooms(intervals: int[][]) → int Examples Example 1 intervals = [[0,30],[5,10],[15,20]] return = 2 The meeting [0,30] overlaps both shorter meetings, but the two shorter meetings do not overlap each other. Example 2 intervals = [[7,10],[2,4]] return = 1 The meetings are disjoint, so one room can host both. Example 3 intervals = [[1,5],[5,9],[5,6]] return = 2 The room used by [1,5] is available at time 5, while the two meetings beginning at 5 need two rooms together. Constraints 0 <= intervals.length <= 100000. Each interval has exactly two integers [start, end]. 0 <= start < end <= 10^9.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The trick: you only need to know how many meetings are active at once. Sort all start times and all end times separately. Walk through the starts with a pointer on the ends. If the earliest unfinished end is less than or equal to the current start, that room frees up, so advance the end pointer. Otherwise you need a new room. The answer is the peak room count. The alternative is a min-heap of end times: sort by start, pop the heap top if it's <= the new start, then push the new end. The heap size at the end is the answer. The pitfall is the comparison. Use <= for the free-up check, not <, or Example 3 returns 3. Also handle the empty array and return 0. Complexity is O(n log n) from sorting. If the tie rule slips your mind mid-assessment, StealthCoder can surface the correct comparison while you keep typing.
Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.
You can drill Meeting Rooms II cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.
Get StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as meeting rooms ii. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass Bloomberg's OA.
Bloomberg reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Meeting Rooms II FAQ
What's the trick to Meeting Rooms II?+
Count peak overlap, not pairs. Sort starts and ends separately, then sweep with two pointers. Every start that arrives before the earliest end needs a new room. Otherwise it reuses one. The max concurrent count is your answer, and it runs in O(n log n).
How do I handle meetings that touch at the same time?+
The problem says intervals are half-open, so a meeting ending at t doesn't block one starting at t. Use end <= start as the reuse condition. In Example 3, [1,5] and [5,9] share a room, and [5,6] forces the second one. Strict < gives the wrong answer.
Should I use a heap or the two-sorted-arrays approach?+
Either works and both are O(n log n). The heap version sorts by start and keeps end times in a min-heap. The two-array sweep needs no heap and is shorter to write. Pick whichever you can code without bugs. For 100000 intervals, both are fast enough.
What edge cases does this Bloomberg question hide?+
An empty intervals array should return 0. A single meeting returns 1. Meetings sharing the same start time each need their own room. Unsorted input is normal, as Example 2 shows. Values go up to 10^9, so compare them directly and don't build a timeline array.
How do I prepare for this in 48 hours?+
Write the sweep solution from scratch twice without looking. Then test Example 3 by hand and confirm you get 2. Practice the heap variant once as a backup. The pattern is interval overlap counting, and it shows up in plenty of scheduling-style questions, so the muscle memory pays off.