Cognizant interview question

To implement the binary search and dry run it.