After some routine project background check, interviewer asked a question to find the occurance of a given number in a sorted array:
int getCount(int[] arr, int num)
He was expecting O(logN) in worst case (the example he gave were: new int[] { 2,2,2,2,2,2,2,2,2,2,}, 2, new int[] { 2,2,2,2,2,2,2,2,2,2,}, 2, new int[] { 2,2,2,2,2,2,2,2,2,2,}, 2, new int[] { 2,2,2,2,2,2,2,2,2,2,}, 2, new int[] { 2,2,2,2,2,2,2,2,2,2,}, 2, new int[] { 2,2,2,2,2,2,2,2,2,2,}, 2, new int[] { 2,2,2,2,2,2,2,2,2,2,}, 2, new int[] { 2,2,2,2,2,2,2,2,2,2,}, 2, new int[] { 2,2,2,2,2,2,2,2,2,2,}, 2, new int[] { 1,2,2,2,2,2,2,2,2,2,3}, 2, and new int[] {1,2,2,3,4,5,6,6,7,8,8,10}, 9
I didn't do well during the phone interview.
Interviewer was very professional though.