Microsoft interview question

The question is to sort array