Amazon interview question

A coding problem involving sorting intervals