Better interview question

Array based question(Sort an array in wave form).