Given an array of meeting time intervals where each interval is [start, end], determine the minimum number of conference rooms required to hold all meetings.
For example: [[0,30],[5,10],[15,20]] requires 2 rooms because [0,30] overlaps with both other meetings, but [5,10] and [15,20] don't overlap with each other.
Explain your approach and walk through an example.
How to approach it
- Hint 1
Sort the meetings by start time. Then think about what determines when a room is freed up.
- Hint 2
A min-heap can track the earliest ending meeting across all active rooms.
- Hint 3
If the next meeting starts after the earliest room frees up, reuse that room instead of adding a new one.
Ready to answer it out loud?
Record your answer in 1:30 and Preptile scores it 1–10 with specifics — what landed, what you skipped, and what to say next time.
Practising needs an invite code. Join the waitlist and we’ll send you one.