Meeting Rooms II
Updated
Problem statement
Given an array of meeting time intervals consisting of start and end times [[start_1, end_1], [start_2, end_2], ...] where start_i < end_i, find the minimum number of meeting rooms required to schedule all meetings without any conflicts.
Intervals are half-open: a meeting that ends exactly when another begins does not conflict. For example, (0, 8) and (8, 10) are not considered a conflict at time 8 and can share a room.
A common approach sorts the start and end times (or uses a min-heap of meeting end times): sweep the events in time order, and track the maximum number of meetings that are simultaneously in progress, which is the number of rooms required.
Function
minMeetingRooms(intervals: int[][]) → intExamples
Example 1
intervals = [[0, 40], [5, 10], [15, 20]]return = 2Room 1 holds (0, 40). Room 2 holds (5, 10) and then (15, 20), which do not overlap each other. The meeting (0, 40) overlaps both of the others, so a second room is required, giving 2 rooms total.
Example 2
intervals = [[4, 9]]return = 1There is a single meeting, so exactly one room is needed.
Example 3
intervals = [[0, 8], [8, 10]]return = 1The first meeting ends at 8 exactly when the second begins. Half-open intervals do not conflict at the shared endpoint, so both fit in a single room.
Constraints
0 <= intervals.length <= 500intervals[i].length == 20 <= intervals[i][0] < intervals[i][1] <= 1000000- An interval that ends exactly when another starts does not count as a conflict.
More Roblox Phone Screen questions
- Most Frequent Call Path From Function Trace LogsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Design Search Autocomplete SystemPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Candy Crush Grid Matching and GravityPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Implement a Rate LimiterPHONE SCREEN · Seen Oct 2026
- Rate Limit by Multiple Request FieldsPHONE SCREEN · Seen Oct 2026
- Topological Sort with Secondary OrderingPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Time-Aware Search AutocompletePHONE SCREEN · Seen Oct 2026
- Most Frequent Call Stack Per ThreadPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Rate Limiter Sliding Window With Per-Entity LimitsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
- Closest Binary Search Tree Value — Base PracticePHONE SCREEN · Seen Jun 2026
Similar questions at other companies
- Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
- Meeting Rooms IIByteDance · PHONE SCREENByteDance interview questions
- Meeting Rooms IIAmazon · PHONE SCREEN · ONSITE INTERVIEW
- Maximum Number of Events That Can Be AttendedSnowflake · PHONE SCREENSnowflake interview questions
- Minimum CPUs for Fixed-Duration JobsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
- Fewest Rooms for All MeetingsAdobe · PHONE SCREENAdobe interview questions
- Minimum Meeting RoomsSentry · PHONE SCREENSentry interview questions
- Meeting Rooms IISalesforce · ONSITE INTERVIEWSalesforce interview questions
- Minimum Meeting RoomsJP Morgan Chase · OAJP Morgan Chase interview questions
- Generate Complete Inputs for a Supplied ClassifierGeneral Motors · ONSITE INTERVIEW
Roblox interview experiences
- Roblox OA: What It Tests (2026)
- Roblox New Grad Early OA Tasks: 10 Experiences (Part 7 of 7)
- Roblox New Grad Engineer Rounds: 13 Experiences (Part 6 of 7)
- Roblox New Grad HackerRank OA: 18 Experiences (Part 5 of 7)
- Roblox New Grad CodeSignal Finals: 23 Experiences (Part 4 of 7)
- Roblox New Grad Games and BQ: 25 Experiences (Part 3 of 7)