FastPrepFewest Rooms for All Meetings
Problems/Fewest Rooms for All Meetings

Fewest Rooms for All Meetings

Adobe logoAdobe● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: You count the fewest rooms that can hold a list of meetings. A post by an engineer with a little over three years of experience describes Adobe interviews in Noida (August 2022, no result given). It opens the first round with this task, which the author files under interval merging. It shows one sample list of five meetings with its answer. The post gives no limits. It does not say whether a meeting that ends when another starts can share its room.

We chose these rules. A meeting [start, end] uses its room up to but not including end, so back-to-back meetings share a room. There are 1 to 5000 meetings, with times from 0 to 10^9. We wrote new examples instead of using the post's sample.

Our version is about 90% the same as the reported question.

You are given a list of meetings, where meetings[i] = [start, end]. A meeting uses its room from time start up to, but not including, time end, so a meeting that ends at time t frees its room for a meeting that starts at time t.

Two meetings that run at the same moment need different rooms. Return the fewest rooms needed to hold all the meetings. The meetings are given in no particular order.

Function

fewestRooms(meetings: int[][]) → int

Examples

Example 1

meetings = [[9,12],[1,5],[4,10],[11,13]]return = 2

The meetings overlap two at a time and never three: [1,5] with [4,10] during 4 to 5, [4,10] with [9,12] during 9 to 10, and [9,12] with [11,13] during 11 to 12. Two rooms are enough, and two are needed.

Example 2

meetings = [[0,10],[10,20],[20,30]]return = 1

Each meeting ends exactly when the next one starts. A meeting that ends at 10 frees its room for a meeting that starts at 10, so one room is enough.

Example 3

meetings = [[1,100],[10,20],[30,40],[15,35]]return = 3

From 15 to 20, the meetings [1,100], [10,20] and [15,35] all run at once, so at least 3 rooms are needed. No moment has four meetings, so the answer is 3.

Constraints

  • 1 <= meetings.length <= 5000
  • meetings[i].length == 2
  • 0 <= start < end <= 10^9 for every meeting [start, end]

More Adobe Phone Screen questions

  • Evaluate a Parenthesized Integer ExpressionPHONE SCREEN · Seen Oct 2026
  • All Elements of Two BSTs in OrderPHONE SCREEN · Seen Aug 2026
  • Rotate an Array In PlaceOA · PHONE SCREEN · Seen Aug 2026
  • Binary Tree Level-Order Traversal by LevelsPHONE SCREEN · ONSITE INTERVIEW · Seen Aug 2026
  • Count Occurrences in a Sorted ArrayPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2026
  • Count Pairs with Absolute Difference KPHONE SCREEN · Seen Jul 2026
  • Count Subsets with Sum KPHONE SCREEN · Seen Jul 2026
  • Numbers with Exactly Three DivisorsPHONE SCREEN · Seen Jul 2026
  • Sum of Even Nodes on a Path in a Numbered Binary TreePHONE SCREEN · Seen Jul 2026
  • Largest Value in Every Sliding WindowPHONE SCREEN · Seen Jul 2026

Similar questions at other companies

  • Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
  • Meeting Rooms IIByteDance · PHONE SCREENByteDance interview questions
  • Meeting Rooms IIAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Maximum Number of Events That Can Be AttendedSnowflake · PHONE SCREENSnowflake interview questions
  • Meeting Rooms IIRoblox · PHONE SCREENRoblox interview questions
  • Minimum CPUs for Fixed-Duration JobsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Minimum Meeting RoomsSentry · PHONE SCREENSentry interview questions
  • Minimum Meeting RoomsJP Morgan Chase · OAJP Morgan Chase interview questions
  • Generate Complete Inputs for a Supplied ClassifierGeneral Motors · ONSITE INTERVIEW
  • Meeting Rooms IISalesforce · ONSITE INTERVIEWSalesforce interview questions

Interview reports that mention this question

  • Adobe SDE and Senior SWE Interviews: 9 Experiences (Part 3 of 6)

Adobe interview experiences

  • Adobe Web, QA, DevOps, ML Roles: 13 Experiences (Part 3 of 3)
  • Adobe SWE Interviews, Level Unknown: 25 Experiences (Part 2 of 3)
  • Adobe Interviews, Level Unknown: 38 Experiences (Part 1 of 3)
  • Adobe New Grad MTS Interview Questions: 7 Experiences
  • Adobe ML/Research Intern Interviews: 12 Experiences (Part 4 of 4)
All Adobe interview questionsSee Adobe hiring insights
Saved
class Solution {
    public int fewestRooms(int[][] meetings) {
        // Write your code here.
    }
}
Checking account…