Amazon Interview Question

Sort an unsorted array and explain