Minimum Meeting Rooms
Updated
Problem statement
Each row [start, end] in meetings describes a meeting that occupies one room during the half-open interval [start, end). Every meeting must take place at its given time.
Complete minMeetingRooms. Return the minimum number of identical rooms needed so that no two overlapping meetings use the same room. A room becomes available at the exact ending time of its meeting; a meeting ending at time t may share a room with one starting at t.
Input order is arbitrary. Duplicate rows represent distinct meetings. There are no room locations, travel times, setup delays, capacities, or restrictions on reusing a room. Return 0 when the input is empty.
Function
minMeetingRooms(meetings: int[][]) → intExamples
Example 1
meetings = [[0,30],[5,10],[15,20]]return = 2The long meeting overlaps each shorter one, while the shorter meetings may share a second room.
Example 2
meetings = [[7,10],[2,4]]return = 1The meetings do not overlap, regardless of their input order.
Example 3
meetings = [[1,2],[2,3],[3,4]]return = 1An ending meeting releases its room before another starts at that same time.
Constraints
0 <= meetings.length <= 200.- Every row contains exactly two integers with
0 <= start < end <= 1000000. - Meetings cannot be moved or shortened. The result is an integer room count.
More Snowflake Phone Screen questions
- Minimum StackPHONE SCREEN · Seen Nov 2026
- Design In-Memory File SystemPHONE SCREEN · Seen Nov 2026
- Merge Two Binary TreesPHONE SCREEN · Seen Nov 2026
- Connect Four from the Last MovePHONE SCREEN · Seen Nov 2026
- Minimum Edits to a Perfect Binary TreePHONE SCREEN · Seen Nov 2026
- Configurable Per-Client Token BucketsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Find Valid SET Card TriplesOA · PHONE SCREEN · Seen Nov 2026
- Minimum Index Distance Between Person and CakeOA · PHONE SCREEN · Seen Nov 2026
- Minimum N-ary Tree Depth DeletionsOA · PHONE SCREEN · Seen Nov 2026
- Sum of Binary Tree Boundary NodesOA · PHONE SCREEN · Seen Nov 2026
Similar questions at other companies
- Minimum Cars for Rental RequestsGoogle · OA · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
- Merge IntervalsApple · OA · PHONE SCREEN · ONSITE INTERVIEWApple interview questions
- Merge Overlapping IntervalsAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
- Peak Chat Load Across AgentsCresta · PHONE SCREENCresta interview questions
- Maximum Concurrent Processes (Bar Raiser Round)Amazon · PHONE SCREEN · ONSITE INTERVIEW
- Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
- Minimum Rooms for Meeting IntervalsOYO Rooms · PHONE SCREEN
- Meeting Rooms IIByteDance · PHONE SCREENByteDance interview questions
- Majority Labels over Audio IntervalsNooks · PHONE SCREEN
- Meeting Rooms IIUber · PHONE SCREENUber interview questions