FastPrepMerge Overlapping Intervals
Problems/Merge Overlapping Intervals

Merge Overlapping Intervals

FurtherAI logoFurtherAI● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report names the classic merge-intervals exercise, with no follow-up. We chose that intervals are closed so touching ends merge, the limits, the order, and the function signature.

Given a non-empty array of closed intervals, merge every pair of intervals that overlaps and return the non-overlapping merged intervals in ascending start order.

Intervals that touch at one endpoint overlap. For example, [1,4] and [4,5] merge into [1,5].

Function

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

Examples

Example 1

intervals = [[1,3],[2,6],[8,10],[15,18]]return = [[1,6],[8,10],[15,18]]

The first two intervals overlap and merge; the other intervals remain separate.

Example 2

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

Closed intervals that share endpoint 4 overlap.

Constraints

  • 1 <= intervals.length <= 10^5.
  • intervals[i].length == 2.
  • -10^9 <= intervals[i][0] <= intervals[i][1] <= 10^9.

More FurtherAI Phone Screen questions

  • Workflow Service OperationsPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • Merge Overlapping IntervalsAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
  • Peak Chat Load Across AgentsCresta · PHONE SCREENCresta interview questions
  • Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
  • Meeting Rooms IIByteDance · PHONE SCREENByteDance interview questions
  • Majority Labels over Audio IntervalsNooks · PHONE SCREEN
  • Meeting Rooms IIUber · PHONE SCREENUber interview questions
  • Merge IntervalsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Peak Resource Usage Across Weighted IntervalsTekion · PHONE SCREENTekion interview questions
  • Merge Overlapping IntervalsFox Corporation · PHONE SCREEN
  • Longest Uninterrupted Work BlockIntuit · PHONE SCREENIntuit interview questions
See FurtherAI hiring insights
Saved
class Solution {
    public int[][] mergeIntervals(int[][] intervals) {
        // Write your code here.
    }
}
Checking account…