Skip to main content
All Questions

Minimum meeting rooms.

Medium
Unlock detailed company stats for this questionUpgrade

Given an array of meeting times intervals, where intervals[i] = [start, end], return the minimum number of conference rooms needed so that every meeting can take place. A meeting that ends at time t frees its room for a meeting that starts at time t.

Example 1

Input: intervals = [[0, 30], [5, 10], [15, 20]] Output: 2

The meeting from 0 to 30 needs its own room. The other two can share a second room.

Example 2

Input: intervals = [[7, 10], [2, 4]] Output: 1

Constraints

  • 1 <= intervals.length <= 10^4
  • intervals[i].length == 2
  • 0 <= start < end <= 10^6

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.