Samsung Electronics interview question

I was asked a binary search problem.