Cognizant Interview Question

To implement the binary search and dry run it.