Merge Overlapping Intervals with a Sweep
Company: Amazon
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: hard
Interview Round: Take-home Project
Quick Answer: Implement `merge_intervals(intervals)` for closed integer intervals `[start, end]` with `start <= end`. Work through the function contract, boundary cases, correctness argument, and time and space complexity expected in a production-quality solution.