Zalando Interview Question

Write code that merges a list of intervals