top | item 3004471

Ask HN: What % of your job interviewees pass FizzBuzz type questions?

50 points| tomx | 14 years ago | reply

I'm sent 100 resumes a month, then interview about ~10 people. Of those, about 50% can do FizzBuzz style questions. On paper, all of these ~10 people would be qualified to do the work, however (I think) some have become rusty, or focused more on management or other areas.

What percentage of your job interview candidates pass FizzBuzz style questions? Any tips to improve the signal to noise ratio?

117 comments

order
[+] patio11|14 years ago|reply
For folks who doubt the numbers people are quoting here: remember, if half the pool can't program to save their lives, guess which half of the pool will still be sending out job applications next week.

At a previous company where, for cultural reasons, lack of programming skill was not a barrier to being hired as a software engineer, approximately half of our software engineers could FizzBuzz. Of our outsourced coders, I'd put the number at one of the twenty I knew, and he would need extensive coaching to make it happen.

Some of these folks were at least moderately productive at tasks which you and I do every day which theoretically happen in an IDE but do not require much abstract thinking, such as changing labels on UI elements, adding new columns to tables (by copy/pasting a line which worked and tweaking it until output matched expectations), and the like.

[+] pixeloution|14 years ago|reply
Just curious if you expect perfect code on a sheet of paper or give them an IDE and say go for it.

As I remember fizzbuzz (print numbers 1 thru x, then fizz if divisible by 3, buzz if divisible by 5, fizzbuzz if divisible by both)

I did it in a text editor in under a minute. Got two errors because I did it without thinking, fixed it, and had a working solution in 90 seconds. It's taking me longer to write this response.

I can't imagine anyone who writes code daily who couldn't get this right in under 5 minutes given a text editor and a way to run the code, but I could imagine plenty of people who trying to do it on a sheet of paper who would make goofs. And most of those would make good employees.

[+] rmc|14 years ago|reply
I can't imagine anyone who writes code daily who couldn't get this right in under 5 minutes

Yes there are people who apply for programming jobs and do not write code daily, or even cannot code at all. FizzBuzz is designed to quickly identify them and filter them out.

[+] hga|14 years ago|reply
Back in the days when I did this (1990s) we did the C/C++ reverse a linked list and compute the factorial of a number. And, yeah, people made mistakes on a dry erase board under interview pressure, but it was very clear who has a clue vs. who couldn't program their way out of a wet paper bag.

These sorts of tests are low pass filters, they're not designed to find good or great programmers, just confirm that the person can program at all (as we define it). Since most people who call themselves programmers really aren't, they're highly useful. Anyone who's looking for perfection of this nature in an interview and who fails a candidate for lacking that is doing the latter a favor by not hiring them.

[+] dlikhten|14 years ago|reply
There. I wrote it too. 3 minutes, 1 major error in initial impl due to lack of sleep (used / instead of %). 8 lines of ruby. I would be quite surprised if someone could not do this in < 20 lines (of assembly) :P. Damnit now I want to whip out my x86 assembler and muck around.
[+] buro9|14 years ago|reply
On paper, and without any syntax errors.

But, to their advantage, they can select any language that they want.

[+] ericb|14 years ago|reply
In the actual interview, I find that most give up after spitting out some pseudocode. About 40% have reasonable psuedo code that makes me think they'd get there (but these half-answers don't give me enough confidence to give them a thumbs up).

Actual code that works (and running it from a terminal), we are seeing only about 15% tops maybe lower.

We have started sending a fizzbuzz-ish question, a relatively easy css question, and a word-problem about performance as pre-interview questions through recruiters. This has dropped our resume inflow dramatically and saved a lot of time, but that's depressing in a way.

We are looking for a Rails or PHP dev in waltham (near boston) currently without a lot of luck. The job has a lot of pros, but probably doesn't do itself justice on-paper.

[+] dhimes|14 years ago|reply
The job has a lot of pros, but probably doesn't do itself justice on-paper

Keep in mind that you may be getting a lot of good people with a lot of pros, but that don't do themselves justice on paper.

[+] acangiano|14 years ago|reply
> We are looking for a Rails or PHP dev in waltham (near boston) currently without a lot of luck. The job has a lot of pros, but probably doesn't do itself justice on-paper.

Are you attending local PHP and Ruby/Rails meetups and user groups? If none are available, consider starting one.

[+] rmc|14 years ago|reply
a word-problem about performance

Would you be able to share that? Simple programming/algorithm questions are a dime a dozen, but I'm curious what a word probably that's appropriate to coders would look like.

[+] wavded|14 years ago|reply
I failed FizzBuzz, I admit it. I was asked that as an interview question. I studied hard for my interview but I forgot about the mod operator and totally fumbled my way through the interview. I am now the Senior Web Developer and turned out to be a great asset to the company. But you wouldn't have known that from my FizzBuzz results. I also didn't have 'Computer Science' as a Major. Couple strikes. However they took a chance on me.

Since then I've been able to interview others and I look for different things than FizzBuzz compliance. I want to see how they solve problems in general. I want to see if they have any passion for what they do. I want to see things they've developed.

[+] corin_|14 years ago|reply
Can anyone explain how it is possible for people applying for these jobs to fail?

I dabble in code, but am no where near the level I would have to be to do any job in this area, I mean seriously. Took my two minutes to do it with a pen and paper in PHP, same with in JS, same in bash scripting.

How can anyone who isn't able to do this pretend to even have an interest, yet alone the ability to do the job?

[+] rmc|14 years ago|reply
Yes they apply. Yes, when you send you CV into companies you are competing with these people.

There are people with degrees in Computer Science who can't pass FizzBuzz. They think they aren't very good at programming, but think that the company will train them. There are all kinds of reasons why people who can't FizzBuzz apply for programming jobs.

[+] hga|14 years ago|reply
Good questions. I'm not sure myself, but I suspect the lure of $$$. Someone who's good at playing a sort of game I loathe can prey on companies that don't do good screening and keep a job for as long as a few months and sometimes indefinitely.

Heck, look at how much cargo cult programming goes on at companies from top to bottom. PG pointed out that one of the main reasons for dot.bomb failure was not being able to technically execute (sure, the company may still have been hopeless, but they didn't even get to test their sales proposition).

And a lot if not most companies simply don't focus on technical excellence or even simple competance. E.g. look at how the powers that be at Friendser let it wither on the vine because they assumes the tech was in the bag while their persued big deals, all the while ignoring for years (I think) that the system had gotten so overloaded it was essentially useless.

And, heck, if I had the time to mentor you and you were interested, I might take you on even at your current level. You "know your own limitations" today, but you're still, say, better than 70% plus or minus of the people who call themselves programmers. If you can execute the little stuff, I can teach you the big picture (with the aid of a book or two and some hard work).

[+] buro9|14 years ago|reply
I think that the lower the percentage, the more you need to improve your screening prior to getting the candidate in. It's just wasting your time and theirs.

I would love to say that you can tell from a CV whether or not they could pass FizzBuzz, but it's not true. I've interviewed MScs and PhDs that could not do FizzBuzz. Seriously.

The phone screener is your friend.

[+] elliottcarlson|14 years ago|reply
I have used various interview questions, including FizzBuzz, factorials and other questions, and I would say the success rate I saw was about 20%. My personal favorite question is to have someone write a shuffle function without using any built in randomization functions - however most people give up, and others can't follow simple directions and wrap their head around the problem. This particular question had more of a 5 to 10% success rate.
[+] iron_ball|14 years ago|reply
Do you meant that they can't use Array.shuffle() or Array.sort(<some built-in random function>)? Or that they don't get any external source of randomness, even a 0.0 - 1.0 float?
[+] ajuc|14 years ago|reply
I have question to recruiters:

if job requires "Hibernate" and I've used hibernate in my previous job, but have never configured it from scratch, only tweaked some models, wrote some EJBQL queries - does this count as "knowing Hibernate"? I've also never used Hibernate annotations, becasue we use hbm files, and we have templates to make the, so I'd have problems writing such file from scratch.

Do you check knowledge of required libraries on the blackboard? Do you assume people should know all the corners of such libraries, or do knowing some things and wanting to learn more if it will be needed suffices?

I use at work jboss, hibernate, jbpm, and many other technologies that are often mentioned in job offers, but I don't feel I can say I know them - only the parts that I needed to do the job. Is this considered not enough?

[+] ig1|14 years ago|reply
Generally speaking you don't need to match a job description 100%, if you match 60-70% that's fine. Depending on the job description you can tell which things are key to the job (programming language, and specialist skills like machine learnings which are core to the job) but everything else is mostly optional.

The more of the description you can match the better it is, but 60-70% will get you an interview in most places.

[+] chollida1|14 years ago|reply
I've actually asked this question as a gentle warm up for people, and we achieve around a 90% success rate.

On average it takes people around 5 minutes to do.

We have people do it on a whiteboard to get them standing up and moving.

[+] cantastoria|14 years ago|reply
I'm curious what candidates are getting stuck on. Is it the testing for divisibility that's tripping them up?
[+] DrJokepu|14 years ago|reply
Mostly they just don't know how to start. They can't break down the problem into subproblems. Once a candidate managed to break down the problem to subproblems, they can always do the rest easily (solving the subproblems, composing the solutions to solve the main problem).
[+] Tichy|14 years ago|reply
For me the hardest part would be remembering a print function that does not automatically insert a newline. Although I suppose as a workaround assembling the string before printing would work, just less elegant.
[+] rmc|14 years ago|reply
If you cannot programme, you would not be able to do this problem. There are people who cannot programme applying for programming jobs. Shocking, but true.
[+] pixeloution|14 years ago|reply
OP may not be actually using "FizzBuzz" as he said a FizzBuzz-type problem :)
[+] DrJokepu|14 years ago|reply
In my experience, about one in five (20%) people I get to interview can solve basic programming problems on a whiteboard (in their language of choice). It's really depressing.
[+] ColinWright|14 years ago|reply
We now insist on resumes being accompanied by the answers to set "homework." No answers, no interview.

We get about half our interviewees unable to solve problems that are similar or easier during interview. Whether that's nerves/stress or simply an indication that they got someone else to do the homework for them we don't know.

One candidate even phoned a friend during the coding part of the interview to get some answers. For some jobs he'd be hired, but not for most.

[+] aplusbi|14 years ago|reply
I've never asked FizzBuzz but I do regularly ask coding/algorithm questions. They are usually more difficult than FizzBuzz. I'd say around 80-90% can at least come up with a solution in 45 minutes with some help. Probably less than 10% can come up with a good solution entirely on their own.

I attribute this to two things, first I think our phone screenings work well enough to keep out people who really can't do FizzBuzz, and second that I'm fairly generous during interviews. I often don't expect real code, sometimes I'm satisfied with just a discussion of the algorithm (no white board coding at all). I don't expect code to compile and I even let candidates use undefined "helper" functions (although I usually only allow that if I get the feeling that they could implement them if asked).

* For those that are curious I have two favorite questions - print out all the permutations of a given (ASCII) string and describe a search algorithm for a sorted array that has been split in two and the two pieces have been swapped (i.e. - 4,5,6,7,8,1,2,3).

[+] pp13|14 years ago|reply
@aplusbi

Let's say I interviewed you. I had asked to implement the fastest algorithm to give back the largest palindrome of words in English dictionary and compare it the largest palindrome of the french language. What the best solution you can come up with in 45 minutes.

After, that I asked you, write a simple ftp server, in the language of your choice. With your first solution, I asked you implement a SSL library and add it to the ftp server to make it sftp.

Based on that I can judge how good of a programmer you really are.

Sorry for being sarcastic, but I think most interviewers are on a power trip. They ask questions that if they heard for the first time, they couldn't come up with answers either.

I think your better off really talking about and going in depth with the programmers experience. If your experienced yourself, you should have no problem.

[+] schulz|14 years ago|reply
I did a ton of interviewing a few years ago ~ 100 interviews.

I found about 10% nailed it right away with code that would compile and run. These were generally people who had been coding a lot recently.

Half of the rest (say 45% of total) got close: Minor syntax errors, logic errors, stuff that an IDE/non interview situation would have fixed.

45% just spaced. Couldn't right the for loops, conditionals. Couldn't write basic code.

[+] spamizbad|14 years ago|reply
4 candidates, 2 passed FizzBuzz. Oddly, the two that failed had a Masters in CS (albeit no BS in CS).

Of those that passed: one had Masters in Library Science looking to change careers. The other was a fresh out of college CS major from Illinois State.

Next batch, I think we'll add another trivial question: count the number of vowels (a, e, i, o, u) in a string.

[+] pixeloution|14 years ago|reply

  <?php

  $string = "aeiouxabcd";
  $checkfor = array('a','e','i','o','u');
  $count = 0;

  for($x = 0; $x < strlen($string); $x++) {
    if(in_array($string[$x], $checkfor)) {
  	 $count++;
    }
  }

  echo $count . "\n";
Am I hired? Or do I lose cool points for PHP?
[+] aplusbi|14 years ago|reply
I've been involved in a lot of interviewing/recruiting especially of recent graduates. I don't have hard numbers, but it seems to me that the candidates who have masters degrees tend to do worse.
[+] wpeterson|14 years ago|reply
The percentage of people who can complete a basic coding challenge during interview is more a testament to your phone screening than to the population of candidates.

If you're not weeding out these people with a 10-15 minute phone call you'll waste a lot of your and their time.

[+] albedoa|14 years ago|reply
This post by Jeff Atwood might be of interest to you if you haven't read it:

http://www.codinghorror.com/blog/2007/02/why-cant-programmer...

[+] tomwalsham|14 years ago|reply
The fascinating thing about that post is the number of sneering comments, with their own (broken) implementations of FizzBuzz. At a glance only maybe 20-30% of solutions in the comments there actually work, and many are horribly suboptimal.
[+] petercooper|14 years ago|reply
Of those, about 50% can do FizzBuzz style questions. On paper, all of these ~10 people would be qualified to do the work

If it's for a programming position, the "paper" is lying in this case. If someone is claiming to have experience or qualification in certain areas that they can't even perform basic operations in, they're fraudsters.

It'd like trying to hire a surgeon and have someone turn up who doesn't even know what lymph nodes are. Dangerous and unhireable, but sadly a lot of employers put up with this sort of nonsense.

[+] eftpotrm|14 years ago|reply
That sort of thing specifically, never actually tested it.

The last test I did help administer was for a VB+SQL job, and the first question was to write an example of a valid INNER JOIN. I'd say at maximum 25% of the candidates could do this.

Improving SNR? I did once have a potential employer get me to do a time-limited online test. If you wanted you could always stick your questions into one of them, so you can at least do the fizzbuzz-level screening without calling them in and sitting them down.

[+] tomjen3|14 years ago|reply
I think the reason you got so bad responses on the first question wasn't that they couldn't write the join statement but that they had heard the distinction between the different joins once in college and then never considered them again.

I bet that if you had asked for an example of a sql code which would list all the employees born before 1980 along with the department they worked for and the name of the head of that department, you would have gotten a much more useful result out of that.

That query is, incidentally, much more difficult to write.

[+] lrm242|14 years ago|reply
How are you asking the questions? Good interviewers try to adapt to the person they are interviewing. Depending on how you're asking the programming question, you might want to think about changing it. If, for example, you sit back in your chair and ask someone to go to a whiteboard to write code you should consider that some people simply are not going to respond to that sort of method of answering, even if they are a brilliant programmer.