Amazon interview question

How to sort a problem