Atlassian Interview Question: Merge Overlapping CI Intervals (Merge Intervals Problem)

23 Views
No Comments

Problem – Merge Overlapping CI Intervals

Atlassian runs many CI pipelines, and we want to generate reports on usage to find cost-optimization patterns.

Each CI pipeline starts at time X and ends at time Y. We are given a list of pipeline time windows:

[[X₁, Y₁], [X₂, Y₂], ...]

Objective

Find the list of non-overlapping time intervals that cover all times when at least one CI pipeline is running.

In other words, merge all overlapping intervals and return the minimal set of disjoint intervals.

Example

Input:
[[2, 5], [12, 15], [4, 8]]

Output:
[[2, 8], [12, 15]]

Explanation:

  • [2, 5] and [4, 8] overlap and merge into [2, 8].
  • [12, 15] does not overlap with them, so it stays as is.
  • The minimal windows where at least one job is running are [2, 8] and [12, 15].

The VOprep team has long accompanied candidates through various major company OAs and VOs, including Meta, Amazon, Citadel, SIG, providing real-time voice assistance, remote practice, and interview pacing reminders to help you stay smooth during critical moments. If you are preparing for these companies, you can check out our customized support plans—from coding interviews to system design, we offer full guidance to help you succeed.

END
 0