Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I do a good number of in-person technical interviews for new developers. I like to ask technical questions where I ask people to either code something up or develop an algorithm to solve a task.

I feel my current repertoire is uninspired.

In my opinion, the ideal interview question has these qualities:

  1. Multiple solutions, where some are obviously better than others, and some that involve subtle trade-offs (discussing tradeoffs is a good way to gauge someone's experience, in my opinion).
  2. Novelty - asking the "insert this element into a linked list" question is only good for weeding out people who never did their homework.
  3. Elegant - I like questions where the core problem isn't hidden in a lot of details. Everyone should be able to understand the problem, even if everyone can't solve it on the whiteboard. Elegant questions are difficult without involving undue amounts of "domain knowledge" or getting too narrow.

Have you been on either side of an interview where someone (maybe you!) asked a particularly good programming or algorithms question?

share|improve this question
1  
I don't do well at whiteboard programming, so for me, the best interviews are where I don't have to do it :) – kotlinski Dec 22 '10 at 16:51
I was always wondering - are there actually people who are good at whiteboard coding? – Nikolai N Fetissov Dec 22 '10 at 16:57

migrated from stackoverflow.com Jan 18 '11 at 11:32

4 Answers

What I've been doing recently is using dodgy code samples found in real code reviews.

I print out a few short examples and simply ask, is there any way this code could be improved?

Apart from anything else it keeps it fresh for me because I have a large supply of code samples to draw on. :-/

share|improve this answer
+1, sad but true. Cheers – Fritschy Dec 22 '10 at 16:53
I've received 2 recent interviews like this and I find they're great! – marcog Dec 22 '10 at 17:25

Have you considered using material from Code Golf? I don't mean the focus on writing code with the fewest characters, I mean the challenges themselves, right here on Stack Overflow.

share|improve this answer
4  
-1: Ridiculous suggestion, IMO. – Moron Dec 22 '10 at 18:00
Yes, trying to get the shortest code is ridiculous but the questions/challenges themselves are sometimes interesting. Take "how to cause a stack overflow?" for example. – kiwicptn Dec 22 '10 at 18:07
Interesting does not always imply a Good interview question. In any case, that is subjective. I am sure lot of people will agree with you. – Moron Dec 22 '10 at 18:09

Interviewing a lot of programmers, I found out that the specific questions asked are much less important than usually considered. I think that questions should raise a dialog. As long as the dialog is constructive, they'll do the work.

That said, I like to ask two types of questions:

  1. Open questions like "describle how would you design an elevators controller for a residential building with 10 floors and 2 elevators".

  2. Questions in which small details matter. Not theoretical - but practical details. For example: how to read 3 values and check if they represent valid edges of a triangle. See my answer at Triangular c++ edge calculation for the gotchas. I like to see experience-base detail-oriented attitude.

Don't look for the ultimate question. Just stock an arsenal that you can use dynamically and adaptively to create a constructive dialog.

What do I mean by "constructive dialog":

I consider the interview as a process of finding the candidate "bugs" (As a starting point, I assume the candidate is perfect, or "bug free"). Doing your job best, means finding many important bugs in one hour (You can stop before if you found critical bugs...)

share|improve this answer

Inspired, uninspired, I don't think that's the criteria you should use for interview questions. I would focus on whether the interview question are successful in getting a good assessment of the candidate. It could be that you have the most boring question in the world, but if it's effective I would keep using it.

Here's the question I almost always ask.

share|improve this answer
don't forget the interviewee also interview you. you don't want to make him think he is going to deal with boring stuff... – Yuval Dec 22 '10 at 18:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.