Maximum Meetings Problem Statement

Given the schedule of N meetings with their start time Start[i] and end time End[i], you need to determine which meetings can be organized in a single meeting room such that the total number of organized meetings is maximized.

Input:

The first line contains an integer 'T' representing the number of test cases.
For each test case:
- The first line contains an integer 'N' denoting the number of meetings.
- The second line contains N space-separated integers denoting the start times of the meetings.
- The third line contains N space-separated integers denoting the end times of the meetings.

Output:

For each test case, return the meeting numbers (1-based indexing) that can be organized in the room maximizing the number of meetings. The meetings should be returned in the order they are organized.

Example:

Suppose there is 1 test case with 3 meetings where:

Input:

N = 3
Start = [1, 2, 3]
End = [2, 3, 4]

Output:

[1, 2, 3]

Explanation: All meetings can be organized consecutively without overlap.

Constraints:

  • 1 <= T <= 5
  • 1 <= N <= 105
  • 0 <= Start[i] < End[i] <= 109
  • Time Limit: 1 sec

Note:

The start time of one chosen meeting cannot be equal to the end time of another chosen meeting. For meetings ending at the same time, the one with a smaller index is preferred.

AnswerBot
4mo

Given N meetings with start and end times, find the maximum number of meetings that can be organized in a single room without overlap.

  • Sort the meetings based on their end times.

  • Iterate through the sor...read more

Help your peers!
Select
Add answer anonymously...

Nagarro Software Developer interview questions & answers

A Software Developer was asked 8mo agoQ. Explain Kafka and how you would implement it.
A Software Developer was asked 9mo agoQ. Is the directory a file?
A Software Developer was asked 9mo agoQ. What is memory segmentation?

Popular interview questions of Software Developer

A Software Developer was asked 8mo agoQ1. Explain Kafka and how you would implement it.
A Software Developer was asked 9mo agoQ2. Is the directory a file?
A Software Developer was asked 9mo agoQ3. What is memory segmentation?
Nagarro 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