foodpanda interview question

Explain how binary search works