Synopsys interview question

Interval sort