Meeting Rooms II
A medium-tier problem at 52% community acceptance, tagged with Array, Two Pointers, Greedy. Reported in interviews at Miro and 40 others.
Meeting Rooms II is a medium-difficulty problem that's asked across 41 companies, including Netflix, Snap, and IBM. You're given a list of meeting intervals and need to find the minimum number of conference rooms required. The twist is that back-to-back meetings (one ends at 2pm, another starts at 2pm) can share a room. Most candidates default to sorting and simulation, then get stuck on edge cases around overlap logic. If this problem lands in your assessment and you blank on the heap trick, StealthCoder surfaces a working solution in seconds, invisible to the proctor.
Companies that ask "Meeting Rooms II"
Meeting Rooms II is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share.
Get StealthCoderThe naive approach is to sort meetings by start time and greedily assign rooms, but you'll miss that overlapping intervals can be counted efficiently by treating start and end times as separate events. The real insight is to use a min-heap to track when rooms free up. As you iterate through sorted meetings, you check if the earliest-ending occupied room is free before the next meeting starts. If it is, reuse that room; if not, book a new one. The heap size at any moment is your answer. Greedy with sorting handles the ordering, and the priority queue (heap) manages overlaps in linear time after sorting. This is where most candidates falter: they try to manually track intervals instead of letting the data structure do the work. StealthCoder is your hedge for the live OA if you freeze on the heap construction logic.
Pattern tags
You know the problem.
Make sure you actually pass it.
Meeting Rooms II recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Meeting Rooms II interview FAQ
Is Meeting Rooms II still actively asked, or has it fallen out of fashion?+
It's asked frequently across 41 companies including major tech firms like Netflix and Snap. The acceptance rate sits at about 52%, so it's neither a gimme nor a gotcha. It's a classic interval problem that rounds out most interview loops.
What's the main trick that separates passing and failing solutions?+
Recognizing that you need a min-heap to track room availability in real time, not just brute-force overlap checking. Most candidates sort correctly but then iterate naively. The heap reduces complexity from O(n^2) simulation to O(n log n) overall.
How does this relate to other interval problems I might see?+
Meeting Rooms II is the counting variant; Meeting Rooms I just asks if one room suffices. It shares the sorting and greedy DNA with merge intervals and interval scheduling, but adds the priority queue layer. Once you nail the heap pattern here, similar problems become mechanical.
Is there a way to solve this without a heap?+
Yes. Separate starts and ends into two arrays, sort both, and use two pointers to count simultaneous overlaps. It's O(n log n) like the heap approach but uses less space. Both are valid; the heap version is more intuitive once you see it.
Do I need to handle edge cases around meetings that end exactly when another starts?+
Yes. A meeting that ends at 2pm and another that starts at 2pm can share a room. When comparing times in your heap, ensure you only increment the room count if the start time is strictly before the earliest end time, not equal to it.
Want the actual problem statement? View "Meeting Rooms II" on LeetCode →