Amazon interview question

binary search and sorting on array