Pergunta de entrevista da empresa Samsung Electronics

I was asked a binary search problem.