1. I think purpose of interview is to check problem solving and analytical skills of a candidate. If yes, then same message should be passed to interviewer who is going to take interview, it's big point which needs improvement.
2. Interviewer should concentrate on interview only when it is going on, and should try to understand the candidate's points.
3. Instead of, asking syntax of something which is obvious thing to do, should not be criteria of rejection.
4. Interviewer should not get offended by the questions asked by candidate at end of interview.
5. You are taking an interview of a human being not astrologer, so please, stop expecting the answers which are in your mind only or the exact way which you have read/heard.
6. Interview should be aligned with candidate's skills (which are written in resume).
Conclusion : I was very much impressed by the products of the company due to which only I applied to job interview, But I am very lucky as well as happy to know that I got rejected here. I can guess that I might have faced a toxic work culture/people there if would have selected.