Amazon Interview Question

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