Assign Meetings to the Minimum Number of Rooms

Last updated: August 16, 2026

Quick Overview

The question asks the candidate to determine the minimum number of meeting rooms required to accommodate a set of meetings based on their start and end times.

Uber
Coding & Algorithms
Software Engineer
Uber
August 16, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

3

0

19 solved


The question asks the candidate to determine the minimum number of meeting rooms required to accommodate a set of meetings based on their start and end times.

This question is commonly asked in coding interviews at Uber to assess a candidate's problem-solving skills and ability to work under time constraints. The interviewer is evaluating the candidate's understanding of algorithms, particularly those related to scheduling and resource allocation. The rapid pace of the interview reflects the company's emphasis on efficiency and the ability to handle additional requirements on the fly.

What the Interviewer Expects
  • Clearly outline the approach to solving the problem.
  • Implement an efficient algorithm to calculate the minimum number of rooms needed.
  • Discuss potential edge cases and how they are handled.
  • Be prepared to modify the solution based on additional requirements.
  • Explain the time and space complexity of the solution.
Key Topics to Cover
Greedy Algorithms
Heap Data Structures
Sorting
Time Complexity
Resource Allocation
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you modify your solution if meetings could overlap?
  • Can you explain how you would handle a scenario with very large input sizes?
  • What would be the impact of using a different data structure for this problem?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Approach

To solve the problem of assigning meetings to the minimum number of rooms, we can utilize a greedy algorithm combined with a min-heap. The idea is to sort the meetings by their start times and use a m...

Algorithm
  1. Sort the meetings by their start time.
  2. Initialize a min-heap to track the end times of meetings.
  3. Iterate through each meeting:
    • If the heap is not empty and the smallest end time is l...

Submit Your Answer
Markdown supported

Related Questions