Tarento Interview Question

1 Coding question based on the binary search