Google interview question

Implement an algorithm based on binary search