Oh no, I never leave dangling pointers. Also our code really needs to be extremely efficient and optimized, and on top of that we need to unit test everything, so it's just not possible. The problem is my mind is always flipping pointer shit around, so I need a couple of minutes usually to set it straight. It's weird, but of course it was the one question he asked.
He also asked a compiler question that sort of irritated me. The exercise was reading from memory addresses 10 times. I put it in a while loop, and it was something like ((UINT32 *)Address)*, I can't remember how it was written. He then asked me what the compiler would do with that loop. I told him nothing, it would read the memory 10 times. He argued with me that the compiler would flatten it out and store the memory value in the stack and just use that value 10 times. Here's the thing though, I know for certain the compiler included with the BIOS IDE they're using specifically doesn't do that. I've seen the assembly code for it, I know for a fact that it actually reads the memory 10 times. He argued with me and basically "lead me to water" by setting the variables as volatile. Just really annoying, he wasn't even on the team I was interviewing for.
Yes, fuck travelling to Cambridge. If I did get a job there I'll just take the T.