BlackRock interview question

write a binary search method