r/cpp • • Mar 04 '22

Is it unreasonable to ask basic compiler questions in a C++ developer interview?

I interviewed a guy today who listed C++ on his resume, so I assumed it would be safe to ask a bit about compilers. My team works on hardware simulation, so he's not going to be expected to write a compiler himself, but he'll obviously be required to use one and to write code that the compiler can optimize well. My question was "what sorts of optimizations does a compiler perform?" Even when I rephrased it in terms of -O0 vs. -O3, the best he could do was talk about "removing comments" and the preprocessor. I started out thinking a guy with a masters in CS might be able to talk about register allocation, loop unrolling, instruction reordering, peephole optimizations, that sort of thing, but by the time I rephrased the question for the third time, I would have been happy to hear the word "parser."

There were other reasons I recommended no-hire as well, but I felt kind of bad for asking him a compiler question when he didn't have that specifically on his resume. At the same time, I feel like basic knowledge of what a compiler does is important when working professionally in a compiled language.

Was it an unreasonable question given his resume? If you work with C++ professionally, would you be caught off guard by such a question?

335 Upvotes

335 comments sorted by

View all comments

34

u/pbondo2 Mar 04 '22

Not really answering your question, but still relevant.

I have interviewed people for software development for many years and over time I have found exactly one defining question that you need to ask the applicant.

"Tell me at length about the project or application you are most proud of or that you have learned the most from? Please use the whiteboard and don't be concerned on whether I understand what you are talking about"

During the process ask clarifying questions to the presentation. 10-15 minutes later you will know if he is your guy.

More background. You are putting the applicant in his/her most comfortable position to talk about something he knows about and you can expect a lot. Some people are passionate and experts on some other field/computer language and you can be pretty sure that the energy will be transferred to your field/language. Others will sit in the corner and show that they really don't understand the basics of whatever their expertise is supposed to be.

And HR is gold, but understand to use them correctly. Most applicants are weary of HR so let the applicant know that you are running the show and HR is asking supplementary questions when you are done. At the debriefing listen carefully to what HR is saying.

7

u/rcxdude Mar 04 '22

Yup. The place I work goes a little further and lets them prepare a presentation ahead of time. Usually we would like them to talk through a specific problem they had and how they solved it.

5

u/[deleted] Mar 04 '22

if i ever have to hire somebody, i will steal this from you. I love the approach of giving people a chance to shine.

2

u/sephirothbahamut Mar 04 '22

Sorry, what does "HR" stand for?

4

u/pbondo2 Mar 04 '22

Sorry, Human Resource department.

2

u/14ned LLFIO & Outcome author | Committee WG14 Mar 07 '22

This approach works very poorly with some candidates. For example, every interview where I've been asked this question I've been rejected, and it's a common enough interview question. I think this approach rewards people good at one or a few things, and it penalises people good at lots of things.

I can only speculate as to why I got rejected, but it was probably because I started listing off multiple things, and after I passed my tenth item and I was still going I suspect they thought I was telling lies or something. Or maybe I came across as unfocused, undisciplined, or incapable of doing one or a few things.

In any case, be careful of the implicit and hidden assumptions in the questions you ask in interviews. You can unintentionally filter people out you didn't mean to. Equally, if you explicitly only want a monoculture of people good at one or a few things only, work away.

1

u/dgkimpton Mar 06 '22

Man, I would love and hate that question. My proudest works are proprietary property of my property previous employers and as such I would constantly be having to try and temper my passion so as not to leak something I shouldn't. And yet, you're correct, talking about something I'm passionate about would definitely let me show who I really am. Arg.