PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Atlassian

Merge overlapping intervals

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of interval manipulation, array processing, and algorithmic efficiency by requiring reasoning about overlapping ranges and proper handling of edge cases.

  • medium
  • Atlassian
  • Coding & Algorithms
  • Software Engineer

Merge overlapping intervals

Company: Atlassian

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Given an array of closed intervals `intervals`, where each interval is `[start, end]` and `start <= end`, merge all overlapping intervals and return an array of the merged, non-overlapping intervals sorted by start time. Two intervals `[a, b]` and `[c, d]` overlap if `c <= b` (assuming `a <= c`). #### Input - `intervals`: list of `n` intervals #### Output - A list of merged intervals. #### Example Input: `[[1,3],[2,6],[8,10],[15,18]]` Output: `[[1,6],[8,10],[15,18]]` #### Constraints - `1 ≤ n ≤ 10^5` - Interval endpoints fit in 32-bit integers.

Quick Answer: This question evaluates understanding of interval manipulation, array processing, and algorithmic efficiency by requiring reasoning about overlapping ranges and proper handling of edge cases.

Related Interview Questions

  • Compute a moving average on a stream - Atlassian (hard)
  • Find a secret word using match feedback - Atlassian (hard)
  • Implement sliding-window rate limiter function - Atlassian (medium)
  • Merge intervals and design rating APIs - Atlassian (medium)
  • Implement sequential and parallel URL requests - Atlassian (medium)
Atlassian logo
Atlassian
Jan 22, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
4
0
Loading...

Given an array of closed intervals intervals, where each interval is [start, end] and start <= end, merge all overlapping intervals and return an array of the merged, non-overlapping intervals sorted by start time.

Two intervals [a, b] and [c, d] overlap if c <= b (assuming a <= c).

Input

  • intervals : list of n intervals

Output

  • A list of merged intervals.

Example

Input: [[1,3],[2,6],[8,10],[15,18]]

Output: [[1,6],[8,10],[15,18]]

Constraints

  • 1 ≤ n ≤ 10^5
  • Interval endpoints fit in 32-bit integers.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Atlassian•More Software Engineer•Atlassian Software Engineer•Atlassian Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.