
For the Love of God, Ask FizzBuzz - bbrunner
http://brianbrunner.com/interviews/2013/10/25/fizzbuzz.html
======
zidar
When I try to see if a person knows how to "think", I start with fizzbuzz and
then ask them to do it again without if or case statements. The first time a
person is asked something like that you see if they're a thinker or if they
just go "that can't be done." That question does a good job dividing people
into a group that in 5 years time will ether have 5 years of experience or 1
year of experience repeated 5 times.

~~~
taylor-smith
I love the five years experience vs. one year of experience repeated five
times idea

~~~
nilliams
Same, I've added that to my 'remember this' list of
phrases/quotes/terminology.

------
Jemaclus
For an entry-level position? Sure. For a senior-level position? Don't waste my
time. I disagree that the Github repo, resume, etc are useless. You can glean
a ton of information about me from those data points that can tell you whether
I can code or not. You want to know whether I can think or do basic
programming skills? Ask me about my repo. Ask me about projects I've done. If
I actually wrote that code, I'd be more than happy to go into detail about the
work I've done.

Like someone else said, we wax poetic about DRY all the time, yet you're
asking me to take time out of my day to repeat things I already know when that
data has already been provided for you. Sigh.

You should be able to have an idea of whether I'm a suitable candidate or not
before you even call me, and you should know whether I can code or not before
you even bring me into your office.

Entry level position? FizzBuzz all day long. It's the only way you'll find
out.

Mid- to Senior-level position? There are better ways to figure out my
competency level.

My two cents.

~~~
tedyoung
I don't believe the article said that the repo, resume, etc. are useless, it's
just that you need to establish a baseline of "can this person code"?

Having done hundreds of interviews, I'm sorry to say that even seemingly
"senior-level" people (people with years of programming "experience" on their
resume) have shown an inability to do basic coding from scratch. It seems
there's a subset of developers who cobble stuff together and code-and-fix to
make things work. This is ironically less of a problem with entry-level
people.

Yes, if you have a public repo of code, I'll ask you about it, but I want to
see you live code something, both to see the code you write and your thinking
process about solving the problem. If you feel that's a waste of your time
(and if you're truly senior-level, it really won't take very long at all),
that's fine, but I will continue to do it.

~~~
queensnake
> even seemingly "senior-level" people (people with years of programming
> "experience" on their resume) have shown an inability to do basic coding
> from scratch.

I wouldn't have believed you a few months ago (and your statement is still
stronger than my experience), but I've finally seen people who are so
maintenance-bound, that even though they're good at _that_, they've never
managed to learn the language (the corners, idioms, and semantics) they've
been maintaining. It's probably a sign of heroism that they picked up enough
to do so on the fly, but, you wouldn't hire them to write new code.

------
smathieu
I have been doing a lot of phone screens for our company lately. We ask a
FizzBuzz like question in our first phone screen.

So far, only 30% of applicants manage to go pass this point.

It's actually quite hard to believe. Guys who claim to have multiple apps
under their belt simply cannot write code. I often question them on what they
did in their past and what was their actual contribution to their team. The
two most common scenarios are either the so-called technical manager who got
promoted there become of lack of coding abilities or the self-taught
programmer who was hired by the technical manager. By self-taught, I mean
someone who can write HTML and copy/paste JavaScript code from somewhere.

------
LocalMan
When hiring "Experienced C Programmers", I would just show them a the short
version of strcpy() out of K&R, but with variable names change from 'src' and
'dst' to 'x' and 'y'.

Just to read it and say what it did. This eliminated the vast majority of the
applicants:

void strcpy(char _x, char_ y) { while( _x++ =_ y++); }

~~~
OseOse

        void strcpy(char *x, char *y) { while(*x++ = *y++); }
    

In this example, why does the loop terminate? Is it because the null
terminator counted as a _false_?

~~~
tel
Exactly, since C strings are just pointers to raw memory you usually assume
that either the user passes the length explicitly to you or that they're
\0-terminated.

------
gamegoblin
I suspect the same people who complain about being asked fizzbuzz are the same
people who complain about getting their ID checked when they buy alcohol.

I can implement fizzbuzz in < 30 seconds in half a dozen languages (in vim,
maybe < 60 seconds on paper/whiteboard). I don't really take offense to being
asked to blow 30 seconds; I understand where the interviewer is coming from
the same way I understand where a cashier asking for my ID is coming from.

~~~
jakejake
I think a lot of people who complain don't realize that a decent amount of
people do fail FizzBuzz. If they are as smart as they think they are, then
they would definitely appreciate not having people on their team who cannot
complete FizzBuzz!

I have asked this question before and a lot of people don't know the mod
operator and so they struggle and eventually it occurs to them to divide and
check the remainder. This usually leads to kinda sloppy looking code, but, I
find it to be very revealing about their problem solving abilities. Some
people just give up. Some people ask for help. Some people get angry or
flustered. All of these scenarios are extremely revealing and help you to
understand the candidate's approach to problems.

When the candidate already knows FizzBuzz then the results are usually less
interesting - but sometimes they may solve it is some really unusual way which
is cool to see.

~~~
gamegoblin
You said it was cool to see unusual FizzBuzz solutions, so I just coded this
up in the last 10 minutes. So... FizzBuzz without any modulo or division
operations!

    
    
        #include <stdio.h>
        int f0(unsigned int x) { return x? (x&(1<<31)? f1(x<<1) : f0(x<<1)) : 1; }
        int f1(unsigned int x) { return x? (x&(1<<31)? f3(x<<1) : f2(x<<1)) : 0; }
        int f2(unsigned int x) { return x? (x&(1<<31)? f0(x<<1) : f4(x<<1)) : 0; }
        int f3(unsigned int x) { return x? (x&(1<<31)? f2(x<<1) : f1(x<<1)) : 0; }
        int f4(unsigned int x) { return x? (x&(1<<31)? f4(x<<1) : f3(x<<1)) : 0; }
    
        int t0(unsigned int x) { return x? (x&(1<<31)? t1(x<<1) : t0(x<<1)) : 1; }
        int t1(unsigned int x) { return x? (x&(1<<31)? t0(x<<1) : t2(x<<1)) : 0; }
        int t2(unsigned int x) { return x? (x&(1<<31)? t2(x<<1) : t1(x<<1)) : 0; }
    
        void main() {
            unsigned int i;
            for(i=1; i <= 100; i++) {
                if(t0(i)) printf("Fizz");
                if(f0(i)) printf("Buzz");
                if(!(t0(i)|f0(i))) printf("%u",i);
                printf("\n");
            }
        }

~~~
jakejake
fantastic! I would be rightfully impressed and amused!

------
bluecalm
I've heard from multiple sources that people fail fizzbuzz. I now read
multiple posts here saying the same. As a hobbyist programmer with a few free
lance projects under my belt who never worked in "the industry" I find it
simply fascinating. My first reaction is that maybe your interview is very
stressing or maybe you ask the applicants to write the code on paper and fail
them for any typo. I just can't believe anybody, anybody who ever programmed
anything failed such tests in reasonable environment. I mean if I couldn't
write fizz-buzz I would never get any code to work. I mean I imagine myself
failing to implement a dictionary in C having limited time and being under
pressure without a bug somewhere but fizz-buzz ? really ? :)

~~~
whateverfor
These are people who have never (will never?) write any actual working code.
Through a combination of lying on their resume/bullshitting interviews/hiding
away during the actual job they've managed to get by. They are a small
percentage of all "Programmers", but a large percentage of people looking for
jobs (because they are more likely to be unemployed, more likely to fail an
interview, and their best way to get a job is to try as many interviews as
they can get).

I'd never be insulted by Fizzbuzz questions, it takes maybe a minute to solve
and you can move from there to more interesting questions very easily. If
Fizzbuzz is the closest thing to a time waste during the interview process,
you're in pretty good shape.

------
jroseattle
If there is one thing around hiring programmers that I wish had more
discussion, it's the notion from the interviewer's goal of "trying to
understand how one thinks about a problem." Frankly, I don't think we're very
good at it. And for good reason -- it's really hard.

My personal experience has been that most of us in the industry aren't well
equipped to make that determination reliably among each other. The most
successful interviewees I've ever seen are those with excellent pattern
recognition and recall. Only a few of those are decent programmers (not even
excellent.) But they're all very talented in describing ways of thinking.

In spite of information at hand, I rarely see those in hiring roles ever go
away from "does this person think about this the way I do?" It is a very
subjective task, so I don't fault those in these positions for following that
process. But I think there's a perception in "understanding how a person
thinks about a problem" that is flawed.

------
knob
And starting out in programming, for the love of code, learn how to do these.
They set your brain in motion. And ProjectEuler.net

~~~
miloshadzic
Project Euler, while great, is more about neat math tricks than actual
programming.

~~~
RyanMcGreal
It's about solving logical problems and expressing those solutions using code.
Definitely useful.

~~~
miloshadzic
Never said that it isn't useful.

------
zorpner
> guarantees that neither the interviewer nor the candidate is wasting the
> other’s time

Yeah, it guarantees that only the interviewer is wasting the candidate's time.
If you're hiring off the street I could possibly see some value in FizzBuzz,
even though it's going to turn off any actual A player you happen to
interview, but if I sent in a portfolio/past project/etc and you FizzBuzz me,
I'm walking out. If you distrust a candidate that badly I can't imagine how
micromanaged your employees must be.

FizzBuzz both saves you time by filtering out incompetent people, and saves
actual competent people time by demonstrating that you're not willing to do
what it takes to attract great hires. There's no shortcut to real interviews.

~~~
sjm-lbm
I FizzBuzz all new developers I hire. Frankly, if you aren't prepared to spend
the 5 (at most) minutes it takes to put FizzBuzz down in a language you say
that you are an expert in, I'm ok with you walking.

Being a productive team member requires trust, and FizzBuzz is a _really_ low
standard to start at when attempting to gain trust. I'd be openly suspicious
that anyone who can't be bothered to run through FizzBuzz in an interview
would be the type to complain that whatever task they are working on (that
needs to be done) isn't RealProgramming(tm), and is beneath them.

~~~
huhtenberg
I'm off the market, but if I were asked to do FizzBuzz on a tech intervieew, I
would do it, but conditional on the interviewer doing something as idiotic
immediately after that. Like write an iterator for a binary tree.

Treating the person on the other side of the table is a fake works both ways.
Don't underestimate how actually _offensive_ a FizzBuzz question to a
qualified developer is.

~~~
kevinconroy
Think of it this way: they aren't trying to offend you - they're trying to
show you that they're keeping all the other idiots who can't do FizzBuzz from
joining the team.

FizzBuzz is a necessary but not sufficient standard for acceptable technical
skill.

As a hiring manager, I'm not just amazed by how many people can't do FizzBuzz,
but by how many people haven't even _heard_ of it before I ask it.

~~~
sjm-lbm
> I'm not just amazed by how many people can't do FizzBuzz, but by how many
> people haven't even heard of it before I ask it.

This is very true. I've often thought of pulling it from the list of questions
just because of the visibility that it gets - I mean, I _do_ actually feel, to
an extent, embarrassed asking it. Surely anyone who spends 30 whole minutes
preparing for a job interview can find it on Google.

It still manages to be difficult for some people, though. And, really, that's
something that I want to know quickly.

------
speeder
Good article but why the hell that horrible font? If I was not hiring
currently, I would not have bothered to try to read it...

~~~
kalleboo
Are we looking at different pages?
[http://imgb.mp/jmI.jpg](http://imgb.mp/jmI.jpg)

~~~
kevinconroy
Font renders differently on iPad (monospaced) vs Mac Book (your screenshot)
for me.

~~~
speeder
I am on Win 8 Laptop with not much resolution and using Chrome, here the font
is even thinner and has aliasing artifacts.

------
habitue
Yeah, fizzbuzz is a filter guys. Yes, you can read their code repos and do in
depth interviews, but you shouldn't _waste your time_ until they can do
something as simple as fizzbuzz. You will be truly surprised how many just
don't pass that filter and are literally wasting your time.

To reiterate: necessary, but not sufficient.

------
w0rd-driven
"A good resume with a long list of well-known companies and a degree from a
top-tier engineering school doesn’t guarantee anything." I'm sorry but a year+
at those companies proves you've provided at least _something_ of worth to
them. The real crux of the argument is can they solve the kinds of problems
_your_ company faces.

I would certainly hope that the barrier to entry for every job I applied for
wasn't something so standardized (and quite frankly, useless). I would
eventually point to a github repo with it done already. We wax poetic about
DRY yet you're gonna ask me to repeat myself? Seems pretty hypocritical to me.

~~~
misterjangles
You're missing the point. What you are not realizing is how many people
actually _fail_ fizzbuzz.

If it seems so simple and useless to you because it's easy, then you are not
one of the people who will ever be weeded out by a fizzbuzz style question.

Put it this way... Would you want to work with somebody who was unable to
handle fizzbuzz?

~~~
w0rd-driven
I definitely would not want to work with them and yet I have. My problem isn't
the failure rate, its the repeated asking of a question I should be able to
prove via a public repo. The repo should be more than adequate, I would hope.
If it isn't, we would have much bigger problems of trust.

------
pencilcheck
I am still skeptical for the effectiveness of FizzBuzz. I wonder if there are
actual science experimental result to support this hypothesis where asking
FizzBuzz as a filter would actually be effective. I wonder what is the
percentage of those candidates who failed this filter are actually the worst
kind of candidates, and if those who passed this filter would turns out not be
a good fit. I see no correlation between passing FizzBuzz and being a good
fit, productive engineer. Most of the proponent of FizzBuzz seems to assume
that engineering skills could be accurately form a pyramid, where there are
some questions where you need to understand before tackling other higher level
questions, and that people who don't understand the "basics" will not be able
to grasp or excel in the skills in higher levels. May I ask how many
interviews here have taken CS courses and may I ask how many of you find
FizzBuzz is relevant to any of the courses you have taken? Do you need to know
FizzBuzz in order to tackle the vast problem spaces of Computer Science? Do
you need to know FizzBuzz by heart to have experienced working in a large
projects with thousands of people? Do you need to know FizzBuzz to implement a
binary tree? Do you need to excel in FizzBuzz to code up a language parser?

To me, it is absurd that people believe in FizzBuzz because I see this
mindless ritual of asking FizzBuzz question can be best described as Cargo
Cult Science as coined by Richard Feynman
([http://neurotheory.columbia.edu/~ken/cargo_cult.html](http://neurotheory.columbia.edu/~ken/cargo_cult.html)),
where in this context of hiring, recruiters are hoping that by asking FizzBuzz
he will definitely filter out all incompetent programmers/engineers so he
won't have to waste time finding out if the candidates are actually suitable
for the position and the team.

If FizzBuzz is the ultimate filter for the position he is applying for, or if
it should be considered universal, then why wouldn't university teaches them
to memorize all possible variations of them in their introductory programming
classes? Also wouldn't you think people who are not good programmers would
cheat his/her way out by simply memorize the solution? Then aren't you still
wasting time asking FizzBuzz questions?

------
rpearl
I don't really understand; why not ask an actual substantial question in a
phone interview? Poor candidates who would fail fizzbuzz would fail that too;
good candidates would be expected to pass such a question anyway.

Either way, you're wasting an hour of eng time at most.

------
firesofmay
Totally agree on asking FizzBuzz type questions first! I have understood a lot
about the person just by asking simple questions. Most people fall into the
trap of answering it in a very complicated way to advoid many if else if
conditions for no reason! :P :)

