Interviewer seemed confused while asking question and giving any clarifications when questions asked. Interview was for 30 minutes and when i explained brutforce method, he said it is correct and asked me to write the code. I said i will optimize it and he asked me to write code. I did it and he then when left with 10 minutes, asked me to optimize. I did and he simplified the question and asked me to implement code for binary search.
Though i was trying to give out answer, since time was out, he said, interview went good and cut the call. Later, i got the rejection email.
No one can get selected if the interviewer himself/herself does'nt understand how to ask questions properly.