4 ms·
Since I see name and shame threads ... Years and years ago I went for an interview at Computer Associates, who were still doing accounting software at the time
by kazinator 2y ago
Since I see name and shame threads ...
Years and years ago I went for an interview at Computer Associates, who were still doing accounting software at the time.
They gave me a test with idiotic questions about C, where the examples obviously had undefined behavior. Like what is the output of code that takes the address of a variable of type short, next to another such a variable, and then casts it to a long * pointer and retrieves the value.
I had a printed copy of ISO C in my briefcase and showed them chapter and verse how that is undefined behavior. I was told I'm not "doing very well here".
No hire!
They just wanted people to know what the Microsoft Visual C compiler (or whatever they they were using) does with various undefined behavior, because they have such stuff in their codebase. I could have guessed "right" on most of it, but homie don't play dat.
- stackedinserter 2y agoSo you bothered to print 500 pages instead of just saying "you can't do that but most likely it will grab value of neighboring variables"?
- kazinator 2y agoIf I recall, that question required naming the value that would be produced, not just articulating some speculation about what it might be. I was taken aback, so I went to the interviewer: how am I supposed to answer this, is it a trick question about undefined behavior? The compiler is allowed to just flag that with a diagnostic and even terminate after that. He was like, what do you mean, undefined? It's just straightforward: what is the value? He had no idea what undefined means, or what is a language standard.