Microsoft interview question

Solve a sorting problem