Meeting Rooms Allocation Problem Statement

Stark Industry is planning to organize meetings for various departments in preparation for Stark Expo. Due to limited rooms in Stark Tower, the goal is to allocate meeting rooms such that all meetings are organized using the minimum number of conference rooms, ensuring that at any given moment, only one meeting occupies a room. Your task is to help JARVIS, who is preoccupied, by determining the minimum number of conference rooms required.

Explanation:

You are provided with an array ARR of size N x 2, where each pair represents the start and end time for N meetings. Compute the minimum number of rooms needed to conduct all meetings.

Input:

The format is as follows: The first line contains an integer 'T' indicating the number of test cases. For each test case, the input includes: 
 - An integer 'N' that denotes the number of meetings. 
 - A second line with 'N' space-separated integers for the start times of these meetings. 
 - A third line with 'N' space-separated integers for the end times of these meetings.

Output:

Output a single integer for each test case, representing the minimum number of conference rooms required. Each output should be on a new line for different test cases.

Example:

Consider the following meeting schedules: 
1pm - 4pm
3pm - 5pm
4pm - 6pm
For these schedules:
- Meeting 1 takes room 1 until 4pm.
- Meeting 2 needs a separate room as it starts at 3pm.
- Meeting 3 can use room 1 after meeting 1 concludes at 4pm.
Thus, a minimum of 2 rooms are required.

Constraints:

  • 1 <= T <= 100
  • 1 <= N <= 1000
  • 0000 <= INTERVAL[start][end] <= 2359
  • Ensure solutions strive for linear time complexity.

Note:

All meetings are assumed to occur on the same day. If a meeting's starting time coincides with another's ending time, it can proceed in the same room.
AnswerBot
4mo

Determine the minimum number of conference rooms needed to schedule meetings without overlap.

  • Sort the meetings by start time.

  • Iterate through the meetings and keep track of the rooms in use.

  • If a meetin...read more

Help your peers!
Select
Add answer anonymously...

Urban Company Software Developer interview questions & answers

A Software Developer was asked 9mo agoQ. What is a thread?
A Software Developer was asked 10mo agoQ. You are given an array of prices where prices[i] is the price of a given stock o...read more
A Software Developer was asked 10mo agoQ. Given a sorted array of integers nums and an integer target, write a function th...read more

Popular interview questions of Software Developer

A Software Developer was asked 9mo agoQ1. What is a thread?
A Software Developer was asked 10mo agoQ2. You are given an array of prices where prices[i] is the price of a given stock o...read more
A Software Developer was asked 10mo agoQ3. Given a sorted array of integers nums and an integer target, write a function th...read more
Urban Company Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits