> IMO, The only reasonable answer if asked this in an interview is “I would not write code where I have to know the answer to this question”
That's half of a reasonable answer. The other half is "but I do know the answer so if I see it when reviewing or working on someone else's code I can flag it or rewrite it, and explain to them why it is bad".
No it isn't. You don't need to know the answer to know that it is bad code. The very fact that it isn't clear shows that.
I mean the good answer is:
I am not sure this code could be interpreted the same by different programmers and compilers alike. So I would never write it.
You might still make a mistake, even if you think you know the answer. It's much better to instrument the code to figure it out, or write a short test program.
If you claim to know the answer you've made a grave mistake and fooled yourself.
If you ran the code in a compiler and used that to conclude "this is the answer" rather than "this is an answer" then now is a great time to learn how easy it is to fool yourself. You just need you ask yourself what assumptions you made. I'll wager you assumed all compilers process this line in the same way.
Or just RTFA, or Susam's, as that's exactly what they are about. They explain why this is undefined behavior.