FastPrepMaximum Concurrent Processes (Bar Raiser Round)
Problems/Maximum Concurrent Processes (Bar Raiser Round)

Maximum Concurrent Processes (Bar Raiser Round)

Amazon logoAmazon● MediumFULLTIMEPHONE SCREENONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Both ends of an interval count, so two intervals that only touch, such as [1, 3] and [3, 6], overlap at time 3. The task is a variant of Meeting Rooms II and can be solved with a sweep line.

You are given a list of processes. Each process has a running interval represented as [start, end].

A process is considered running at every integer time from start through end, inclusive.

Return the maximum number of processes running at the same time.

Function

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

Complete the function maxConcurrentProcesses in the editor.

maxConcurrentProcesses has the following parameter:

  • int intervals[n][2]: each interval is [start, end], where start <= end.

Returns int: the maximum number of processes running concurrently at any time.

Follow-up

How would your answer change if each interval were half-open, meaning [start, end), where the process stops running before end?

Examples

Example 1

intervals = [[1, 3], [2, 5], [3, 6]]return = 3

At time 3, all three processes are running. Since intervals are inclusive, both [1, 3] and [3, 6] include time 3.

Example 2

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

No two processes overlap, so the maximum number of concurrent processes is 1.

Example 3

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

The long-running process overlaps with each shorter process, but the shorter processes do not overlap with one another.

Example 4

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

At time 4, [1, 4], [2, 6], and [4, 8] are all running because interval endpoints are inclusive.

Constraints

  • 1 <= intervals.length <= 100000
  • 0 <= start <= end <= 1000000000
  • All start and end values are integers.
  • Intervals are inclusive: [start, end].

Source note: Author-written prompt excerpt retained for source fidelity.

More Amazon Onsite Interview questions

  • LRU Cache for Query ResultsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Maximal SquareONSITE INTERVIEW · Seen Nov 2026
  • Serialize and Deserialize a Binary TreeONSITE INTERVIEW · Seen Nov 2026
  • Course SchedulePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Course Schedule IIPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Diagonal Traversal of a Binary TreeONSITE INTERVIEW · Seen Nov 2026
  • Minimum Time to Spread Through a GridPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Optimal Account BalancingONSITE INTERVIEW · Seen Nov 2026
  • Task SchedulerOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Number of IslandsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Merge Overlapping IntervalsAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
  • Peak Chat Load Across AgentsCresta · PHONE SCREENCresta interview questions
  • Finish Time of Fixed-Length CPU TasksGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Meeting Scheduling SystemHevo Data · ONSITE INTERVIEW
  • Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
  • Maximum Intervals Overlapping a Fixed-Length WindowBooking.com · ONSITE INTERVIEW
  • Minimum Rooms for Meeting IntervalsOYO Rooms · PHONE SCREEN
  • Meeting Rooms IIByteDance · PHONE SCREENByteDance interview questions
  • Majority Labels over Audio IntervalsNooks · PHONE SCREEN
  • Meeting Rooms IISalesforce · ONSITE INTERVIEWSalesforce interview questions

Interview reports that mention this question

  • Amazon SDE II OA and Interviews: 10 Experiences (Part 1 of 2)

Amazon interview experiences

  • Amazon Experienced SDE Onsite Questions: 1 Experience
  • Amazon SDE Onsite Interview Questions: 9 Experiences
  • Amazon SDE II and L5 FDE Interview Questions: 4 Experiences
  • Amazon Full-Time OA Problems, Earlier Reports (Part 5 of 5)
  • Amazon Full-Time OA Problems, Recent Reports (Part 4 of 5)
See Amazon hiring insights
Saved
class Solution {
    public int maxConcurrentProcesses(int[][] intervals) {
      // write your code here
    }
}
Checking account…