Meeting Rooms II
Updated
Problem statement
You are given an array of meeting intervals intervals, where each interval is [start, end). Return the minimum number of rooms required to schedule every meeting without overlap.
Intervals are half-open: when one meeting ends at the exact time another begins, they do not overlap and may use the same room. Return 0 when intervals is empty.
Function
minMeetingRooms(intervals: int[][]) → intExamples
Example 1
intervals = [[0,30],[5,10],[15,20]]return = 2The meeting from 0 to 30 overlaps both shorter meetings, while those two shorter meetings can share a second room.
Example 2
intervals = [[0,8],[8,10],[10,15]]return = 1Each meeting starts exactly when the previous meeting ends, so one room can be reused.
Example 3
intervals = []return = 0No meetings require no rooms.
Constraints
0 <= intervals.length <= 100000intervals[i].length == 2-2147483648 <= intervals[i][0] < intervals[i][1] <= 2147483647- Meetings use half-open intervals, so an end time equal to another start time is not an overlap.
More Uber Phone Screen questions
- Worst-Performing Ads by CTR in a Campaign TreePHONE SCREEN · Seen Nov 2026
- Earliest Time All Users Are ConnectedPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Max Points on a LinePHONE SCREEN · Seen Oct 2026
- Convex Function MinimizationPHONE SCREEN · Seen Oct 2026
- Merge Meeting IntervalsPHONE SCREEN · Seen Oct 2026
- Minimum Meeting Rooms with AssignmentsPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Find Robots by Blocker DistancesPHONE SCREEN · Seen Oct 2026
- Sliding-Window Rate LimiterPHONE SCREEN · Seen Oct 2026
- Count Connected IslandsPHONE SCREEN · Seen Sep 2026
- Dynamic Island CountsPHONE SCREEN · Seen Sep 2026
Similar questions at other companies
- Meeting Rooms IIAmazon · PHONE SCREEN · ONSITE INTERVIEW
- Meeting Rooms IIWalmart · PHONE SCREENWalmart interview questions
- Earliest Common Meeting SlotAdobe · PHONE SCREENAdobe interview questions
- Most Employees Working at OnceCitadel · OACitadel interview questions
- Minimum Machines for TasksExpedia · OAExpedia interview questions
- Intersect Multiple Interval ListsGoogle · ONSITE INTERVIEWGoogle interview questions
- Merge IntervalsApple · OA · PHONE SCREEN · ONSITE INTERVIEWApple interview questions
- Merge Sorted Squares of Two ArraysWhatNot · PHONE SCREEN · ONSITE INTERVIEWWhatNot interview questions
- Merge Overlapping IntervalsAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
- Peak Chat Load Across AgentsCresta · PHONE SCREENCresta interview questions