FastPrepMerge Overlapping Intervals
Problems/Merge Overlapping Intervals

Merge Overlapping Intervals

Atlassian logoAtlassian● MediumFULLTIMEPHONE SCREENONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Atlassian full-time onsite interview. A firsthand report names a Merge Intervals problem. We chose the input limits and how the endpoints are worded. Our version is about 98% the same as the reported question.

Given a list of closed integer intervals, merge every pair that overlaps and return the disjoint merged intervals ordered by start coordinate.

Closed intervals that share an endpoint overlap, so [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.

Example 2

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

Closed intervals sharing endpoint 4 overlap.

Constraints

  • 0 <= intervals.length <= 100000.
  • Every interval has exactly two values and -10^9 <= start <= end <= 10^9.

More Atlassian interview questions

  • Tennis Court SchedulingPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Deterministic Word Guess SolverONSITE INTERVIEW · Seen Oct 2026
  • Generate Word Guess FeedbackONSITE INTERVIEW · Seen Oct 2026
  • Bounded Word Guess SolverONSITE INTERVIEW · Seen Oct 2026
  • Word Guess Feedback ColorsONSITE INTERVIEW · Seen Oct 2026
  • Implement a Rate LimiterPHONE SCREEN · Seen Oct 2026
  • Longest Consistent Activity StreakPHONE SCREEN · Seen Sep 2026
  • Music Player Operation SequencePHONE SCREEN · Seen Sep 2026
  • Underline Shortest Unique SubstringsPHONE SCREEN · Seen Aug 2026
  • Can a Dictionary Word Be Formed from Note Letters?PHONE SCREEN · Seen Feb 2026

Similar questions at other companies

  • Merge IntervalsApple · OA · PHONE SCREEN · ONSITE INTERVIEWApple interview questions
  • Peak Chat Load Across AgentsCresta · PHONE SCREENCresta interview questions
  • Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
  • Maximum Intervals Overlapping a Fixed-Length WindowBooking.com · ONSITE INTERVIEW
  • Meeting Rooms IIByteDance · PHONE SCREENByteDance interview questions
  • Majority Labels over Audio IntervalsNooks · PHONE SCREEN
  • Meeting Rooms IISalesforce · ONSITE INTERVIEWSalesforce interview questions
  • Generate Complete Inputs for a Supplied ClassifierGeneral Motors · ONSITE INTERVIEW
  • Meeting Rooms IIUber · PHONE SCREENUber interview questions
  • Merge IntervalsSafe Security · ONSITE INTERVIEW

Interview reports that mention this question

  • Atlassian MLE Phone Screen: Model Deployment Design: 1 Experience

Atlassian interview experiences

  • Atlassian Coding Screens and Karat: 3 Experiences (Part 2 of 2)
  • Atlassian Full Stack Interviews: 11 Experiences (Part 1 of 2)
All Atlassian interview questionsSee Atlassian hiring insights
Saved
class Solution {
    public int[][] mergeIntervals(int[][] intervals) {
        // Merge all overlapping closed intervals.
    }
}
Checking account…