Bloomberg interview question

Write a function for binary search