Fidelity Investments interview question

merge intervals problem was asked