Amazon Interview Question

Coding question: binary search implementation