Data Structures & AlgorithmsHardProduct company OA · Amazon/Microsoft-style OA

Meetings (closed-open as half-open intervals) are [1,4), [1,4), [2,6), [5,8), [3,9), [7,10). A room can be reused the moment a meeting ends. What is the minimum number of rooms?

  1. A. 5
  2. B. 4
  3. C. 3
  4. D. 6

Correct answer: B. 4

A sweep over start and end events, processing ends before starts at equal times, gives the peak number of simultaneous meetings. Two identical meetings both count, so duplicates must not be merged.

More Coding Interview Problems questions

Exams that ask this topic