Amazon Interview Question

one coding question on binary search