The Best Interview Questions for Developers

Gregory Leman
Software Grognard
Published in
4 min readApr 25, 2022

When I interview software developers I mainly concentrate on the behavioral side. If they’ve gotten through the interview funnel they went to a top school, have had a developer job for at least a few years, built some open source that we’ve seen, etc. They’re clearly smart enough and have some technical chops or their resume and cover letter wouldn’t have gotten them this far.

Some developers like to ask gotcha questions on the specifics of a language such as what is the output of the javascript:((_) => (!_))()? I think this is a very weak approach, doesn’t tell you anything useful about the candidate, and the main purpose is to stroke the ego of the interviewer through the humiliation of the candidate. I think my answer would be “Do you have stuff like this in your codebase? Sounds like you need to do a lot of refactoring since that’s a very long winded way to express True.”

Others like to use brainteasers such as “How many ping pong balls will fit in a 747?” That question at best lets you know that someone is good at estimation heuristics, and I see extremely limited utility in that skill for a developer. But that’s another article. Frankly that brainteaser you found on the internet is most likely to just find you people that have spent a lot of time memorizing brainteasers. The only brainteasers I like to use are the ones that measure creativity, such as “How many uses can you think of for a brick?”

And yet others get very focused on which versions of a particular technology a developer has worked on. Early in my career I got the feedback from a recruiter that they passed because while I did great, I only had experience with version 3.4 of a mapping library and they needed to fill the position with someone who had experience in 3.5. That’s after I had built a complete product that was a competitor to that library….

I’m going to give away some of the questions that I like to ask. If you’ve got an interview with me and you were smart enough to read this article then you’re the kind of person I’m looking for anyway, so I don’t see a downside in sharing these.

Why did you get into programming?

I’ve actually had this one answered with “I didn’t know what to major in and programmers make pretty good money. I don’t particularly enjoy it, but it lets me support my family.” True story.

What I like to see in an answer is the excitement they first felt when they wrote their first program and it worked. Or how they love being able to build things. You’ve got to have a basic love for this art in order to be good at it.

How do you keep your skills sharp and up to date?

“My company has lots of mandatory training that I have to attend.” Yuck.

I want to hear about their side projects. Stuff they’ve taken on to learn that has nothing to do with their day job because they’re interested in it. Continuous learning is a critical part of this job, I want to hire people that enjoy the learning aspect.

What are your thoughts on TDD?

“I think it’s a waste of time.” Yes, I actually got that answer. Obviously, they didn’t do a cursory internet search on me before the interview. Hard pass.

It’s ok if TDD isn’t your cup of tea. It’s what’s known as a cultural mismatch. We’ll save each other some heartache by not continuing this process.

A Whiteboard Problem

I’m on record as hating whiteboard interviews. I think they’re terrible. But there is one whiteboard programming question I will ask, and it’s incredibly simple yet tells me a lot of behavioral things.

Write a function that given an input of one, returns zero. And given an input of zero, returns one.

Do they ask any questions or do they just charge into writing code on the whiteboard? What should the function do if given input other than 1,0? Are these integers?

Do they follow TDD? Do they really believe in TDD, or was that just an act?

What language do they use? If they’ve assured me that they’re highly proficient in Java and have been doing it for years, but start writing in PHP…

What do they name the function and the variables? F(i) is not a great answer.

Do they write an if-then-else or do they recognize this is just an inverter? If they take the inverter approach and they’re an EE in background I’m going to have real qualms unless they do the other parts of this extremely well.

If they go with the if-then approach, do they at least not use the else?

How do they do comments?

How do they handle bad input?

This simple little problem will reveal a lot about how they really approach coding.

Bomb Baghdad

This one is an old joke.

Given the assignment to write a function bomb_baghdad, how would you implement it? The best answer is “I would be morally opposed to writing that function and would refuse to do it…. I would instead write function bomb() with City as a parameter.”

What do you use?

What interview questions do you find useful? Let me know in the comments and we can discuss.

--

--