FastPrepMinimum Meeting Rooms
Problems/Minimum Meeting Rooms

Minimum Meeting Rooms

Sentry logoSentry● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A report from February 2022 on a Sentry software engineer interview lists a meeting-rooms problem among its coding questions. It does not say which version was asked or in which round (the process had a phone screen and an onsite).

This version asks for the fewest rooms needed to hold every meeting. The rule that a meeting ending at time t frees its room for one starting at t, the input format and the limits are our choices.

Our version is about 60% the same as the reported question.

You are given an array intervals where intervals[i] = [starti, endi] is the time range of meeting i. The meetings can be listed in any order.

A meeting holds its room from starti up to, but not including, endi. So if one meeting ends at time t and another starts at time t, they can use the same room.

Return the minimum number of rooms needed so that every meeting can take place.

Function

minMeetingRooms(intervals: int[][]) → int

Examples

Example 1

intervals = [[0,30],[5,10],[15,20]]return = 2

Meeting [0,30] runs the whole time. Meeting [5,10] starts while it is still running, so it needs a second room. Meeting [15,20] starts after [5,10] has ended, so it can use that second room. Two rooms are enough, so the answer is 2.

Example 2

intervals = [[7,10],[2,4]]return = 1

Meeting [2,4] ends before meeting [7,10] starts. They never overlap, so one room is enough. The answer is 1.

Example 3

intervals = [[1,5],[5,10],[10,15]]return = 1

Each meeting starts at the exact time the previous one ends. A room that is freed at time 5 can be used by a meeting that starts at time 5, and the same at time 10. So all three meetings fit in one room, and the answer is 1.

Constraints

  • 1 <= intervals.length <= 104
  • intervals[i].length == 2
  • 0 <= starti < endi <= 106

More Sentry interview questions

  • Word Wrap with Even JustificationOA · PHONE SCREEN · Seen Dec 2025
  • Find All Word Occurrences in TextPHONE SCREEN · Seen Mar 2023
  • Five-Minute Hit CounterPHONE SCREEN · ONSITE INTERVIEW · Seen Aug 2022
  • Wildcard Bad-Word FilterOA · Seen Aug 2022

Similar questions at other companies

  • Maximum Number of Events That Can Be AttendedSnowflake · PHONE SCREENSnowflake interview questions
  • Minimum Workers with Job AssignmentsLyft · ONSITE INTERVIEWLyft interview questions
  • Tennis Court SchedulingAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
  • Maximum Number of Events That Can Be AttendedByteDance · PHONE SCREENByteDance interview questions
  • Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
  • Meeting Rooms IIAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Minimum Appointment Cancellations with a Required BreakMaven Clinic · PHONE SCREENMaven Clinic interview questions
  • Meeting Rooms IIRoblox · PHONE SCREENRoblox interview questions
  • Minimum CPUs for Fixed-Duration JobsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Schedule Unit-Time Jobs for the Most ProfitScale AI · PHONE SCREENScale AI interview questions

Interview reports that mention this question

  • Sentry Software Engineer Interview Questions: 18 Experiences

Sentry interview experiences

  • Sentry Experienced Engineer Interviews: 14 Experiences
  • Sentry SWE Intern OA and Technical Interview: 16 Experiences
  • Sentry SWE New Grad OA and Technical Screen: 12 Experiences
All Sentry interview questionsSee Sentry hiring insights
Saved
class Solution {
    public int minMeetingRooms(int[][] intervals) {
        // Write your code here.
    }
}
Checking account…