Merge Overlapping Time Intervals
Company: NVIDIA
Role: Data Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Quick Answer: Practice a NVIDIA coding interview problem focused on merge overlapping time intervals. The prompt emphasizes edge cases, clean implementation, and verifiable test behavior without revealing the solution.
Examples
Input: {"intervals": [[1,3],[2,6],[8,10],[10,12]]}
Expected Output: [[1,6],[8,12]]
Explanation: Overlapping and touching intervals are merged.
Input: {"intervals": []}
Expected Output: []
Explanation: Empty input.
Input: {"intervals": [[5,7]]}
Expected Output: [[5,7]]
Explanation: Single interval.
Input: {"intervals": [[5,7],[1,2],[2,4],[9,9]]}
Expected Output: [[1,4],[5,7],[9,9]]
Explanation: Unsorted input with touching intervals.
Input: {"intervals": [[1,1],[1,1],[2,2]]}
Expected Output: [[1,1],[2,2]]
Explanation: Duplicates.
Input: {"intervals": [[-5,-1],[-3,0],[2,3]]}
Expected Output: [[-5,0],[2,3]]
Explanation: Negative endpoints.
Input: {"intervals": [[1,4],[2,3]]}
Expected Output: [[1,4]]
Explanation: Contained interval.
Input: {"intervals": [[1,2],[3,4]]}
Expected Output: [[1,2],[3,4]]
Explanation: Separate intervals.