I <3 Steve McConnell*
Coding Horror
programming and human factors
by Jeff Atwood

Mar 16, 2009

The Hardest Interview Puzzle Question Ever

Have you ever been to an interview for a programming job where they asked you one of those interview puzzle questions? I have. The one I got was:

How much of your favorite brand of soda is consumed in this state?

And no, the correct answer is not who cares, unless the thing you don't care about is getting the job you're interviewing for. I didn't know it at the time, but this is a Fermi Question. (To prevent spoilers, the answer can be found in a previous blog post.)

Puzzle questions were all the rage in programming interviews in the 90s and early aughts. This is documented in the book How Would You Move Mount Fuji? with a specific emphasis on Microsoft's hiring practices.

How Would You Move Mount Fuji? Microsoft's Cult of the Puzzle - How the World's Smartest Company Selects the Most Creative Thinkers.

It is prudent to study common interview puzzle questions if you know you'll be interviewing at a company that asks these sorts of questions. And if you think you're ace at programming puzzle questions, then I challenge you to point your massive brain at this, the hardest interview puzzle question ever:

A hundred prisoners are each locked in a room with three pirates, one of whom will walk the plank in the morning. Each prisoner has 10 bottles of wine, one of which has been poisoned; and each pirate has 12 coins, one of which is counterfeit and weighs either more or less than a genuine coin. In the room is a single switch, which the prisoner may either leave as it is, or flip. Before being led into the rooms, the prisoners are all made to wear either a red hat or a blue hat; they can see all the other prisoners' hats, but not their own. Meanwhile, a six-digit prime number of monkeys multiply until their digits reverse, then all have to get across a river using a canoe that can hold at most two monkeys at a time. But half the monkeys always lie and the other half always tell the truth. Given that the Nth prisoner knows that one of the monkeys doesn't know that a pirate doesn't know the product of two numbers between 1 and 100 without knowing that the N+1th prisoner has flipped the switch in his room or not after having determined which bottle of wine was poisoned and what color his hat is, what is the solution to this puzzle?

In other words, I hate puzzle questions.*

I'm also not a huge fan of those abstract impossible questions, eg, "how many optometrists are there in Seattle?", but I suppose that's a matter of taste. If you absolutely must, at least ask an impossible question that has some relevance to a problem your very real customers might encounter. I just can't muster any enthusiasm for completely random arbitrary puzzles in the face of so many actual, real world problems.

And yes, I totally failed that interview. Which was disappointing, because it was kind of a cool job.

Not that my proposal for interviewing programmers was any more popular, though I do think it's much better.

I have my own theory about the ideal way to interview developers: have the candidate give a 10 minute watercooler presentation to your team on something they've worked on. I think this is a far better indicator of success than a traditional interview. You'll quickly ascertain:

  • Is this person passionate about what they are doing?
  • Can they communicate effectively to a small group?
  • Do they have a good handle on their area of expertise?
  • Would your team enjoy working with this person?

You'd certainly want to complement this type of interview with some actual hands on programming, to make sure the applicant isn't full of crap -- although I'm pretty sure that you can't B.S. your way through a technical presentation to a handful of your peers if you truly have no idea what you're talking about. (And if you can, you should be CEO of a startup by now.)

What I'm optimizing for here is the ability to communicate. Most programmers, once they pass the FizzBuzz level of competency, are decent enough. But coding chops aren't enough. To go from good to great, you must be able to communicate effectively: with your teammates, your manager, the users, and ultimately the world.

My wife and I just finished a five day hospital stay for the birth of our first child. During our stay, we were assisted by a parade of different nurses, at least two different nurses every day, sometimes more as we progressed to different areas of the hospital and through daily shift changes. The quality of care at this particular hospital is generally quite high, but we were flummoxed by the disparity in care between the worst nurses and the best nurses. After a few days, I finally figured out the common characteristic -- the worst nurses were invariably the worst communicators! The fact that these nurses couldn't effectively communicate with us:

  • why they needed to do something
  • what the options were
  • offer advice
  • troubleshoot our problems
Meant they ended up feeling like rigid, inflexible proceduralists who didn't care or constantly had to appeal to authority. Of course, this wasn't true. I'm sure they were perfectly competent registered nurses. But in the absence of reasonable communication, it sure seemed that way. To be fair, these nurses were frequently (but not always!) non-native English speakers.

Hiring is difficult under the best of conditions. But an interview process that relies too heavily on puzzle questions is risky. Sure, you may end up with programmers who can solve (or memorize, I guess) the absolute gnarliest puzzle questions you throw at them. But isn't effectively communicating those solutions to the rest of the team important, too? For many programmers, that's the hardest part of the puzzle.

* although I expect aficionados of the style should be able to identify all the classic interview puzzle questions represented here.

Posted by Jeff Atwood    View blog reactions
« The World's Largest MMORPG: You're Playing it Right Now
Five Dollar Programming Words »
Comments

For example, in my work place as policy I make sure that all technical issues are handled by our issue tracker. Nobody is allowed to walk up to my desk or anyone elses and discuss technical issues in face-to-face conversation. Firstly, it's distracting to have someone approach you and force you away from your thought processes on a whim. Second, technical issues are difficult to communicate in person either by misunderstanding or by failure to transcribe every nuanced or implied detail. By using an issue tracker we avoid as many of those problems as possible. The programmers stay happy and the sales/biz people stay happy.

Doesn't sound like a happy place. Of course when I started (late 60's) people managed fine without so many technical appendages. We also had the common sense not to interrupt our fellow programmers when they were concentrating. There were people I worked for (CNO, members of the US House of Representatives) that would've told you what to do with your issue tracker on the way out the door.

dbasnett on March 17, 2009 2:00 AM

Hey Solutionman,
You forgot to split the pile...

Guess you lose.

I love it when arrogance loses...

Mac on March 17, 2009 2:29 AM

You have to explain to me how you pick X items from a pile with Y items and don't get two piles; The X you picked and the Y-X you picked from.

I'm no genius I said I had retard level IQ. Perhaps you get 3 piles? Sometimes your intuition is wrong you know.

Solutionman on March 17, 2009 2:36 AM

Reminds me of the famous interview question why are manhole covers round?. Aside from the obvious responses such as because it has to fit into a round hole, and so it has no sharp corners and becasue it's easier to fit (does need much lining up) etc, there's one REALLY good answer. Anyone know what it is?

Glenn on March 17, 2009 2:42 AM

Don't expect programmers to be sociable people. Just lay down a good system and a few rules and things will just happen regardless of anyone's social skills.

In my first real job, we had a co-worker that was kinda arogant in a church lady kinda way, inconsiderate of her coworkers, and yes, a lousy communicator. Everyone put up with her though because Michelle was just being Michelle. Likewise, I have a friend who occasionally invites me to play poker, but I no longer accept because he also invites another friend who is loud, boisterous, negative, and insulting as a rule of thumb. Again, everyone put up with it because that just who he is.

As someone who has always tried real hard to break out of the stereotypical molds that have been placed around me due to my decisions and circumstances, I always find it amazing how many people are willing to not only forgive but encourage socially inappropriate behavoir simply to perpetuate a stereotype.

Peter on March 17, 2009 2:44 AM

so it won't fall in the hole, like it could for other shapes.

dbasnett on March 17, 2009 2:50 AM

You're hired.

Glenn on March 17, 2009 2:58 AM

One of my coworkers was also arrogant. I just anal raped him and said every time you act that smug, it's up the ass. Got it buddy? works every time I tell ya.

Solutionman on March 17, 2009 2:58 AM

Fuck this. I'm not going to bother trolling here when Jeff doesn't even bother cleaning up.

Solutionman on March 17, 2009 3:05 AM

Actually, rather than being polite and commenting on the article, I found myself distracted by liking the pirate/monkey problem. After taking it apart for a little while I think it's possible to say it isn't parody (as the link says) and find it solvable. The key, in my opinion, is to dispense with the chaos and recognize that the last statement defines (in a somewhat reverse order) what we may have solved (as preconditions) for us in the problems above. Not having some of the math makes it tricky (should I see significance in reversible primes?), but we're allowed to state our assumptions, right? Assume enough away and it's possible to frame anything.

For example, I might look at how one interprets the actual number of pirates per prisoner, which helps me answer why the rum's gone. This is important to establish, with pirates. More seriously, may as well as recognize that some of the issues are independent (mass/liquid displacement to find poison and coin, river monkeys, and primes with an even leading digit can be separated), and rely on the final case statement to show that IF we assume the required conditions are met for, e.g., has everyone flipped the switch now, this resolves into what left as the actual puzzle. I.e., I don't always need to know that the monkeys lie, just that it's a precondition for part of another condition.

In the end, I became curious about who's walking the plank. Since I don't know if everyone's a pirate, how many there are, and if this is part of a puzzle I haven't seen, I came up with the need to knock everyone out (then we don't care who's prisoner/pirate/plankworthy) and effect the release. We'll just solve what we can. Bribe the captors with the real coins, get each person catatonic on at least two bottles of that good, clean wine, wake up in the morgue, then (having already rigged the room switches for party strobe) give the party hats, fake coin, and bad wine to the primates...because there's something not quite right about these monkeys and there are WAY too many of them trying to use our escape canoe.

Kirk M. Schafer on March 17, 2009 3:12 AM

mov loc, mntFuji; ?

Andy on March 17, 2009 3:19 AM

I think maybe the reason interviewers like to ask these puzzle-type questions is because they can't handle the technical stuff. :)

Job on March 17, 2009 3:36 AM

Ouch! :)

Job on March 17, 2009 3:40 AM

More useless dribble posted by Jeff.

Phill on March 17, 2009 3:50 AM

@Glenn: Don't fall for that so it doesn't fall in thing. The answer is pseudo-anthropic principle. If they weren't round, you wouldn't be able to sensibly ask me that question. Therefore, they are round because they MUST be round in any universe in which you're asking me that question. Big picture, man.

@Jeff: The surgeon is the patient's mother.

Jay Levitt on March 17, 2009 3:53 AM

Haven't you blogged about this several times? Actually, I think there probably are about 4 topics you've been repeating a lot lately and they all seem to border along the lines of either anti-intellectualism or something about how programming is irrelevant and how all this other jibber jabber is the real fruit.

Charles on March 17, 2009 4:55 AM

Dang! WaterCOOLER presentation - I misread that as waterCOLOUR presentation....which I think would be FAR more interesting!!!

Devan on March 17, 2009 4:59 AM

Assuming a few points:
- monkeys cannot operate a canoe
- pirates lie

Then:

- Pirates will make all the prisoners walk the plank, that is in their nature.
- First 2 monkeys will sink the canoe, the rest will be angry.
- Pirates will be stuck on the wrong side of the river, and eventually will die from either the poisoned wine or at the hands of the irate monkeys.
- The monkeys will go off looking for bananas.
- In time, the counterfeit coins will be worth something because they will be antique counterfeits, and probably rarer than the real thing.

The most profitable solution is to ignore the pirates, the prisoners and the monkeys, take a GPS position, collect the coins when it's all over.

But I don't want to work for anyone so preoccupied with pirates and monkeys.


seanb on March 17, 2009 5:34 AM

A friend of mine who owns a consulting company gave me a great bit of advice about hiring for communication ability. Phone screen all candidates before ever meeting them in person. If they can't communicate well over the phone, their resume goes in the trash.

John on March 17, 2009 7:01 AM

I would lie and say my favorite soda is Moxie and assuming the state is California I would bullshit some really small number because Moxie isn't availible on the west coast as far as I know.

Will on March 17, 2009 7:03 AM

Hmmm... *searches what puzzle questions are*

MrcredsAlex on March 17, 2009 7:08 AM

Having spent some time working in a hospital I remember being told (many times) the importance of communication and talking to patients (even though I actually interacted with patients only rarely), it's not just the software world, communication is important in almost any career.

Stephen on March 17, 2009 7:18 AM

I program because I enjoy sitting in front of a computer for 8-16 hours a day relating to abstract problems. Many interviews apparently wanted me to be extremely personable. Did you forget what you're hiring me to do?

It's no wonder that the interview process at many jobs has often given me coworker techies that were good snake oil sales men with little coding skill and coworker salesmen that were good only at selling themselves.

Make the interviewee show you that they can really do the job you're hiring for. More importantly though, use a competent group of interviewers. This would solve most bad hires. You need a small team who can ask the right things and evaluate the responses correctly. People who think they know how to interview just because they're good at a job is the same as people who think they can manage just because they're good at a job.

Dinah on March 17, 2009 7:27 AM

The silver bullet is not communication. The silver bullet is not puzzle-solving. The silver bullet is not X, Y or Z. Communication is important, but there is no requirement to be a master communicator. Middle-of-the-road will suffice perfectly well. Ditto problem solving. Ditto your particular flavour of language/environment. Ditto everything you want your employees to do. If there's one thing I take from myriad tales of X was a great at Y, but he was so bad at Z that he was a nightmare to work with, it's that it's breadth of skill that makes a good team member, and that team skills are more important than programming skills*.

Someone with 5s across the board will achieve more than someone a mix of 1s and 10s in a team environment. Sure, you might surge ahead in one area with the unbalanced guy, but your team leader will spend too much time leading the people and too little leading the project, which will inevitably suffer.

*barring, of course, all the ridiculous extremes that the bad team-members are just about to throw out in knee-jerk self-defence :)

Schmoo on March 17, 2009 7:32 AM

I know, of course, the answer to your hardest question, Mr Interviewer, but I shall give it to you in the form of a riddle:

My first is in stupid, and also in interview...

Phil H on March 17, 2009 7:37 AM

There is no silver bullet, a good combo of some of the above will get you on the right track. The best way to hire someone is not to know everything about how to hire a person, but what to AVOID in hiring a person. By eliminating the most mistakes, you'll guarantee a better quality fill rate of personnel.

Cybercat on March 17, 2009 7:40 AM

although I'm pretty sure that you can't B.S. your way through a technical presentation to a handful of your peers if you truly have no idea what you're talking about. (And if you can, you should be CEO of a startup by now.)

Please don't encourage those with no technical skills to start his/her own startup. I don't like being able to relate to every single Dilbert cartoon...

Good post though!

Mike on March 17, 2009 7:40 AM

I ask similar 'impossible' questions to interviewee's because I want to know what are you going to do now that you dont know the answer?

Are you going to look more closely at the question?
or give up?
or lean on google for an answer?
what if you google cant find one for you?


I agree that communication ability is a key component,
but so is being able to work your way around problems for which you have no answers.

Eric on March 17, 2009 7:40 AM

Is there an answer to the hat question where there's four people and one door on some steps and they can't see their own or each others hats or turn around? I got asked that by some jerk who didn't want to give me a hard question.

Peter Turner on March 17, 2009 7:42 AM

the correct response to the 'hardest interview puzzle question ever' is, of course, to strangle the sadist who asked it.

DygraphicProgrammer on March 17, 2009 7:48 AM

One of my favorite questions to ask is Did you notice anything in particular about our facility when you came in? (not applicable for phone interviews of course). Its not a pass/fail question, but it gives a little insight into how they think. Out of the 20 or so interviewees for the last opening here, the ones that didn't notice anything also didn't have any programming skills; the ones that said something vague (that parking was a problem) had basic skills; but the ones that pointed out specific things (like the ashtray 50 feet after the no smoking sign) had some l33t skilz. Maybe it's the attention to detail.
The guy who got the job mentioned the ashtray, a car with a flat tire in the parking lot, and the ninja behind the bush.

MikeW on March 17, 2009 7:48 AM

Regarding the pirate puzzle, the answer is, of course, 42 ;-)

Mecki on March 17, 2009 7:50 AM

How much of your favorite brand of soda is consumed in this state?

It's 7, obviously. I can't believe anyone needs to ask. Sheesh.

Also, I'm not sure the communication issue is the major reason for the difference in nursing quality (it is likely to be a symptom though). Interestingly, the Dreyfus model was developed to explain exactly that skill disparity ie why some nurses are better than others:

http://en.wikipedia.org/wiki/Dreyfus_model_of_skill_acquisition

Look at the novice level and see if it fits those nurses who ended up feeling like rigid, inflexible proceduralists who didn't care or constantly had to appeal to authority.. Your comment is almost a quote :-)

A better discussion of this is in Pragmatic Thinking and Learning, which I would recommend to anyone, if only for the chapter on skills aquisition.

Jim Cooper on March 17, 2009 8:00 AM

Despite the fact that core competency of programmer is ability to stare at monitor for 8-12 hours and produce great code communication is extremely important. Unless you are a lone star in ivory tower, of course.

Programmer does not have to be an uberpresenter, but he has to be able to express his ideas and concerns in consumable form. No matter how great a developer he is if his ideas will buried in his mind forever.

Besides communication is not only about talking. It is also about listening. Ability to talk effectively does not come without ability to listen effectively. And most successful programmers can communicate good enough to present what they have to say and learn from others.

Dmytro M on March 17, 2009 8:04 AM

The answers to the pirate thing is easy:

100 prisoners and 3 pirates locked in a room... Anyone else see a numbers problem? Revolt.

Tool on March 17, 2009 8:05 AM

The hardest interview problems often have the easiest solution:

Thank you for your time. Goodbye.


Kevin on March 17, 2009 8:06 AM

I like your interviewing technique. Talking for 10 minutes about something I have worked on, no problem. SONET network from New Orleans to Houston, via oil rigs in the Gulf of Mexico...

Back-in-the-day we used the acronym BONSOP, back of napkin, seat of pants.

dbasnett on March 17, 2009 8:08 AM

I think the answer to the puzzle is that you did not ask a question.

Is that what they are looking for, or did you just come up with something ludicrous?

Practicality on March 17, 2009 8:11 AM

Jeff I think you're missing a fundamental element of the response to such puzzle questions. The way in which the interviewee processes and solves the question is important, but the way in which they convey their thinking is the revealing factor!

I've given technical question to interviewees before, and whether they know the answer or not is second to how they go about describing their thought processes, or how they interact with the questioner (me). That's communication, and it's going to come out just as well (and in a more relevant manner) with boilerplate interview questions as with puzzle questions.

Heath Raftery on March 17, 2009 8:11 AM

Oh. And I don't like soda. Terrible for your health. The number of soda drinkers is probably directly related to the cancer and diabetes rate.

Just FYI :)

Practicality on March 17, 2009 8:13 AM

This is simple - I don't drink cola (It gives me migraines since I am mildly allergic to the carbonation). So the answer would be None.

tim on March 17, 2009 8:25 AM

Also, StackOverflow user profile is also a good way to judge talent. Not really but amount of points, but the posts you make and how you answer questions tell a lot about the candidate.

Brian L on March 17, 2009 8:27 AM

Jeff,a lot of the questions you are complaining about aren't puzzle questions:

How much of your favorite brand of soda is consumed in this state?
how many optometrists are there in Seattle?

These are estimation questions -- they require no trick or special knowledge. They have no 'right' answer since they are process questions. Because of that, I think they are much better than puzzle questions. And I think one or two questions in an interview assessing the estimation skill of an engineer.

That being said, I completely agree with your general point about puzzle questions

Matthew on March 17, 2009 8:29 AM

Mecki was the first, but I agree: of course, the answer is 42!

Nabeshin on March 17, 2009 8:30 AM

Prisoners/Pirates answer: The monkeys are invisible.

Jens on March 17, 2009 8:39 AM

42

ian on March 17, 2009 8:50 AM

The culture of puzzle questions at Microsoft has to a large extent faded away. I talk to a fair number of interviewers here and I have not even _heard_ of anyone who uses puzzle questions since the 1990's. I read Poundstone's book when it was published and it seemed terribly dated even then.

Puzzle questions test your ability to answer puzzle questions, which is not a skill that drives Microsoft shareholder value. It might be _correlated_ to skills that do, but why test for a correlate when we can test directly for the skills that do matter? Like ability to design, implement, test, analyze, debug, maintain and document high quality software.

And, of course, communication is key to all of those things, none of them being done solo.

Eric Lippert on March 17, 2009 8:59 AM

What you have to remember, Jeff, is that nurses may not want to explain to you what they are doing. You the the right to refuse treatment, which is not necessarily in their (and the hospital's) best interest. You are under the impression they are looking out for your wants. They aren't. They are looking out for their employeer's wants, and that is to keep you from causing problems and sueing them. Most hospitals would prefer that you don't ask questions and let them do what they think is in your best interest. Communication with you is not key for them to do their job.

Kevin on March 17, 2009 9:01 AM

I read this before my morning coffee, and I saw:

have the candidate give a 10 minute watercolor presentation to
your team on something they've worked on

Which lead to an entire series of amusing mental pictures of geeks with giant paintbrushes and pastel paints, filling the walls of a conference room with watercolors on those giant Post-It notes, then describing the pictures in haiku for the interviewer.

Like the puzzles, it would certainly be amusing, but not very productive.

Tina Marie on March 17, 2009 9:02 AM

It seems to me that every company wants to hire the best, the smartest, the ones with communicative skills, la crÈme de la crÈme. Nobody wants to get down to the dirty business of educating his employees.

But where do these smart communicative guys come from, then? Do you have to be born that way? Or is a smart company not the one that hires the cool guys, but that hires the potentials and makes them the cool guys?

That said, I don't like skill tests in job interviews at all. Test for honesty and attentiveness and everything else can be worked out.

Leonard Ritter on March 17, 2009 9:09 AM

The other kind of interview questions that always bugs me is Give me some examples of how you resolve conflicts in a team. I always struggle to recall the last time I actually had a conflict with my team mates. It is usually implied that if you fail to provide examples, then you are either not experienced in teamwork or you are hiding something that may not be to your favor. In any case, having no particular answer to this question seems to be perceived as something negative.

But on the other hand, can't it be interpreted in a positive way? Maybe I have no answer because I do not create conflicts and I am good at actually _avoiding_ conflict with others? Or if I am a team leader, maybe I just built the team in such a way that possible conflicts are mitigated? Or I am just lucky to work with really nice people?

Maxim on March 17, 2009 9:11 AM


I responded to a question on this topic on stack overflow a couple of months ago.
What algorithms should every developer know?
http://stackoverflow.com/questions/445425/what-algorithms-should-every-developer-know/445589#445589

Fortunately I have since never had to have a job interview.
But if someone were to give me such a problem/question now,
I would probably come back politely asking the interviewers to
if we could discuss instead, in what ever detail they desire, my qualifications,
and what I know I can do for their company.
And if we could discuss the corpus of my work, my designs for real programming problems
I have solved, and my passion for programming.

How would that go over?
Is that the type of response the presentation of this type of puzzle question is supposed to elicit?
Otherwise, frankly, I'd be insulted.


Roger on March 17, 2009 9:24 AM

Was it just me or did that insanely difficult puzzle question example fail to include an actual problem? It just describes the situation and asks for a solution, without even specifying the intended result and that's ... well that's something you'd want a PR person to be able to solve. Programmers deal with defined problems.

Personally, if I were asked that puzzle, I'd give the most convoluted possible answer that, likewise, would not contain an actual answer to anything. They would surely hire me for seeing through their stupid game.

Swizec on March 17, 2009 9:26 AM

I just finished a discrete math class, which I was taking for the second time (run #2 was considerably more reasonable). The first time I took it, some of the questions on the final looked a lot like that one.

Jesse on March 17, 2009 9:40 AM

Do I fail if I ask what a watercooler presentation is?

Neil (SM) on March 17, 2009 9:41 AM

I have to agree with Kevin's simple answer, Good bye.

I no longer accept interviews with companies that don't ask for a phone screen first. By the end of the phone screen I try to determine whether I gave the company interviewing me enough information to justify hiring me and that of course I want to take the job. If I can't make those two qualifications I won't accept an interview. This ensures the interview is on point and hopefully nothing more than a rehash of the phone interview, with a show and tell of how I could bring value to the position added on. This enables me to avoid the stupid where do you see yourself in 10 years and other mindless brain teaser questions.

It's not worth working for a company that spends its limited interviewing resources asking you mindless brain teasers instead of verifying how you will bring value to it's bottom line. Those 401k packages and profit sharing plans will be short lived when they haven't hired anyone who can write actual code.

Finding a great job is not about learning how to job through the next set of hoops that HR creates. It is about ensuring that the company you are interviewing with can identify what skills it needs and making sure you have those skills. Last time I checked, knowing the number of gas stations in the country is not valuable to Microsoft writing a valuable OS. Perhaps that's why they ditched the practice.


A site I found years ago www.asktheheadhunter.com is excellent at separating sane hiring practices from questionable. I'd suggest anyone with a true interest in how to hire quality people or how to find a job for life to take a look. You'll never try to move Mount Fuji again.

Chris on March 17, 2009 9:42 AM

You solve any puzzle my unzipping and squirting cum on it.

Solutionman on March 17, 2009 9:47 AM

Switzec, If you'd follow the link you'd see that the quoted article starts with Here is a parody puzzle question...

AndyL on March 17, 2009 9:47 AM

Basically problem solving is making the problem go away, and I assure your that if you take my advice and unzip and blow a load at the problem it will go away

Solutionman on March 17, 2009 9:53 AM

I tend to agree that random, arbitrary stuff is kind of annoying, but I have come to understand the point a little more. To an extent, exercises like that just show how creative one can be with limited resources. The interviewer may be more concerned with your approach to solving the problem than how accurate your answer is.

Seth Thomas Rasmussen on March 17, 2009 9:53 AM

That is correct mr Seth, and nothing shows creativity more than unzipping an blowing a load on the problem

Solutionman on March 17, 2009 9:55 AM

I think i lost a little part of my brain when the monkeys started using prime numbers. :(

Joe Beam on March 17, 2009 10:04 AM

Agreed. A 10 minute water cooler presentation would be a great way to assess technical knowledge of an interviewee. Nice write up...

Andrew on March 17, 2009 10:06 AM

Lehman Brothers asked me a really hard puzzle question about three men in hats standing one behind the other. I didn't get it. The asian lady interviewing me got frustrated, and ended our 30 minute interview session after 4 minutes. What a dumb cunt. I hope she sucks dick for money now.

westwest888 on March 17, 2009 10:11 AM

It might be better to have the candidate give a presentation on something he's worked on.

Jake on March 17, 2009 10:16 AM

Matthew: These are estimation questions -- they require no trick or special knowledge. They have no 'right' answer since they are process questions. Because of that, I think they are much better than puzzle questions. And I think one or two questions in an interview assessing the estimation skill of an engineer.

There's a fundamental problem with this viewpoint, though: These questions do, in fact, have a clear and well-defined right answer. There is, in fact, a single number for the amount of $COLA_BRAND soda drunk in $STATE, and a single number for how many optometrists there are in Seattle for appropriate definitions of optometrists and Seattle (e.g., do you count the greater metropolitan area?) However, the interviewer hardly ever knows it, and hardly ever cares whether the answer that the interviewee gives is in fact anywhere close to it, so long as it sounds plausible.

And the thing is, in programming, that it's not enough to have an estimation process that sounds plausible and comes up with a number. Being able to do that is in fact dangerous if the numbers are completely off-base. You'd also like to come up with a reasonably accurate number, and with a good estimate of the uncertainty in that answer.

Brooks Moses on March 17, 2009 10:21 AM

@Swizec: Please, tell me you're not the Swizec who authored an article called something like there's no such thing as a stupid user?

Schmoo on March 17, 2009 10:32 AM

The moment I read that question about soda I rushed into the comments with Zero! I don't like any soda, so the exactly right answer is zero! And, naturally, there was a lot of answers like that already, and now my day is ruined...

Here's a good answer to the Mt. Fuji question: http://angryaussie.wordpress.com/2007/11/01/pointless-interview-questions/

Vladimir on March 17, 2009 10:42 AM

@Will:

Actually, my favorite soda *is* Moxie (look it up, boys girls), so unless the interview is taking place in New England, the answer is statistically close to zero.

Come to think of it...that answer might apply in New England, too.

jeffH on March 17, 2009 10:50 AM

I remember figuring out over a coffee break how many coffee swizel sticks we're likely consumed on a daily basis in Canada.

We figured it was about a cubic meter's worth.

Jamie on March 17, 2009 10:57 AM

How much of your favorite brand of soda is consumed in this state?

I don't drink store-bought, so my favorite brand would have to be the stuff I brew in my kitchen. In the past year, I've made 2 5-gallon batches, so I'd have to say: 10 gallons. Pretty good margin of error on that figure, too. :-)

Ken on March 17, 2009 11:03 AM

I once didn't get my dream job because they had some mental maths thing that we all had to pass.

I hadn't done the four fifths of 22 means it's Tuesday stuff in 20 years and couldn't do it without a lot of practice. If they'd asked me to do a presentation, or some questions about programming and project management I'd have had a fighting chance. I can do most of the programming problems without any prep - been doing it 22 years.

It was also very ageist, I don't do those kind of puzzles. I got my degree (1987) when most of the people in the room weren't even zygotes, if I'd had this kind of quiz *then* I would probably have aced it. I got a very high mark on the Java Certification exam, but that was because I studied for it. There was no way to practice for this kind of thing. In retrospect I'm glad I failed, because they must be idiots if they think it makes any difference.

Just a lazy way for the Human Resources (erm - I'm a person, hello??) to sieve people and be ageist without appearing to be. If they ask questions like that it's because they have nothing useful to do. Plus it cost me a train ticket to London, and they ain't cheap.

http://www.xckd.com/554/

Francis Fish on March 17, 2009 11:11 AM

What i generally dislike about puzzle questions is the ambiguity, some element that you're not told and that you have to assume. It's like being asked 100 questions at the same time.

Assumptions are critical and it's the first thing you try to work out, so being told to assume without consequence... i think it's a little pointless.

How well can you judge someone's thought process given that their assumptions are arbitrary? How much can you take from it?

Job on March 17, 2009 11:20 AM

Good Communication != Good Nurse

I get what you're saying with your recent nursing experience. I also agree that you cannot be an exception nurse (or programmer) without good communication skills.

Having said that, I would much rather have a nurse with sound medical skills helping my when I'm going into cardiac arrest then one who is friendly but cheated through nursing school. Likewise, I would much rather have a programmer with exceptional programming skills design the airbag system in my car and tells the worst water cooler story ever.

In conclusion, the worst nurses were invariably the worst communicators! only means that they are bad communicators. Maybe you can conclude that they are not exceptional nurses...

Now, hopefully, I communicated my point well :-)

Travis on March 17, 2009 11:21 AM

10 bottles of possibly poisoned wine? Clearly the prisoners are all ninjas.

3 PIRATES VS. 100 NINJAS! All other data is irrelevant.

Barnabas on March 17, 2009 11:25 AM

You could potentially take a shit right there in the interview chair. Maybe just when you get a question you know you can't ace you turn around and pull down your pants and spray them with shit. You know you can get a nice spray if you drink a lot of coffee.

You may think they'll get angry but the people they set to do these things are practically dead inside so they will not react normally they'll break a chuckle.

Try it, interviews is all about showing character and creativity. Stand out!

Solutionman on March 17, 2009 11:31 AM

It's nearly ubiquitous to force PhD level applicants for academic/science positions to do a job talk -- a one hour presentation/seminar on the subject of their thesis. After all, the applicant is someone who has just spent years working on one topic, and they ought to have something interesting to say about it.

Having been to many, I can safely say that ten minutes would probably be enough to judge their abilities, but it would be unfair to them to force 5 years of work to be summarized down to such a short presentation.

I guess academics do something right, then, even if they are long-winded about it. :)

AlexR on March 17, 2009 11:34 AM

Ok ok now I have it. The ultimate combo.

1. Ace the interview
2. Turn around spray shit
3. While turned around prepare dick
4. Turn back revealing the erect dick
5. Spray load
6. Watch jaws drop

If that doesn't make you stand out nothing will.

Solutionman on March 17, 2009 11:42 AM

As someone who poses interview questions a lot (and answers them rarely if ever) I must tell you, they are really important. Until we are allowed to give candidates IQ tests they are the best / only way we have to form an estimate of how smart people are, in the sense of how they think. And the interaction of working through a puzzle together gives you a chance to see how they think, how they problem solve, and how they handle stressful situations.

I like programming related puzzles (how would you model a pool table) and abstract questions (how many pathologists are there in the U.S.). They have to be solvable, by the way; questions which are too hard don't tell you anything. And questions which involve some kind of trick don't tell you much either.

Cheers...

Ole Eichhorn on March 17, 2009 12:00 PM

I hate puzzle questions too. At one point it became fashionable where I worked to post puzzles on the noticeboards outside your office. For awhile mine was:

e = 3
n = 343285878569830523580893306575740679545716377525420211495576158140025012622859413021647155097925923099079654737612551765675135751782966645477917450112996148903046399471329621073404375189573596145890193897131117904297828564750320319869151402870808599048010941214722131794764777262241425485454033215718530614228813758504306332175182979866223717215916077166925474873898665494945011465406284336639379003976926567214638530673609657120918076383271664162748888007869256029022847210403172118608204190004229661711963779213375751149595015660496318629472654736425230817703675159067350235072835405670403867435136222247715891504953098444893330963408780769325993978054193414473774418426312986080998886874132604721569516239658645730216315981931951673538129741677294786724229246543668009806769282382806899640048243540370141631496589794092432378969070697794223625082216889573837986230015937764716512289357860158816175578297352334460428151262720373431465319777741603199066554187639792933441952154134189948544473456738316249934191318148092777710386387734317720754565453220777092120190516609628049092636019759882816133231666365286193266863360627356763035447762803504507772355471058595487027908143562401451718062464362679456127531813407833033625423278394497538243720583531147711992606381334677687969597030983391307710987

What is p and q?

(Oh, and I doctored other people's puzzles to make them unsolveable. At least mine's solveable).

Dave on March 17, 2009 12:12 PM

... and I've just messed up the formatting on Jeff's page (sorry :-). In compensation I'll give my response to the Moving Mt.Fuji question, which is (a) how far do you want to move it, (b) how quickly do you want it moved, and (c) how much lithium-6 deuteride can I use in the process?

Dave on March 17, 2009 12:19 PM

Agree completely about how useful this style of interview question is. I can sort of see why they might be considered useful in allowing candidates to demonstrate their reasoning skills, but it must surely be much more relevant to give them an actual computing problem. Showing a spec and asking how to go about implementing it would demonstrate the same skill sets in a way that would be far more revealing.

But I donít agree with the 10 minute talk either. Even if you consider communication skills to be the most important trait of a programmer, surely the interview itself will tell you all you need to know about the candidateís relevant ability. A presentation is an entirely different type of communication, and one most programmers do not need.

Steve W on March 17, 2009 12:30 PM

I hate guessing questions. As a military officer I was trained to never guess. In one of the briefings I was present at, one of the officers asked a bunch of us cadets how deep we thought a stream was in the middle of the map. He listened to a half dozen people and then had us vote on how deep we thought the stream was. Everyone that had guessed a specific depth without any facts was then forced into a front leaning rest position and screamed at by a half dozen officers how they had just killed their entire unit because they f*ing guessed. Lessons like that stick.

Jimmy the Geek on March 17, 2009 12:39 PM

They are good for engineering jobs.
The 'trick' ones about telling the color of your own hat or the two guards in front of doors are useless - everybody has heard them.

But the how much does Mt Fuji weigh questions are good. I expect a civil engineer to be able to estimate rock mass and I expect a software engineer to be able to estimate I/O rates or how many clients a server can handle

mgb on March 17, 2009 12:45 PM

Until we are allowed to give candidates IQ tests they are the best / only way we have to form an estimate of how smart people are

@Ole
My question is do you really think an IQ test would realy show how a person thinks, or how qualified they are for a position.

I think asking questions that are related to the scope of work would give you a better indicator to what skills they have to do the job.

Jacob on March 17, 2009 12:47 PM

I agree that comunications skills are very important when you hire architect

ehhh on March 17, 2009 12:55 PM

The answer is Blue. NO! Yellow.

JohnOpincar on March 17, 2009 1:10 PM

I have a genius-level IQ and I hate with a passion stupid interview questions of the type that Jeff is mocking.

They don't get you anyone except those that are interested in mental masturbation, which is the type of people that they are also given by. But what they DON'T do is further the bottom line.

People that think these questions are good are exactly the type of people that spend weeks investigating a problem instead of just saying, Oh, well, Microsoft has a bug but we can work around it by adding a /table tag. And for everyone that just cringed when I said that, realize that your employer usually doesn't care if your website validates as long as it works on the 2 latest versions of IE and Firefox. And he WOULD RATHER that you not spend $10000 of his money figuring out how Microsoft screwed up and making a blog posting about it. He would rather you rolled the website out yesterday so that he can make more money.

A few people (including Jeff) have it right. Computer knowledge is always changing, so why bother testing people on that? What you want to know is:

1. Are they a good person and a good communicator?

No matter how smart or how good a coder someone is, if they are an island that can't communicate, you will end up rewriting their code when they are gone and they will cause friction in the office, because people will always be wary of them and their motives because of the lack of communication (as Jeff pointed out regarding the nurses). Also, you don't want harrassment lawsuits or theft, so try to make sure the person you are hiring has some morals.

2. Can they learn?

This career is all about learning. There are new things coming out all the time. I was actually turned down in a job because I didn't know something that was still in Beta in Visual Studio. That's dumb. It's not that I can't learn the latest Microsoft technology, it's that I haven't been exposed to it yet because it hasn't even come out yet. I've been busy adding value to my employer with solutions that work and are maintainable, not bleeding edge beta stuff that isn't even licensed for production code yet.

3. Past success is absolutely an indicator of future success

Make sure that the person can describe successes and failures in detail. Make sure they know WHY they failed and what steps they have taken since to prevent a reoccurrance. That goes back to learning. Also, listen to how passionate they were about their successes and make sure to find ones where they were involved.

For a technical question, stick to a broad topic not a specific command line option. Command line options can be looked up in 1 minute. Instead, ask them to describe the dangers of SQL Injection and how to avoid it or some other topic that good developers absolutely should know.

And ultimately, hire them on a trial basis of at least 30 days. If they aren't working out (for instance, a person with a Masters in programming asking what comma-delimited is), don't be afraid to let them go quickly, before they waste too much of your company's money.

And before you assume that I don't know what I am talking about, I helped hire most of the best people for a consulting company that has survived multiple recessions and wrote award-winning websites for the nationally-known industry leader in a certain vertical.

And we never used puzzle/IQ questions to do it.

Anonymous on March 17, 2009 1:38 PM

I am a full-time programmer and I find most people who aren't programmers have a tough time communicating with programmers. I'm not a sociable person, but I communicate just fine. Programmers actually tend to be highly effective communicators... to the degree that talking is usually the worst medium to communicate in.

Programming isn't a social practice. It's not a party where people hang out and get to know eachother. That's for college kids and sales people. Programming is a technical field and the best programmers want to be taken seriously as engineers, scientists, and craftspeople. This generally requires a lot of mental effort and discipline in maintaining mental focus.

I find that just employing a few rules and systems to manage communications is the best policy. It lets the technical people work without distractions and it lets non-technical people work with them without having to deal with their eccentricities.

For example, in my work place as policy I make sure that all technical issues are handled by our issue tracker. Nobody is allowed to walk up to my desk or anyone elses and discuss technical issues in face-to-face conversation. Firstly, it's distracting to have someone approach you and force you away from your thought processes on a whim. Second, technical issues are difficult to communicate in person either by misunderstanding or by failure to transcribe every nuanced or implied detail. By using an issue tracker we avoid as many of those problems as possible. The programmers stay happy and the sales/biz people stay happy.

It's a pain for people to get used to (especially the non-technical people), but things work more like a well-greased machine than a series of fumbles and kitchen fires. It's a middle-ground solution that keeps things moving.

Don't expect programmers to be sociable people. Just lay down a good system and a few rules and things will just happen regardless of anyone's social skills.

j_king on March 17, 2009 1:42 PM

I have a retard-level IQ and I love with a passion clever interview questions of the type that Jeff is mocking.

Heres one.

You are in an unlit room and placed in front of you are 100 coins. 40 is A side up and 60 is B side up(this is known to you). How can you split the 100 coins into two piles with equal amount of A side up?

allowed actions:
1. picking coins
2. flipping coins

Solutionman on March 17, 2009 1:47 PM

Correct answer is:

Pick out 40 coins and flip them(turn coin upside down).

You probably not smart enough to arrive at that simply shit, so just follow my previous advice!

Solutionman on March 17, 2009 1:52 PM

I interviewed at (and subsequently got an offer from) Microsoft last year and did not have to answer one puzzle question. YMMV.

Zach on March 17, 2009 1:55 PM

Congratulation on your new child!!!

Kevin Kitchens on March 17, 2009 1:56 PM

Reading some of the comments here, Iím starting to think these questions may have a use in screening. Anyone who reacts like some here to a problem they donít like is probably not going to have the maturity to handle the problems they are likely to encounter in the company.

Steve W on March 18, 2009 2:30 AM

About the prisoner/pirate/monkey puzzle; what is the puzzle? there is no actual question in there. Anywhooo... I guess my answer would be between -1 and the size of the collection of (non inclusive)

Kris on March 18, 2009 3:41 AM

Solutionman, I think you should start writing articles...
hehhehehehe
But, what jeff says is true and false..
This article isnt going to convince people from not asking the puzzle questions..
becoz some how everyone thinks that those who can solve puzzles can code..

chetan on March 18, 2009 3:44 AM

Really? I'm sorry you feel that way. I think presentation is a terrible way to interview programmers. Communication and Lexical skill while both desirable traits are sometimes mutually exclusive. In fact, I get terribly nervous around presentations, but that doesn't mean I don't have passion for my work. I always document my code well, and always have an eye out to be sure my programs are efficient and readable. My management reviews are always terrific. I just dislike presentation. *shrug*
Except if you used that as your pitch in an interview, you'd be very likely to succeed. It's clear, concise, and tells them what you consider important in your work. It's great presentation. Maybe you're bettter than you think?

Tom on March 18, 2009 3:47 AM

I've never interviewed anyone, but I always thought it would be good to ask the person to play Minesweeper on intermediate mode. Tell them that you only want them to make moves that they are certain about - if they can correctly state that there are no certain moves remaining, that would be considered winning. I think it would work well even if they have never played, to see them absorb a small set of rules.

I have watched many people play minesweeper and you often see people completely guessing, but also people who know a a few tactics, but that would rather guess than work through 5 or 6 squares to get to a square you can be certain about. It shows if a person is comfortable think with all their register variables active.


N. Velope on March 18, 2009 3:49 AM

I'd like to think I'd have the balls to say if you can explain the relevance of that question, sure, I'll have a go at it.

David Dawkins on March 18, 2009 3:52 AM

I've never interviewed anyone, but I always thought it would be good to ask the person to play Minesweeper on intermediate mode. Tell them that you only want them to make moves that they are certain about - if they can correctly state that there are no certain moves remaining, that would be considered winning.

I think I could win it before my first move.

Steve W on March 18, 2009 4:08 AM

More comments»

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Content (c) 2009 Jeff Atwood. Logo image used with permission of the author. (c) 1993 Steven C. McConnell. All Rights Reserved.