Merge Weekly Time Intervals
Company: Nextdoor
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Quick Answer: This question evaluates understanding of interval-merging algorithms and temporal data normalization, testing competency in handling time-based ranges, overlap detection, and chronological ordering within the Coding & Algorithms domain.
Constraints
- Inputs are provided as Python literals matching the function signature.
- Return a deterministic exact-match result.
Examples
Input: ([['Mon 09:00','Mon 11:00'], ['Mon 10:30','Mon 12:00'], ['Sat 13:00','Sat 14:00'], ['Sat 13:30','Sat 15:00']],)
Expected Output: [['Mon 09:00', 'Mon 12:00'], ['Sat 13:00', 'Sat 15:00']]
Explanation: Prompt example.
Input: ([['Sun 23:00','Sun 23:30'], ['Mon 00:00','Mon 01:00']],)
Expected Output: [['Mon 00:00', 'Mon 01:00'], ['Sun 23:00', 'Sun 23:30']]
Explanation: Chronological week order.
Input: ([],)
Expected Output: []
Explanation: No intervals.
Hints
- Choose a representation that makes the core operation simple.
- Handle empty and boundary inputs before the main algorithm.