Qualcomm interview question

write a binary search