Tapad Interview Question

Implement a binary search algorithm from the beginning.