Re:Can (a ==1 && a== 2 && a==3) ever evaluate to true?
by FabHK on Tuesday January 16, 2018 @04:20PM
(#16162722)
You might have bugs in the real world that are caused by language features or idiosyncrasies that are visible in this artificial, small (thus more easily understood) toy example.
I often find these toy examples or trick questions (also in the context of C++ inheritance, for example) very instructive.
This is a typical example of what is wrong and annoying with job interview questions. In a way it doesn't really matter if the line could possibly evaluate to true, it shouldn't be written in the first place. What in the world tells your NO answer about your skill to do the job you are applying for? That you're not smart enough? Come on, I'd be really pissed off with shit like this.