In defense of “old, tired” tech interview questions
“What’s the difference between an abstract class and an interface”
“What’s the difference between a value type and a reference type (primitive and object)”
“How is an object different from a class”
I had a conversation with a fellow Improver a while back where we discussed object oriented and development questions often asked during tech interviews. My colleague had a low opinion of these questions for reasons you might expect: people have rehearsed answers, they don’t necessarily test knowledge that is relevant to being a talented developer, they make you look like a tool because they’ve already heard the question in every other interview, etc. I tend to ask this type of question from time to time because I find them very interesting, but since our conversation I’ve been wondering if I should discontinue them. I’m hoping for some feedback on whether or not the questions have any merit, but first, here is my defense.
- General reasons to ask these questions
• I mostly ask these questions to junior candidates, not all of them have heard them a thousand times.
• After they answer, I usually ask them if they’ve had that question before (people are very eager to say yes if they have, not sure why), if they have and they still don’t have a good answer, that’s a good data point.
• If someone rolls their eyes or scoffs at the question (it’s happened to me), that’s a good data point. Politeness, restraint, and tact are very important to teamwork and client relations, an eye roll indicates arrogance or at least lack of restraint. If you want to work here, don’t act like my questions are beneath you.
• If these questions are so simple and pedestrian, how come so many people don’t have an answer or answer them badly?
• Every once in a while someone gives me an excellent response showing particular insight. If someone teaches you something new, really makes you think, or turns “What’s the difference between an interface and an abstract class” into a master class on object oriented development, you probably should hire them.
• Most of these questions have several levels of depth, the answer they give tells you a little about how they think, more on this later.
• If the candidate has a canned answer, you can throw them off guard with an insightful follow up and tell whether or not they actually understand what they’re saying. If the candidate is trying to BS you, this tells you something about the way they operate.
- Detailed defense of a couple choice questions
- “Define Polymorphism”
• This isn’t just a vocabulary quiz. That being said, whether or not they’ve heard the term is a data point. If they’ve heard the term but still don’t know what it means, that’s a data point as well. If they tell you straight up, I’m not familiar with that term, 0 points deducted, if they try to BS you, -10 points. If they are unfamiliar with the term you can explain it, then give them an example and have them predict the behavior, hopefully they catch on fast and recognize it from their development experience. You can see the epiphany, if they don’t recognize the behavior once you’ve worked through the example, they are missing some basic OO knowledge. No one cares that it means “many forms”, at least I don’t, tell me what it means in object oriented programming. Some people must be impressed by the etymology of the word because a lot of people make sure to include that in their answer (not necessarily a data point, but is interesting nonetheless). There are two forms of polymorphism, overloaded methods and overridden methods, I like it when they mention that. If they mention only one, you can ask them about the other. This is also an easy way (depending on the target language) to segue into a discussion of virtual methods, C#’s “new” keyword, abstract classes, etc. Some candidates have a one sentence answer, some give you an example, some discuss both types of polymorphism, etc. These all show you a little bit about how they think.
- “What’s the difference between an interface and an abstract class”
• I have to admit, I don’t really like this question. I prefer to ask them to define one, then the other and discuss the merits of loose coupling, the impact of inheritance on the rigidity of your object model, etc. But the spirit of the question is the same no matter how you structure it. Discussing these concepts at the definition level allows you some insight into the way the candidate considers these constructs and the value they place on them. Some people don’t have much to say about interfaces because they haven’t built very many (not good). Some people have well defined scenarios in their mind for when each construct is valuable, this indicates a mature sense of object-oriented design.
Many other common and overly-asked questions provide merit for similar reasons. I’m always interested in hearing the questions people ask, and why they ask them. I don’t subscribe to the belief that just because a question is asked often that it is a bad question. In fact, the opposite is likely true! Maybe some people just don’t have good reasons for why they ask them?