Minimum Meeting Rooms
Updated
Problem statement
You are given meeting intervals [start, end]. Return the minimum number of rooms needed to hold every meeting without overlapping meetings in the same room.
Each interval is half-open: it includes its start and excludes its end. A meeting ending at time t may share a room with another starting at t. Input order is arbitrary; duplicate intervals represent separate meetings. Return 0 for no meetings.
Function
minMeetingRooms(intervals: int[][]) → intExamples
Example 1
intervals = [[0,30],[5,10],[15,20]]return = 2The long meeting overlaps each shorter meeting; the shorter meetings share a second room.
Example 2
intervals = [[7,10],[2,4]]return = 1The meetings do not overlap.
Example 3
intervals = [[1,3],[3,5],[5,8]]return = 1A room is reusable exactly at its previous meeting end.
Constraints
0 <= intervals.length <= 100000.- Each row contains exactly two integers.
0 <= start < end <= 10^9.
More Oracle Onsite Interview questions
- Course ScheduleONSITE INTERVIEW · Seen Nov 2026
- Shortest Subarray with Sum at Least KONSITE INTERVIEW · Seen Nov 2026
- Longest Substring Without Repeating CharactersONSITE INTERVIEW · Seen Nov 2026
- Shortest Window with Required CountsONSITE INTERVIEW · Seen Nov 2026
- Maximum Subarray Sum with One DeletionONSITE INTERVIEW · Seen Nov 2026
- Shortest Deletion for Distinct CharactersONSITE INTERVIEW · Seen Nov 2026
- Count Dropped Rate-Limited RequestsONSITE INTERVIEW · Seen Nov 2026
- Design Authentication ManagerONSITE INTERVIEW · Seen Oct 2026
- Maximum Bouquet ValueONSITE INTERVIEW · Seen Oct 2026
- Cache an Expensive Service Across ThreadsONSITE INTERVIEW · Seen Oct 2026
Similar questions at other companies
- Top K Frequent ElementsAmazon · OA · PHONE SCREEN · ONSITE INTERVIEW
- Mutual-Friend RecommendationsMeta · PHONE SCREEN · ONSITE INTERVIEW
- Tennis Court SchedulingAtlassian · PHONE SCREEN · ONSITE INTERVIEW
- Top K Frequent WordsBloomberg LP · ONSITE INTERVIEW
- Retrieve Vectors by Cosine SimilarityHarvey · ONSITE INTERVIEW
- Finish Time of Fixed-Length CPU TasksGoogle · PHONE SCREEN · ONSITE INTERVIEW
- Meeting Rooms IISalesforce · ONSITE INTERVIEW
- Top K Largest Values from a StreamThe D.E. Shaw Group · ONSITE INTERVIEW
- Generate Complete Inputs for a Supplied ClassifierGeneral Motors · ONSITE INTERVIEW
- Minimum Meeting Rooms with AssignmentsUber · PHONE SCREEN · ONSITE INTERVIEW