Amazon interview question

To implement a binary search method.