Amazon interview question

binary search for first & last occurrences on repeating number from a given array,