Amazon Interview Question

Variations on binary search