60

When it comes to "interview test" questions, the subject of FizzBuzz often comes up. There is also a Coding Horror post about it.

Now, if you bother reading sites such as this, you are probably less likely to be in the demographic of programmers who would find FizzBuzz anything but trivial.

But is it really true that 99% of programmers will struggle with it?

Really?

What is the evidence to back this up?

Some real-life examples would be very helpful in answering this question.

DanSingerman
  • 1,681
  • 3
  • 15
  • 14
  • 57
    It's not 99% of programmers, it's 99.5% of **applicants** (many of which are not programmers). – webbiedave Oct 29 '10 at 17:52
  • 4
    I didn't believe it until I got it on an interview- I later got the job, and later still chatted with the ceo about it. Apparently 99% is about right. O.o – Fishtoaster Oct 29 '10 at 18:19
  • 3
    I always thought fizzbuzz questions were a myth, or maybe just for fresh-out-of-college beginners, but then one day I actually was asked at an interview. Yeah, do many candidates really have trouble with this? – DarenW Nov 12 '10 at 16:39
  • 2
    I routinely give out the FizzBuzz test at interviews and routinely have people fail it. One graphic designer passed it one day though..... Surprised me a bit :) – Brandon Nov 13 '10 at 03:05
  • 4
    @Rogue Coder - Hey, we're not stupid, just weird. And most of us suck at math. – Inaimathi Nov 13 '10 at 03:09
  • 1
    @Inaimathi I never implied you were stupid, I work closely with a Graphic Artist who is smarter than a lot of programmers I know. I merely implied I wouldn't expect a graphic artist to pass a programming test, as I wouldn't expect a programmer to pass a graphic artist test – Brandon Nov 13 '10 at 12:03
  • I also thought that this is unreasonable until I let some people in my team take the original FizzBuzz test as described in Coding Horror. All of them have an eductation as programmers and some practice. Now I wonder how realistic the 1% pass rate is. – user281377 Dec 22 '10 at 14:27
  • 1
    To add to webbiedave's comment: People who can't program apply for more jobs than people who can (because they keep being rejected). Joel on Software [discusses this](http://www.joelonsoftware.com/items/2005/01/27.html). – Brian Feb 05 '14 at 15:39
  • @Brian nonsense. People are rejected without programming ever coming up. Age is a major factor, in my experience job hunting over the years I KNOW I won't get the job if the person interviewing me is under 40 and/or female for example. There's just this idea in IT that people over 25 don't make good programmers, so if you have a few grey hairs and/or aren't built like an athlete you're at a serious disadvantage. I've been rejected for being too nervous ("you're obviously hiding something") and for not being nervous enough ("you're clearly not really passionate"), even for being single, etc. – jwenting Feb 05 '14 at 16:01

16 Answers16

46

99%? No. A significant percentage? Yes. From my own direct experience of interviewing people I can testify to this one. It might seem insignificant to you but there are a lot of people in the programming field who have more or less faked their way through for years and apply on non-entry level positions and fail this one.

Even if you CAN easily solve it, but you give me huge static about being asked to do such a menial task will count against you. Being on a team means having to sometimes do things you might not enjoy but are necessary. If right off the bat, before we've even started to work together you think it would be best to try and assert your special status of being above doing something I've asked you to do then it will act as a mark against you.

I don't care necessarily how elegant your solution is (although that would be nice) but seeing you take a stab at it on a whiteboard and talking your way through it shows me that you're at least willing to take a stab at it. If you get indignant and say something along the lines of "I'm a problem solver, not a code monkey!" then you will be knocked down a peg.

I have had interviewees just flat out refuse to even begin to attempt it. Just simply refuse. No. Uh uh. Won't do it. I ask one or two more polite questions, thank them for their time and close the interview off.

I say this as a manager and as a developer.

Todd Williamson
  • 2,358
  • 15
  • 19
  • 1
    What are their grounds for refusing to attempt it? – Jon Hopkins Nov 12 '10 at 16:46
  • 3
    I never directly asked them. After their second refusal I would ask a couple more questions and then close the interview out. If I was going to GUESS it would be that they were too nervous to try (if I'm being charitable) or that they cannot in fact figure it out on the spot (if I'm being more cynical). – Todd Williamson Nov 12 '10 at 17:04
  • 1
    I know a guy who refuses to code in interviews. He also refuses to commit to memory anything he can lookup in a few seconds of Googling. He's a "problem solver". – kirk.burleson Nov 13 '10 at 01:39
  • 4
    Then again, whiteboard coding is a problem that the interviewer gives to you… that needs to be solved, perhaps? To me refuse to code in the interview is equivalent to refuse solving a problem that the interviewer has. Hence contradiction to the term "problem solver" and it's more like the guy is a "problem refuser". – Spoike Jul 07 '11 at 06:56
  • @Spoike nope because problems solvers don't need to know the syntax of any programming language, now do they? – Pierre Arlaud Aug 05 '14 at 09:36
  • @ArlaudPierre Some candidates come in to interviews think they need to answer everything perfectly, but usually (in my experience) the point is to see if the candidate doesn't have any bad behaviors. This is apparent at code interviews if the candidates (and the interviewer) is willing to improvise and collaborate (nice traits) or is either refusing or scoffing at details (signs of a jerk). In this case you could always ask the interviewer if it is okay to solve it in another programming language (which I've done and have landed a job for). – Spoike Aug 05 '14 at 10:35
  • @Spoike Of *any* programming languages, some guys can't code in a single language but will tell you they won't do the test because they don't know the syntax without google :D – Pierre Arlaud Aug 05 '14 at 13:08
  • @ArlaudPierre So how about "pseudo code"? ;) – Spoike Aug 05 '14 at 14:35
25

I think that 99% of programmers who apply for a job (and don't get it) may struggle over it. But not 99% of programmers that are productively holding a job.

That's the nature of our modern job-seeking process. Many people who apply are not qualified.

That Coding Horror post also speaks to the way we teach Computer Science nowadays. In the past (particularly at MIT), you were required to learn things like Lisp, which pretty much requires you to grasp concepts like recursion.

Nowadays people are taught Java because it is widely used in industry, and the focus has shifted to syntax rather than deep programming thinking. I don't dislike Java; in fact, I think it's an ideal first programming language. But I have not seen my instructors teach deep programming principles with it.

Robert Harvey
  • 198,589
  • 55
  • 464
  • 673
  • 11
    Yeah I think our education system (at least in the US) is a big part of this. I know someone who got a 2-yr degree in Software Programming, graduated with honors, and couldn't read or write code. – Rachel Oct 29 '10 at 17:22
  • 8
    The argument against teaching Java is a weak one. Concepts can be taught in most languages (recusrion is easily written in Java for eg). I don't disagree that teaching of the concepts taught are getting weaker, but I don't blame it arbitrarily on the implementation language. – Steven Evers Oct 29 '10 at 17:42
  • 1
    Oh things like Recursion get taught, they just don't get used. You get the same grade for writing a 100 line IF statement as you do for writing a recursive function (at least you did where I went), and the 100 line IF statement is easier to write when you're in a hurry (i.e. you've skipped doing your homework until 5min before you need to turn it in) – Rachel Oct 29 '10 at 17:47
  • 1
    @SnOrfus: Nor do I blame it on Java. I didn't make an argument against teaching Java. Yes, you can teach these concepts in Java, but I haven't seen that happen, not in the Java classes I took, anyway. That said, MIT originally chose Scheme for their introductory programming classes, because it has a very simple syntax, so you begin thinking about programming concepts early, without having to focus a lot on the language syntax. – Robert Harvey Oct 29 '10 at 17:49
  • During my undergraduate, we were forced into Java (learning oop), C (low level networking/ system calls), Sparc (assembly for the good of understanding how it works below C), Scheme (It really taught me recursion to build a recursive decent parser for scheme in scheme) to name a few. I feel although I am not expert in any language, I am comfortable enough to 1. teach myself anything I need to know and 2. retain the information by learning concepts not cutting and pasting code. Great answer. – Chris Oct 29 '10 at 17:50
  • @Rachel Re:"(at least in the US)" come on, it's worldwide. – P Shved Oct 29 '10 at 19:41
  • @Pavel I wouldn't doubt it, but I didn't want to assume anything – Rachel Oct 29 '10 at 19:59
  • 4
    Who on earth goes to a university where they "teach Java". Programming language schools are less than useful (regardless of it being Java, C++, Lisp or whatever); is that what you have in the US? Where *I* studied CS, you more or less taught yourself the prog language as required (an exception would be the Paradigms class, I guess). University courses taught math, CS theory, multiple programming paradigms, calculus, etc. Anyone graduating from that can easily solve FizzBuzz, because we had to solve harder problems just to pass the courses. – Andres F. Nov 14 '12 at 15:29
  • I understand and have used recursion in home software but would _Never_ use it in any of my production systems. To explain I write code for small embedded targets where the 2Kbytes (yes 2048 physical bytes of memory, count them all) is a large processor. The risk of a recursive function call causing the stack to overwrite my statically allocated memory is just too great to allow the use of recursion. – uɐɪ Feb 05 '14 at 15:49
  • @Rachel I don't even think you can blame teaching methods at this point. After my first 2 weeks in grade 11 programming class, I could have written a solution to this problem. No matter how bad they teach, if you're exposed to this at all for a 4 year program, you should be able to solve this problem – Cruncher Aug 05 '14 at 14:16
  • @Cruncher I personally went to school with someone who graduated (with honers) with a 2-year Associates Degree in Software Applications and Programming, and they could not write a FizzBuzz program. On our final project I asked her to add 4 lines of code which simply created 4 classes, using different parameters for the constructor arguments, and even gave her the first one for an example, and she couldn't do it. There's no reason she should have graduated with that degree, especially not with "Honors". That is why I don't trust the for-profit school system. – Rachel Aug 05 '14 at 17:08
  • @Rachel: An Associates Degree (at any institution) will get you through the *basics.* Granted, a person with an Associates should really be able to write FizzBuzz, but if you look at some of the online MOOC programs, the meaty topics are in the graduate programs. – Robert Harvey Aug 05 '14 at 17:12
20

I hate to say this but

The main reason I've seen programming questions fail to get answered is the fault of the asker rather than the answerer.

I can clearly remember one interview where I was being asked how to create a particular collection search algorithm that would run in constant time (Same number of look ups regardless of how many items in the collection). I fumbled and bumbled on it for 20 minutes before giving up. It was then that this genius doing the interviewing proceeded to demonstrate the answer as being something that operated in nearly constant, but still not constant time. A bit like saying "Give me an answer of zero" and then accepting 0.1.

Short of it is that I've seen too many cases where someone interviewing is asking a question that fails to meet the following criteria:

  1. They know all the possible correct answers.
  2. They know why the correct answers are correct.
  3. They know how to actually provide enough information without giving the answer away.
  4. "Problem solving" questions do not rely on knowledge of an undisclosed fact (this is the biggest issue I've seen).
  5. It would take less than 1 minute to write the answer if you didn't have to figure it out. If it would take 5 minutes just to type the code, it really requires more problem solving than can be fit into the verbal portion of the interview.
  6. Questions are based on more than just "A problem I ran into once or I was given in school and so you should know how to solve it right now". I'm going to bet you had more than 2 minutes to answer it, why aren't you giving the candidate the same courtesy.

Seriously (1), I think asking people to write code in the verbal portion of an interview is stupid.

Seriously (2), I think interviewing people without asking them to write code is also stupid.

Seriously (3), You should either give them "homework", ask them to bring in code samples, or give them a laptop and couple of questions and quiet office to work on them. Then leave them alone while they work on them. I usually go with the latter approach as it limits their ability to get outside help (cheat) and I can time box it.

MIA
  • 5,264
  • 19
  • 29
  • Did you have a discussion with the interviewer explaining why their solution was not constant time? If I were the interviewer and you were able to succinctly and without malice convince me I was wrong I would hire you on the spot. – Nemi Nov 12 '10 at 18:20
  • 1
    @Nemi - Yes I did. The person in question wasn't one with hiring authority, but I did get an offer on the position. – MIA Nov 15 '10 at 01:28
  • 8
    `int? result; for (int i = 0; i < int.MaxValue; i++) { T item = (i < array.Length) ? array[i] : someDummyItem; if (item == whatWereLookingFor) result = i; } return result;` - constant time :) – configurator Jul 07 '11 at 00:31
  • Correct me if wrong, but I think hash tables have constant access times, assuming they are done properly and there are no collisions. Therefore, a search using a hash function should be possible in constant time. – Trylks Feb 05 '14 at 15:32
  • Hashes can have collisions. That's why its usually stated as amortized constant time. – Rig Feb 05 '14 at 15:49
10

I've read the Coding Horror article you mention, and my opinion is that Jeff is right... but when is the last time he got interviewed?

When you are interviewed, you are usually in high stress, and you often have to answer to theoretical questions (no intellisence, no google, no resharper, ... only your memory troubled by stress). That's the same in tests. Stress doesn't help you.

I've noticed that the only way to know if someone is suitable for a position is to work with him for a while... Just take the last 10 persons you hired out of 100 (maybe more), how much was a really good hire???

An employer should hire a problem solver, not a code monkey that know about modulos.

You can't test "for a while all applicants", so interviewing them is required. That's why I focus my questions on that (problem solving) and do past reference check.

My opinion is that the FizzBuzz is dangerous for the company that is looking for developers to substain its growth.

  • After a bad hiring experience some years ago, I decided to give a new hire a simple coding problem to solve, that was relevant to our business domain. I didn't want a finished product; I just wanted to know what his thought process was. He did well on the test, and turned out to be a very good hire. – Robert Harvey Oct 29 '10 at 17:24
  • Technical questions are OK, including FizzBuzz, but they shouldn't disqualify someone if he fails. In the literature I read, it looked like someone that fail the FizzBuzz test shouldn't be hired at all. –  Oct 29 '10 at 17:28
  • @Pierre303 Great answer! P.S. You have a typo on 'theoretical' :) – Nathan Taylor Oct 29 '10 at 17:38
  • 28
    IMHO the problem here is that FizzBuzz is such a lowball question that if you can't answer it even under stress you deserve to have people laugh in your face if you call yourself a "programmer". If it was something *slightly* more complicated, like "implement a bubble sort", then these excuses and concerns would be justified, but not for FizzBuzz. – dsimcha Oct 29 '10 at 17:38
  • 23
    Fizzbuzz is good at what it's for: filtering the people who know _nothing_ from the people _something_. And knowing _something_ may still not be enough to do the job. It's not a hiring decision test, it's a "are you going to be wasting my time in an interview" test. Some hiring managers try to take fizzbuzz too far to have it do their job for them. – Steven Evers Oct 29 '10 at 17:40
  • 31
    My goodness, modulo is not some sort of esoteric operator. It's a core operation that all developers must have experience with if they wish to call themselves professional programmers. Regardless, if someone can write FizzBuzz it doesn't mean you hire them. It's just a quick starting point to see if this person can even **attempt** to layout the **control flow** needed to complete the task. – webbiedave Oct 29 '10 at 17:40
  • dsimcha, SnOrfus, webbiedave: You are right, but why 99% of people being interviewed, that have accomplished things in the past, fail to this question. I believe the problem is not the 99% programmers (not even the 1%), but the question itself. –  Oct 29 '10 at 17:46
  • @Pierre 303: At the same time, another question is "did they really accomplish things and if they did, how well?" Things can sound great on a resume, but in reality it may be that another dev did a lot of the work, or the candidate's code was atrocious, or any number of other deviations. – Adam Lear Oct 29 '10 at 17:52
  • 3
    @Pierre: The article states that it's 99.5% (199 out of 200) of *applicants*, not programmers because **many** people who apply for programming jobs have never actually held one before. I'm sure the number is exaggerated but the true number is no doubt staggeringly high (from my experience). – webbiedave Oct 29 '10 at 17:54
  • webbiedave: so when the applicant do the test? –  Oct 29 '10 at 17:56
  • @Pierre: Another important component of the test is the **speed** in which the person can complete the task. It shows how second nature control flow for a simple problem really is to them and this will impact your team's timeliness. – webbiedave Oct 29 '10 at 18:00
  • 1
    @webbiedave: I'm happy I never been interviewed by you ;) Seriously, I promise I'll try to ask that question in all my future interview, and if I get 99% of failure, I'll send you a box of true belgian chocolates ;) –  Oct 29 '10 at 18:03
  • 2
    lol, pierre! I'm sure you would pass my interviews, especially if you brought the chocolates! – webbiedave Oct 29 '10 at 18:04
  • 12
    I think that FizzBuzz is useful simply because it is so mind-bogglingly trivial. It requires a for loop, two if statements, modulo and print. Anybody with any meaningful programming experience should be able to bang it out while hardly a thought. If someone struggles with it in a interview, I consider that a perfectly valid litmus test. – Adam Crossland Oct 29 '10 at 18:16
  • I'm with @Adam Crossland, what part of the solution is the culprit? The loop, use of mod or if/then logic? – JeffO Oct 29 '10 at 19:19
  • 4
    If you're looking for an intermediate/senior "problem solver" then it is even **more** important for them not to falter on such a basic task. I don't know what your job entails, but mine involves a substantial amount of stress and thinking on my feet, quickly whiteboarding and banging out code for customers or other team members. If an applicant can't handle the pressure in a simple interview, how are they going to handle it on the job? This is just wrong, wrong, wrong. There are *many* ways to measure somebody's competence without wasting hours upon hours trying to work with them. – Aaronaught Oct 29 '10 at 19:59
  • I'm afraid of highs. Some people are afraid of talking in conferences. Some are even afraid of spiders. Are they all bad developers? Certainly not. Interview is maybe simple for you, but it's not for most people. –  Oct 29 '10 at 20:07
  • @Pierre, sitting next to a person doing the FizzBuzz watching how they work, and answering whatever questions they may have, tell you a _LOT about how they work. –  Oct 29 '10 at 20:20
  • 3
    @Pierre 303: Unless you conduct interviews on a tall ladder, in front of an audience, and while the floor is crawling with spiders, that's not really a valid comparison. ;) Those are all legit phobias, but they aren't typically found in a dev's day-to-day life. Writing code (often under pressure), however, is. – Adam Lear Oct 29 '10 at 20:38
  • Anna that may be a very good test :) not sure if the applicant will want to work for me if asked to do that :) –  Oct 29 '10 at 20:41
  • @Anna Lear: That's not a fair statement. Many software developers are introverted. As well, data supports that there is a high incidence of Asperger Syndrome (and social anxiety disorders in general) amongst them. Stress in an in-person interview is a very real consideration which has effects similar to more classic phobias. – Steven Evers Oct 29 '10 at 21:08
  • SnOrfus: and panic attacks during interviews. –  Oct 29 '10 at 21:10
  • 11
    @snorfus: Filed under "somebody else's problem." I'd much rather miss the boat on one good developer with crippling social anxiety than waste precious time and money training and waiting for results from somebody with no aptitude for programming. Can't handle yourself around other human beings? See a therapist. – Aaronaught Oct 29 '10 at 21:11
  • @Aaronaught. It's infortunate that you think that way. Being mindful and accommodating of disabilities, both mental and physical, is something that I strive for and hope that humanity as a whole can strive for. – Steven Evers Oct 29 '10 at 21:29
  • 5
    @Snorfus: Sorry, last time I checked, "social anxiety" wasn't listed on the ADA, AODA or any other Disabilities Act. Honestly, first it was ADD, then it was SAD, now it's Social Anxiety, must we call every personality problem a disability now? I strive for building *competent* teams and hope that humanity as a whole can strive for the same. You can conduct your interviews however you like but I have no use for people with victim complexes. – Aaronaught Oct 29 '10 at 22:53
  • 5
    Many programming jobs require a surprising amount of social interaction and even public or semi-public speaking. While recognizing that some folks have more difficulties with social anxieties than others, there are coping mechanisms that can be learned and practiced, even if you have Asperger's. If you do suffer more then typical from social anxiety it may be just as important to improve your coping skills, as to learn what the modulus operator does. – Charles E. Grant Oct 30 '10 at 02:20
  • @SnOrfus: I agree that people with social anxiety would have problems in an interview. However, if their actual job also requires collaboration and on-the-fly thinking (I'm not talking about sitting quietly in a cubicle, coding away), I don't think it is that much different. In addition to coping skills, there are also medical treatments for social anxiety (although admittedly, not so much for Asperger's, far as I know). – Adam Lear Oct 30 '10 at 03:31
  • 1
    @Aaronaught, There are _no_ disabilities listed in the ADA, and the AODA isn't concerned with employment. Either way, even though there's lots of scary acronyms, they are medical conditions and not "personality problems". Some studies show that aspergers syndrome is advantageous to a career in software development. So I think that I will conduct my interviews as I like, and hire competent developers, without restricting myself to the ones that sound like they are in a 1hr interview. – Steven Evers Oct 30 '10 at 03:58
  • 1
    @Aaronaught. We'll have to agree to disagree then. I have no desire to continue an argument with a developer that I have can respect. – Steven Evers Oct 30 '10 at 19:10
  • 2
    As promised, I started to ask this question in my interviews. After 5 or 6 interviews, no one was able to solve it completely. I had partial solutions, but looks like the problem is the modulo. And many code written don't even compile. All of theme but one were fresh students. One was "experienced" (8 year .NET development). My sample is too small to make conclusions, but I must agree I'm a bit confused today. –  Nov 21 '10 at 09:08
10

All you need to do is search on FizzBuzz. There was a huge wave of blog posts on it. Generally speaking the blogger said "I told people to write it in [some language] and here are the kinds of mistakes they made:" and then listed some pitfalls. The fun starts in the comments where people say "ha! that's trivial in [some other language], all you have to write is this:" followed by code. The next comment invariably finds bugs in that first one. Seems like some very good devs don't get it right the first time, in any language. Some of the errors:

  • I asked for 1 to 100 and you did 1 to 99 or 0 to 99
  • messing up on whether to print the number along with fizz and/or buzz
  • disagreements on "fizzbuzz" vs "fizz-buzz"
  • missed optimizations, like comparing twice when once would do
  • lots more

When I'm hiring, I ask people to code at the whiteboard for me, nothing anywhere near that complicated (I know, you don't think it's complicated) and many candidates fail utterly. I mean like writing vb-style If, Then, End If but putting braces as well (just to be on the safe side I guess) or writing C# (and asking first, C#?) but having not one semi colon anywhere. Don't start me on logic errors!

Kate Gregory
  • 17,465
  • 2
  • 50
  • 84
  • So some come up with a solution, but not the best one? – JeffO Oct 29 '10 at 19:21
  • 2
    @Jeff most devs first write something that would not compile. The good ones take a look and fix simple syntax errors. Stressed out good or calm ok programmers write a function but no code to call it, write something that isn't super optimized, suffer (and don't spot) an off-by-one, or may miss a syntax error or two. Horrible programmers write code that is nowhere near compilable, does the entirely wrong thing, etc. For example looping to 3 or to 5, since those are in the question, instead of looping to 99 or 100 or 101 (ish.) Or even no code at all. You really can't believe it till you see it. – Kate Gregory Oct 29 '10 at 22:32
  • 7
    If {"If {} Then {} EndIf" qualifies as failing utterly} Then {Your interview style is defective and/or you're amazingly lucky to be able to dismiss a candidate on such a trivial basis} EndIf – Sparr Oct 30 '10 at 09:46
  • @Sparr - this isn't some 30 second thing they get one chance at. This is a conversation at the whiteboard. Mistakes are fixed, questions are asked and answered, and if a person is that confused about what language they are using after a few prompts, it's just not trivial. – Kate Gregory Oct 30 '10 at 14:27
  • 7
    I program in at least a dozen languages on a monthly basis. Sit me down in front of a computer and ask me to work in one that I haven't touched in a month and I'll make mistakes like that for the first five minutes while I get back in the groove, usually having my mistakes pointed out by the compiler or interpreter. – Sparr Nov 01 '10 at 01:06
  • 2
    @Sparr - sure. So at the whiteboard if I ask you to look it over, you'll probably spot it and say "oops - I use a lot of languages." If you don't, I'll say "what language did you write that in?" and then you will. It's not a trick question or a trap. Some people have actually never written code and claim that they have. That's the point of questions like this. – Kate Gregory Nov 01 '10 at 10:31
  • 2
    But I think those questions aren't good for that. I couldn't tell you, five minutes before this comment thread started, whether VB required braces around code blocks. I could have told you that If/Then/EndIf looked mostly like VB[.Net]. And I write code in VB for ... about two hours every three months (rentacoder.com tasks, I never take real VB jobs, I hate it). – Sparr Nov 03 '10 at 04:28
  • 1
    @Sparr - I don't pick the language. About 3/4 of devs don't ask me what language, they just start writing. If they ask, I say "which would you prefer?" Presumably you wouldn't prefer VB. No worries. People assume I am doing something wicked here - I'm not. If you saw some of the people who come to interviews you would understand that you are not threatened by these tests. – Kate Gregory Nov 03 '10 at 19:58
  • Sadly, for me, it's getting to the tests that is the problem. I'm one of the thousand applicants whose resumes never even made it to your [hypothetical] short pile. – Sparr Nov 05 '10 at 05:17
10

I was recently tasked with interviewing over 50 programmers for a senior position where they would be working mostly with PHP.

I tossed the fizzbuzz problem on the screening exam, mostly to amuse myself and because I wanted ten good questions and had only nine. My intent, at the time was to show people that we can have fun too, even on interview questions.

80% Of the applicants solved the problem, but did not use the modulus operator.

15% of the applicants could not solve the problem.

5% of the applicants solved the problem using the modulus operator.

While my sampling is quite limited (50 applicants from one country), I can tell you that:

95% of them had a BS or higher in a CS curriculum (universities here compete by trying to make CS sound more spectacular).

I was truly amazed. Well, frightened .. but amazed. I did not think I'd come close to reproducing the results, since the problem has become so popular. This shows me that 5% of my applicants might not be super programmers, but at least they read programming related blogs.

Tim Post
  • 18,757
  • 2
  • 57
  • 101
  • I would hve thought that using the modulous opertor was the most obvious, I'm suprised that 95% of the people that solved the problem successfully, used something else. Perhaps it's because they were new grads and did the math thenselves? – jmoreno Feb 05 '14 at 21:46
  • I never learned the modulus operator in any of my classes. If I hadn't do internships or spent time contributing to open source projects, I would never have learned it until I got into industry. Also, I was taught in one of my intro computer science classes that the ternary operator is bad coding practice because it's too confusing and difficult to read. – Robert Fraser Apr 15 '14 at 22:14
  • What did they use instead of the remainder operator? `x - (x/y)*y`? – CodesInChaos Sep 21 '14 at 21:06
9

In my last round of hiring I had 3 construction workers with 0, I repeat zero, programming education or experience apply for a software developer position.* So that's the bottom of the barrel. If you assume a normal distribution of skill, then you can see how the average skill level will be quite low and even 'above average' (amongst applicants) will still be relatively bad.

Now, if you're fizzbuzzing only the applicants that had what appeared to be some programming ability, you'll find that you now have:

  1. liars
  2. buzzword enthusiasts (I read an article about .NET once)
  3. bad actual programmers
  4. people who used a technology to complete a project, but didn't learn about it (see fizzbuzz questions about idisposable to identify these)

Additionally, some 'fizzbuzz' questions that I've seen are domain specific. You can progressively develop with a language/framework x for a number of years (hence z years experience with x) and not have come across certain parts of it (library developers not knowing much about UI component development for eg.)

Likewise, lots of developers do maintenance development these days, so their architecture/design skills may be weak in some areas.

Now, I'm not sure if 99% is accurate, but IME it's still pretty high. At least in the 80% range.

* No, we didn't call or even give a second look at these applications.

Steven Evers
  • 28,200
  • 10
  • 75
  • 159
  • 3
    We had a similar situation, but since our contract with the client said we'd have 4 full-time devs assigned to the project, and the project was basically done, the sheetrock hanging guy got to learn programming on the client's dollar for the 3 weeks remaining on the contract. – Tangurena Nov 13 '10 at 03:41
  • I've also seen something like that happen when some government benefits program/unemployment insurance requires that the person receiving the benefit apply to a certain number of jobs per week. Even when those programs have some sort of nominal requirement that the recipient apply to jobs they're actually qualified for, the resources for assessing what jobs they're qualified for and enforcing that particular piece of the "apply for jobs" requirement are very limited. – Daniel Martin Jul 12 '14 at 19:23
8

Yes really. Probably not 99% but still pretty high. I used to interview computer science students for internships and full time hires. I'd interview about 25 students at a college. We were told not to ask the same questions, because the students talked. I quickly learned that it didn't matter, because I would only get 3 or 4 students out of the 25 who could answer my first question. "Write strcmp"

I asked them to write a function to compare two strings. Maybe to use the function to sort words for a dictionary. You would be amazed at the number of students who didn't understand how to compare two words, let alone know how to write the function. And some of these students claimed they got all A's in CSc.

The thing is programming is VERY DIFFICULT. A lot of people like to think they know how to program, but they don't.

ChrisMcB
  • 81
  • 1
8

Some thoughts:

  • I wouldn't hold it against someone if their program had some bugs but they clearly had the right idea. Debugging is part of programming.

  • I think it is sad that so many people are applying for jobs they don't know they can't do. Seems to me like a problem with the economy.

  • It is really easy to ask people bad questions, where the only "correct" answer is the one the interviewer would give.

Mike Dunlavey
  • 12,815
  • 2
  • 35
  • 58
  • 2
    About the 2nd point... having spent a lot of time contemplating my next career move, studying various industries, and job-hunting, it was a major difficulty trying to assess my own level of competence at many different things. Apparently this is a big, big problem for (nearly) everyone. – DarenW Nov 13 '10 at 00:43
  • @DarenW: You've got my sympathy. I think it's important to know what you *like* and work from there. Personally I always liked school and never doubted my interest in engineering. My sibs are almost all sure of what they are doing. One is not, and it's easy to see that it's a struggle. Your home page indicates an interest in the intersection of science and art - that's great. Some people have had bad experiences in youth, and that can use up all their energy now. – Mike Dunlavey Nov 13 '10 at 14:56
7

This test very nicely covers several things I want to know about a programmer I might hire:

  1. Can you even program at all?
  2. Can you write a program from scratch (because not everyone can!!!)
  3. Can you solve a problem without over-thinking it.

To elaborate on the last point, there are countless solutions to fizz-buzz. Do you go for readability? Speed? Brevity? Do you try to finish writing the program quickly? How a programmer attacks this simple problem is very telling. If a programmer can't pick a solution and see it through to the end, what does that tell you about how this person will perform on a real task?

6

Unfortunately, many people with impressively looking resumes do seem to lack basic programming skills. I have seen many cases when people who list C and C++ on their resumes could not answer basic questions about pointers.

Dima
  • 11,822
  • 3
  • 46
  • 49
3

I think part of why it is such a popular question is because there is more then one way of answering it, and depending on which way the candidate chooses to go can give you an insight about how they code. Some great examples can be seen here if you have 10K rep on Stack Overflow.

As to the 99% statistic, check where that number comes from. It is probably biased. If it is based off entry-level programmers interviewing for their first job, then yes I can see that being possible, especially if the majority of their candidates are coming straight out of college. I can actually think of someone who probably would write out a 100 condition if statement as a solution to that problem.

Rachel
  • 23,979
  • 16
  • 91
  • 159
  • 3
    I suspect that the figure 99% points to the truth (the recursive truth, no less) of the statement that 87% of all statistics are made up on the spot. – Adam Crossland Oct 29 '10 at 18:13
  • 1
    @Adam Crossland: 100% of statistics about statistics are made up on the spot too. – Macha Nov 13 '10 at 16:18
  • Still, it seems horrifying that someone could not solve fizzbuzz out of college. If they cannot do that, what can they do? – Morgan Herlocker Sep 02 '11 at 13:03
  • 2
    @ironcode I went to school with someone who couldn't even begin to comprehend fizzbuzz... I'd be surprised if they could even write something that printed out 100 lines with the fizzbuzz values hardcoded. They graduated with honors. – Rachel Sep 02 '11 at 14:24
3

There are two types of people I would hope that FizzBuzz would help me avoid.

  1. Chancers with no knowledge of programming or no relevant knowledge of programming. Usually you can recognise these from the CV but not always and giving them a simple programming task is a good way of making it clear that they are not a programmer.
  2. Java school grads, who have completed a programming course or degree but don't actually know how to program. These people can be harder to filter out because they can talk about theory but they just have no practical skill. Putting a simple problem in front of them and asking for a solution and an explanation of the solution is a pretty good way of seeing the difference between a Petra Java and a Paula Bean.

In either case, I don't really care about a perfect implementation. The test that you need to make with people applying for developer jobs is that they can program at all.

That said, I would probably not bother with that particular test for several reasons now. Firstly it's very well known and either of the above groups would be quick to try it. Secondly I would prefer to use Steve Yegge's phone screen questions to screen out non-programmers before we got as far as bringing them in. If someone recognised those questions it would imply they had read Steve Yegge's blog which would suggest to me they were in the top 1% of developers who take their profession seriously and certainly warrant an interview. Likewise if someone had some good rep here or on SO I would be inclined to interview them.

glenatron
  • 8,729
  • 3
  • 29
  • 43
3

It's hard to believe that developers can't code FizzBuzz until you see the "nine-to-fivers" that copy and paste their work together and conciously try not to write code. I couldn't believe it when I heard one of our senior developers teaching a C# developer, with 3 years "experience", how to use a Dictionary. Interfaces? Design patterns? stdout? YAGNI? My lead had never heard of YAGNI! It's amazing what these people don't know.

I believe it now. I also think there's too many developers just doing enough.

kirk.burleson
  • 1,056
  • 9
  • 13
2

I find the statement that 99% of the programmers are unable to program or to solve a simple coding test highly exaggerated. In the case of the FizzBuzz test, either you have encountered this problem before and can easily solve it with the modulo operator or you have not encountered it before and will struggle with it. It tells the interviewer nothing about your programming skills.

I think the problem with many programmers apparently leaving a bad impression at an interview lie in the nature of technical interviewing methods. Interviewers expect applicants to memorize and instantly reproduce language syntax, details and computational complexity of data structures, hardware architectures, design patterns, etc, etc. The area of computer science/software engineering is vast. It is impossible and insensible to try to memorize everything.

In the real world, the key is to be able to understand the programming/design problem assigned to you and to know where to find information(your IDE, man pages, books, google, etc) how to solve your problem. This is something however that interviewers never test for.

mark
  • 357
  • 2
  • 4
  • 14
    Do you realize how easy FizzBuzz is? You don't need to have encountered it. If you struggle then consider a career change. – John Smith Apr 15 '11 at 14:50
  • But it can be solved without modulo by using division. A correct solution using / instead of % would work for me. So they need to understand very basic math and very basic programming. – Almo Feb 05 '14 at 15:19
0

I am still a relatively junior programmer (I have been coding for money for ~2 years and coding in some professional capacity as a side-responsibility for about 2 before that) so use sufficient grains of salt.

I have some experience doing a first screen for coders for a Large Enterprise Project (we kinda knew the project was doomed, but hey, they wanted to pay anyways). As the only programmer at the firm doing the hiring I was given the task of reviewing resumes and screening applicants.

This was for a government project so it perhaps probably didn't attract the most talented applicants, but I did not receive one application from anyone with a github account that actually had code shown, nor anyone who had a portfolio, so I used fizzbuzz (literally the exact problem) as a first pass on anyone who looked like they might be able to program.

I prefaced it with a pseudo-apology stating that I knew it was stupid but that I just wanted to see any working code, and if they wanted they could send another example of equal or greater value or really anything, but that fizzbuzz would suffice.

The result: I didn't get one response that was actually correct, which is mind-blowing considering the volume of answers on the internet. No one even bothered to plagiarize. We had to just go with hiring people who had previously worked on the failed previous iterations of the project.

After the initial shock of the exercise and disappointment about how screwed government software/contracting was, I felt much better about my own skills, so small victories?

Edit: By not correct I don't mean an off-by-one error (i.e. I asked for through 100 not 99) or some other innocent bug that is an easy fix. I mean not functional, either won't run/compile/etc or showed clearly that the problem was just not read and understood, also a significant portion withdrew the application and not one sent some other code instead.

BSpiros
  • 129
  • 4