What question have you found especially valuable in interviewing software developers? What is it about the question that has made it particularly useful?

I'm looking for a particular question you like to ask, not just an interviewing approach like "make them write code".

  • 2
    The question - as phrased - is not constructive, but has some good answers. Rephrase the question to match the best answers and I'll recommend that it gets reopened.
    – ChrisF
    Feb 14, 2011 at 12:07
  • @ChrisF: I rephrased to try to get a bit more of the "sharing experiences" and "asking why", which should also hit more of the "invites longer answers". Let me know if it needs further revision. Feb 15, 2011 at 15:17
  • that's better!
    – ChrisF
    Feb 15, 2011 at 15:19
  • Looking at the question and answers now, it still feels fairly not constructive. It doesn't look like any of the answers are containing the "why" and just listed the questions.
    – Adam Lear
    Nov 6, 2011 at 5:01

16 Answers 16


Take a look at this sample code and tell me how you'd improve it.

  • 8
    cough cough delete?
    – Craige
    Feb 15, 2011 at 21:16

This is a bit specific to my scenario, but I think it was a great question, nonetheless:

So you say here that you've never touched C# or .NET before, right? Ok, so here's a workstation. Figure out how to write a program that queries this DB over here and prints a list of Customers with their orders, sorted by customer name. You can use whatever resource you want.

The only question I've ever had that actually tested my ability to learn.

  • was that before StackOverflow existed?
    – eds
    Sep 4, 2010 at 1:33
  • 1
    Er, isn't this supposed to be a question you like to ask? Sep 6, 2010 at 6:17
  • 8
    +1, this is a perfect question to ask. If they can't figure out basic language constructs with Google nothing will save them.
    – Josh K
    Sep 19, 2010 at 10:36
  • I like that, it shows how well they can pick up a programming language they have never used. I might steal that for my interview questions :)
    – Richard
    Feb 15, 2011 at 22:01
  • 1
    Seems pointless, anyone can copy-paste crappy .net code straight from msdn.
    – dotjoe
    Apr 4, 2011 at 23:51

This isn't a coding question, but a behavioural one:

Tell me of a time when you just couldn't complete all of your work on time to meet a deadline. What did you do? What was the result?

  • 4
    Why is this a good question? Seems pointless to me Sep 13, 2010 at 4:50
  • 9
    The point is that from the developers answer I get a lot of information. Firstly, if they don't admit to this situation ever having happened to them, then they've either been fooling themselves, or they have no experience on real projects. Secondly, if they don't talk about how they'd communicate this problem to the team, but instead just talk about how hard they'd work to fix it, I don't want to hire them. Poor communication is responsible for most of the problems I see on projects. I want to hire proactive communicators. Sep 13, 2010 at 7:06
  • 3
    I ask a similar, more general question ("tell me about a time when something went wrong, and what you did in response...") Very open-ended, and yet I had one interviewee swear up and down that nothing had ever gone wrong for him. Needless to say I did not recommend him for hire. Nov 3, 2010 at 14:25

How did you get into programming?

Nice way to see if the person has a passion for programming and break the ice.


When interviewing somebody who claims to have a non-trivial amount of Java experience, I ask them about hashcode() and equals() and the relationship between them. It's not really possible to acquire significant Java experience without becoming aware of the potential pitfalls and anybody who is ignorant of the issue is going to be adding hard-to-find bugs to my project.

I'll also ask about ArrayList and LinkedList and the relative pros and cons. This should hopefully prove that they are at least aware of, and thinking about, the performance implications of the code they write.

I also like to get them to express an opinion on some technical topic (the usefulness or otherwise of Maven, checked vs. unchecked exceptions, etc.), and then play devil's advocate to see how well they can argue their point.

  • +1 I like the ArrayList and LinkedList. I've seen plenty of comments on SO about people saying that ArrayLists should be abolished but I can think of plenty of uses where they are better than LinkedLists Sep 12, 2010 at 2:21
  • LOL! Once two interviewers asked me about the difference between a list and a map. I gave them such an astonished look, they actually apologized (and then I answered their question and we went on with the interview, of course).
    – Hila
    Feb 15, 2011 at 20:45

"What was the last (best) technical book you've read?"

or, more generally:

"How do you keep your knowledge up-to-date?"

It's amazing how many people never read a technical book since they finished school. And if you never read a book since you finished school and finished school ten years ago, you probably never heard about things like unit tests, design patterns, SOLID principles...

Response to comment:

You can downvote me if you like, but this is one of my favorite interview questions. Blogs, wikipedia, SO are all great sources for the latest high-tech news. But I don't think you can learn really complex subjects (like the stuff you find in Knuth's books) in full depth by reading blogs.

If I have to choose between two developers, where one shows this willingness to learn new complex subjects and the other doesn't, I'll hire the first one. Even if he or she wants more money. It'll pay off in the long run.

  • -1. I rarely open technical books, but know what TTD is and know some of the design patterns. I learned much more from SO (for example what is factory pattern) and from the blogs of Jon Skeet and other professionals than I would learn from a mediocre book. None of the books I've seen explained for example why FxCop and StyleCop checks are so important to write a descent source code which can be reused (nor even mentioned those tools). Feb 15, 2011 at 19:25
  • 3
    +1 You can learn a lot with online articles and blogs but even so, not reading technical books implies a lack of initiative and mediocrity too me.
    – Dunk
    Feb 15, 2011 at 22:18

Reverse this linked list. Now do it in linear time. Now do it in linear time and constant space.

  • 25
    MyList.reverse() Sep 13, 2010 at 4:51

Do you consider yourself to be a lucky person?

I read this in an interview of one of the founding members of Bruel & Kjaer and it struck a chord with me. Successful people are highly likely to consider themselves to be lucky. They see setbacks as opportunities to make improvements and tend to share their successes (luck) with people around them--Lucky people bring more luck.*

People who see themselves as unlucky are more likely to be a bad apple in your team.

* In this context, Luck should be read as preparation meeting opportunity, not a four-leaf clover.

  • 1
    +1 I'd like to upvote this several times more.
    – ocodo
    Feb 15, 2011 at 21:35
  • Napoleon once said "Give me generals who are lucky!"
    – Zachary K
    Feb 16, 2011 at 4:02

The one that's always worked for me...

"Tell me about your previous projects".

And then use their responses as a jumping point into asking them about their role in the projects and why they made certain decisions. Rather than making the interview into the SAT's, I just have a conversation with them. Thats always been more than sufficient to judge whether the developer was suited for a position.

I've only once been hired to a job where I already knew the language being used, so langauge specific questions dont have a lot of value for me. I also personally dont care much for syntax trivia (how would you do a cotton candy sort while trapped in a corral full of hungry Zebras?) and gotcha questions, so I never ask that sort of question.

  • +1. I ask that, too. But it's sometimes hard to find out what the candidate's function in the project was (Project manager? Lead developer? Maintainance developer? Coffee machine operator?) especially when they worked on large project with many people.
    – nikie
    Feb 16, 2011 at 8:18
If you could have any job in the world, what would it be?

I am only really looking for one thing: a serious attempt to answer it. The only wrong answer it so laugh and tell the interviewer that is the most cliche interview question in the world. (I voted no hire).

It is really a set up for my all time favorite question:

If you want to be [a Rock Star], why are you applying to be an [Internet Development Engineer III] here at [HugeCorp]?

It works best if they actually give some audacious answer. They rarely see it coming and this is only really an opportunity for someone to shine by saying something like "the hours here are better" or "my career here will last longer than the typical rock star."

I also lied about there being no wrong answer to the first question. Unless you are interviewing for some totally awesome dream job then the job they are interviewing for is the wrong answer. And if you are interviewing for the dream job and don't already have it, you should ask yourself why you aren't applying for it.

  • "And if you are interviewing for the dream job and don't already have it, you should ask yourself why you aren't applying for it." -- Sounds like a "damned if you do, damned if you don't" question -- especially if you treat the answer the way you describe. If someone has a dream job in mind, maybe they don't feel like they're ready to take it on yet, and need more experience with what they can learn at your company. Why hold that against them? Feb 15, 2011 at 21:52
  • 4
    -1 I've turned down job offers from companies where people have asked stupid totally irrelevant questions like these. #1 It has nothing to do with the job or how you would perform #2 Rather than interviewing the person the interviewer is really trying to show how they are smarter than the interviewee by tricking them, and believe me their arrogance comes across quite strongly #3 I don't think I'd like to work with pr@#k$ that ask those types of questions at a job interview if I so disliked them in the interview. Asking the question over a beer, is another story.
    – Dunk
    Feb 15, 2011 at 22:09
  • @Dunk: You're right, trick questions say more about the interviewer than the interviewee. But asking about a person's goals and wishes in general makes sense. You want your employees to be happy with their jobs (unhappy people aren't productive) so you want to know if you have the right job for them.
    – nikie
    Feb 16, 2011 at 8:47
  • @Dunk since the customers I deal with daily ask cliche questions and often repeat the same stupid mistakes, a cliche question like this also helps self select out the type of people who cannot deal with the customers at my job. The upside is that the job pays to compensate for having to tolerate such behavior. So in that sense it really is the prefect question.
    – shemnon
    Feb 16, 2011 at 18:35
  • @Mark Freedman - I don't hold it against them. This gives them the chance to be honest and direct about their career path. If an interviewee feels they are "damned if they do and damned if they don't" then the job isn't for them. If you're not willing to stick your neck out with an honest answer that's one mark against already.
    – shemnon
    Feb 16, 2011 at 18:39

Doing c# interviews, I love asking, "How do you handle errors in a method"? If I get a decent answer to that question, I ask "How do/would you setup error handling in a web application?"

I'm always amazed at how many developers have no problem with the first question and no clue on the second. I've even interviewed many who couldn't describe how errors were being handled in their current project.


Something like this:

multiply a value by 7 without using *, / and + operations. :)

  • 4
    Does your codebase require knowledge of bit-twiddling or is it just to gauge interest in nitty-gritty details? Feb 15, 2011 at 17:07
  • 2
    Note, he didn't say "or"
    – Ben L
    Feb 15, 2011 at 21:12
  • 1
    @Ben, I think you just threw a logic bomb into the trapdoor - :/
    – ocodo
    Feb 15, 2011 at 21:38
  • 3
    Isn't it just (x << 3) - x?
    – user13278
    Feb 15, 2011 at 22:55
  • 1
    Or even simpler: x -(-x) - (-x) -(-x) - (-x) -(-x) - (-x)
    – nikie
    Feb 16, 2011 at 7:25

Similar to David's but slightly different:

Take a look at messy actual production code from an earlier version that we later fixed and improved. Tell me what it does. Tell me where the problems are (correctness and style). Tell me how you would fix and improve it.

This helps distinguish people who can just write new code, and people who can cope with the reality of legacy codebases.


many years ago I was asked the difference between the regexps /a*/ and /a*?/

I personally tend to ask a few questions about recursion.

  • 1
    Does the ? denote greedy or zero or one ? I've seen both syntaxes. Feb 15, 2011 at 21:42
  • 1
    Which dialect?.
    – user1249
    Feb 15, 2011 at 22:08
  • That was perl5, it was also about 11 years ago. So yes it was greedy vs not greedy.
    – Zachary K
    Feb 16, 2011 at 4:02

I'm surprised at the number of failing answers to this question:

How would you search for an item in an unsorted list?

  • It's a pretty deep question: How is a match defined? do you have any knowledge about partial ordering in the list? What sort of a list is it? Are the items sortable? How big is the list? What is the relative computational cost of comparing vs. checking for a match? Different answers to these questions could change the optimal approach.....
    – mikera
    Nov 21, 2011 at 11:27
  • How often will this search occur? Could it be a bottleneck for performance?
    – Justsalt
    Aug 31, 2012 at 16:15
  • WTF, guys. Start on the first or last item, compare, if not a match move to the next item. The only question is: do we care about multiple matches or do we break the search on the first match? If you want to give some insight you can add: For linked lists it doesn't matter, but for indexed lists, if I also want to extract matches I'd traverse the list in reverse order so I don't have to update the index outside the loop condition.
    – NotGaeL
    Oct 17, 2015 at 12:51

My favorite question is:

(Presumably in a mix of Java/C# and pseudocode)

Using non-exotic containers, design a class which would behave as a dictionary that is as performant as possible, which also allows you to enumerate over the keys not in "random" order but in the order these keys were added to the dictionary since it was first created.

  • This one leads to too many clarification questions. Is it fair to just use two hash tables or a hash table and an array list: One that holds the ordering and one to hold the ordering? Does it have to be possible to remove stuff? (This makes it somewhat more complicated.) If a value is updated, does that count as re-adding it?
    – dsimcha
    Feb 15, 2011 at 21:48
  • @dsimcha, good point. I have 20-30 minutes to talk, and I start with: Please feel free to ask for clarification at any point. If you feel like you are stuck, I would be happy to provide a hint or guide you in the right direction. If the person is still spinning their wheels, then I would say they do not understand data structures. As far as clarifying what I want - I would rather leave this open-ended and take it in different directions.
    – Job
    Feb 15, 2011 at 21:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.