FastPrepMeeting Rooms II
Problems/Meeting Rooms II

Meeting Rooms II

Salesforce logoSalesforce● MediumFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The candidate said they did not remember the exact problem, but it was similar to Meeting Rooms II.

The report gives no rules, examples, or limits. It does not say whether or how the real question differed from Meeting Rooms II. Here, you solve the usual Meeting Rooms II task. A room freed at time t can host a meeting that starts at t, and the meetings can come in any order.

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

You are given an array of meetings, intervals, where intervals[i] = [starti, endi]. Return the minimum number of rooms needed so that every meeting has a room for its whole time.

A meeting uses its room from starti up to, but not including, endi. So a room freed at time t can host a meeting that starts at t. The meetings can come in any order.

Function

minMeetingRooms(intervals: int[][]) → int

Examples

Example 1

intervals = [[1,8],[2,4],[5,9]]return = 2

The meeting [1,8] overlaps both others, so it needs its own room. [2,4] ends before [5,9] starts, so those two can share a second room.

Example 2

intervals = [[5,9],[2,5]]return = 1

The first meeting to run, [2,5], ends at time 5, just as [5,9] starts. The room is free at that moment, so one room is enough. The input is not sorted.

Example 3

intervals = [[1,4],[2,5],[3,6],[7,8]]return = 3

At time 3, the meetings [1,4], [2,5] and [3,6] are all running, so three rooms are needed. By time 7 they have all ended, so [7,8] can reuse a room.

Example 4

intervals = [[4,6]]return = 1

One meeting needs one room.

Constraints

  • 1 <= intervals.length <= 10^4
  • intervals[i].length == 2
  • 0 <= starti < endi <= 10^6

More Salesforce Onsite Interview questions

  • Count Increasing TripletsONSITE INTERVIEW · Seen Nov 2026
  • Longest Substring Without Repeating CharactersONSITE INTERVIEW · Seen Nov 2026
  • Reverse a Sublist of a Linked ListONSITE INTERVIEW · Seen Nov 2026
  • Rotting OrangesONSITE INTERVIEW · Seen Nov 2026
  • 3Sum SmallerONSITE INTERVIEW · Seen Nov 2026
  • Count Zero Request ServersONSITE INTERVIEW · Seen Nov 2026
  • Construct a Tree from Level-Order and Inorder TraversalsONSITE INTERVIEW · Seen Sep 2026
  • Maximize Monsters DefeatedONSITE INTERVIEW · Seen Sep 2026
  • Flatten Nested Map Paths with a StackONSITE INTERVIEW · Seen Sep 2026
  • LFU CacheONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Generate Complete Inputs for a Supplied ClassifierGeneral Motors · ONSITE INTERVIEW
  • Meeting Rooms IIAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Minimum Workers with Job AssignmentsLyft · ONSITE INTERVIEWLyft interview questions
  • Minimum Classrooms for CoursesGoogle · ONSITE INTERVIEWGoogle interview questions
  • Merge K Sorted Interval ListsBloomberg LP · ONSITE INTERVIEWBloomberg LP interview questions
  • Employee Free TimeIDFC Bank · ONSITE INTERVIEWIDFC Bank interview questions
  • Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
  • Meeting Rooms IIByteDance · PHONE SCREENByteDance interview questions
  • Minimum Meeting RoomsJP Morgan Chase · OAJP Morgan Chase interview questions
  • Maximum Number of Events That Can Be AttendedSnowflake · PHONE SCREENSnowflake interview questions

Salesforce interview experiences

  • Salesforce Infrastructure SWE OA and Onsite: 1 Experience
  • Salesforce Experienced Backend SWE First Round: 1 Experience
All Salesforce interview questionsSee Salesforce hiring insights
Saved
class Solution {
    public int minMeetingRooms(int[][] intervals) {
        // Write your code here.
    }
}
Checking account…