Union / Merge of Two Sorted Interval Lists
Given two sorted lists of non-overlapping intervals (A and B), return a new sorted list representing the union of both interval lists. Any overlapping or adjacent intervals from the two lists should be merged into a single combined interval in the output. The result should be a minimal set of non-overlapping intervals covering all ranges from both input lists.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early April, 2026
Meta
Staff
Given two lists of intervals, both sorted and non-overlapping individually, return a list which is the union of the two intervals. Example A - [[1,2], [4,6], [7,10]] B - [[3,5], [6,9], [11,15]] Then the expected output is [[1,2], [3,10],[11,15]]
Early December, 2025
Meta
Staff
Mid November, 2025
Meta
Mid-level
Given A and B two interval lists, A has no overlap inside A and B has no overlap inside B. Write the function to merge two interval lists, output the result with no overlap. For example, A: [1,5], [10,14], [16,18] B: [2,6], [8,10], [11,20]
Hello Interview Premium
Your account is free and you can post anonymously if you choose.