Hacker News new | past | comments | ask | show | jobs | submit login

Me as interviewer: have you heard of the XOR operator?



Yeah, it looks like a plus sign with a circle around it. It's not in the ASCII character set.

Sometimes, programming languages will use the caret character to represent XOR for boolean types and bitwise XOR for integral types, perhaps using two asterisks for exponentiation, or leaving it as a named function call, like Math.Exp or Math.Pow. But you have to be careful there, because sometimes Math.Exp is actually the inverse of the natural log function, rather than exponentiation.

If caret means XOR, then 36 ^ 5 is 0010 0001, or 33.

And that is the point where the interviewer marks me as "do not hire", because they can't stand it when they can't show off how smart they are to the candidate.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: