Amazon interview question

Arrays, sorting, searching.