Coding

Merge a New Interval

Merge a new interval into a list of non-overlapping intervals.

Input: intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]], newInterval = [4,8]

Output: [[1,2],[3,10],[12,16]]

Explanation: The new interval overlaps with [3,5], [6,7], and [8,10], merging them all into the unified block [3,10].

Was asked at

Practice this question with AI

First session is free - no credit card required.

Go Premium

More interviews, more skills, more success.

Community Answers

1 answer from the community

Unlock Full Access

Answer any un-answered question from our database to unlock all community answers for 30 days.

Give & Take

Practice More Questions

1 answer published. Last candidate submission on Oct 20 2026, 8:31pm PDT. Interview question asked to Software Engineers interviewing at Bayer, Fidelity Investments, Apna and other companies. Original question asked: Merge a New Interval. Question last reported by a candidate interviewing at Aetna for a Software Engineer interview on Oct 22 2026, 9:38am PDT.