Amazon interview question

coding: binary search, easy to medium