Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Meeting Room Intervals

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Meeting Room Intervals. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Splunk teams schedule design reviews and incident retrospectives across shared conference rooms. Given meeting intervals, return the minimum number of rooms required so that no overlapping meetings use the same room.

Each interval is represented as [start, end], where start and end are integer timestamps. A meeting ending at time t does not overlap with a meeting starting at time t, so that room can be reused immediately.

Formal Specification

Implement min_meeting_rooms(intervals).

  • Input: A list of n intervals, where each interval is a two-element list [start, end] and start < end.
  • Output: An integer representing the minimum number of rooms required for all meetings.
  • The input list may be modified during processing.

Constraints

  • 0 <= intervals.length <= 10^4
  • Each interval contains exactly two integers
  • 0 <= start < end <= 10^9
  • Intervals may be provided in any order
  • A meeting ending at time t does not overlap a meeting starting at time t

Function Signature

def min_meeting_rooms(intervals):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output