Rubbish Interview Questions

I came across this photo in my archive from quite a few years ago. I was taking one of those awful online C++ tests as an initial pre-interview screener. I took a photo of this question as an example of the standard of questions this particular company was asking.

What do you think the answer is?

When you’ve gone through a series of timed questions like this, you start to second-guess the person who wrote it.

Clearly the variable “o” is a stack-based variable, a pointer, so will be destroyed at the end of its scope. So technically the answer is “a”.

But I have a feeling the person that wrote this dubious question actually means to ask about what o points to, especially as it’s a memory leak (unless the mysterious bar() function deletes what o points to). I remember being in a quandary about this one… do you answer entirely correctly? Or do you try to answer the question you think is being asked?

Obviously in a face-to-face or telephone interview one could discuss this. I’ve always preferred, when being the interviewER, to sit down with someone in a real-world situation, give them access to Stack Overflow and Google (which, as we all know, are essential tools of the trade these days), and ask them to explain their thought processes.

If you’re turning down potential candidates on the strength of questions like the above, I’d argue you’re doing it wrong.

Leave a Reply

Your email address will not be published. Required fields are marked *