DriveNets Interview Question

Explain how binary search works.