Data Structures & AlgorithmsHardGATE CS · TCS NQT

Meetings are [0,30), [5,10), [15,20), [35,45), [40,50). A meeting ending at time t and another starting at t can share a room. What is the minimum number of rooms?

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

Correct answer: B. 2

The answer is the maximum number of meetings active at any moment, found by a sweep. Here [0,30) overlaps with [5,10) and [15,20) at once, giving two rooms at a time, and the later pair does not raise the maximum above two.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic