Meeting Room Request Feasibility
Updated
Problem statement
A single meeting room receives a list of requests. Each request is a half-open time interval [start,end): the room is occupied at start and is free again at end.
Return true if that one room can satisfy every request, or false otherwise. Requests may be given in any order. A meeting may start exactly when another meeting ends. An empty list can be satisfied.
Function
canSatisfyRequests(requests: int[][]) → booleanExamples
Example 1
requests = [[0,10],[10,20],[5,8]]return = falseThe requests [0,10) and [5,8) overlap from time 5 to time 8. One room cannot serve both.
Example 2
requests = [[10,20],[0,10]]return = trueThe first meeting ends at time 10, exactly when the other begins. The half-open intervals do not overlap.
Constraints
- 0 <= requests.length <= 10^4.
- Every request contains exactly two integers.
- Every endpoint is between 0 and 10^9, inclusive.
- For every request, start is strictly less than end.
More Apple Phone Screen questions
- Subarray Product Less Than KPHONE SCREEN · Seen Nov 2026
- Evaluate DivisionPHONE SCREEN · Seen Nov 2026
- Reverse a Linked ListPHONE SCREEN · Seen Nov 2026
- Validate a BST with a Custom ComparisonPHONE SCREEN · Seen Nov 2026
- Design a Food Rating SystemPHONE SCREEN · Seen Oct 2026
- Days Until Poisoned Plants StabilizePHONE SCREEN · Seen Oct 2026
- Capture Surrounded Regions with Union-FindPHONE SCREEN · Seen Oct 2026
- Maintain a Consistent-Hashing RingPHONE SCREEN · Seen Oct 2026
- Count Nodes in a ChainPHONE SCREEN · Seen Oct 2026
- Run-Length DecodingPHONE SCREEN · Seen Oct 2026
Similar questions at other companies
- Total Years of Work ExperienceLinkedIn · PHONE SCREENLinkedIn interview questions
- Meeting RoomsByteDance · PHONE SCREENByteDance interview questions
- Meeting RoomsGoldman Sachs · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions
- Meeting RoomsChainalysis · PHONE SCREENChainalysis interview questions
- Merge Overlapping IntervalsAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
- Peak Chat Load Across AgentsCresta · PHONE SCREENCresta interview questions
- Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
- Majority Labels over Audio IntervalsNooks · PHONE SCREEN
- Meeting Rooms IIUber · PHONE SCREENUber interview questions
- Merge IntervalsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
Apple interview experiences
- Apple SWE Phone Screen: Subarray Products: 1 Experience
- Apple New Grad SWE Java, Coding and Manager Rounds: 1 Experience
- Apple AI Coding and Related Interviews: 17 Experiences
- Apple India SWE New Grad Interviews: 5 Experiences
- Apple New Grad SWE Phone Screens: 12 Experiences (Part 3 of 3)
- Apple New Grad SWE and Embedded: 16 Experiences (Part 2 of 3)