3 ms·
I was thankfully asked (in the interview, not just assuming I’d been asked the Q before). Question was: write code to determine if the stack grows up or down.
by sokoloff 5y ago
I was thankfully asked (in the interview, not just assuming I’d been asked the Q before).
Question was: write code to determine if the stack grows up or down. I’d been writing computer games for several years and smashed it (after telling the interviewer that it would be necessarily technically rely on undefined behavior) and the interviewer somewhat dismissively said “you should have told me someone else asked you this question” “What are you talking about? This is just an easy question.”
- chrisseaton 5y agoI guess you’re screwed at that point as now they also think you’re a liar. No way out.
- sokoloff 5y agoI got hired from that loop. Same guy challenged my failure to write ifdef include guards on my header file on the whiteboard. My answer of “oh, you’re right; I’ve configured emacs to automatically insert those, so I don’t have to think about it” seemed to more than satisfy him and we ended up being close as colleagues for several years.
- mgkimsal 5y ago> “you should have told me someone else asked you this question” At what point do we end up saying "my current employer 'asked' me this question, because it's part of my day to day job..."? At some point you have some experience in certain areas that you just 'know', and it's not some sneaky "oh I crammed leetcode for 3 weeks!" tactic.
- cwmoreiras 5y agoYes, it seems to me that if interviewers are going to be annoyed about this then they should stop using leetcode and/or using generic interview questions.
- throw1230 5y agoRed flag. People forget interviews are a two way street. You ask a Leetcode question, and then assume the candidate is lying without even asking "have you seen this question before?".
- SonOfLilit 5y agoA good answer would be "no, but when I was working on <game title> which is a game that has to run on many different consoles including <console>, we had an interesting but where <weird stuff happened> and the stack cookie I inserted to test if it's a buffer overflow remained pristine. After a lot of debugging, at the stage where I started suspecting it's a compiler bug and inspecting raw opcodes, I was looking at my debugger and noticed the stack pointer was lower than the stack cookie address and understood this CPU has a stack that grows the other way than I'm used to". Instant hire if I was interviewing you.
- icedchai 5y agoIt is an easy question for someone that understands pointers. I suspect those sorts of folks are becoming few and far between.