6 ms·
For the Love of God, Ask FizzBuzz
- pencilcheck 13y agoI 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?
- knob 13y agoAnd starting out in programming, for the love of code, learn how to do these. They set your brain in motion. And ProjectEuler.net
- miloshadzic 13y agoProject Euler, while great, is more about neat math tricks than actual programming.
- Apocryphon 13y agoWhat about TopCoder?
- miloshadzic 13y agoI've never participated much but people say that if you get some practice there, algorithm heavy interviews go a lot smoother.
- RyanMcGreal 13y agoIt's about solving logical problems and expressing those solutions using code. Definitely useful.
- miloshadzic 13y agoNever said that it isn't useful.
- VLM 13y agoAgreed that there's an intense math flavor, but the "right" way to do lower level PE problems mathematically can be more fun to play with programming ideas. Problem 1 is basically a fizz buzz and its funny to try alternative algorithms. So, yeah, brute force its pretty obviously a for loop with a subtotal, two mod tests connected by an or, you get the idea. And that is the first way to do it in a new language. So you wanna try recursion? I feel fuzzy at this time but something like you call recurse(1000) and it calls recurse(999) and so on until it hits 0 and stops. Now from memory my weird design was the return was returning the (the returned subtotal from calling recurse(x-1)) + x when x is a mult of 3 and not a mult of 5 + x when x is a mult of 5 and not a mult of 3 + x when x is a mult of 15 (15 is 3 and 5 at the same time)) Yeah or something like that. (edited what the heck was I thinking? I'll leave this as unedited, but thats not right. This is a good fizz buzz example of give them the question, a wrong answer, and ask them to debug it.) Another one to demonstrate your ability at screwing around with arrays is simply make an array size 1000 all zeroed out and a for loop to run thru all indexes of that array (now try not to fall off either edge) and if the array index is a mult of 3 or a mult of 5 then set that array value to the array index. Finally add together all the values of the array. Hmm so you've got a minor parallel processing cluster on hand and everyone runs some language you're unfamiliar with and has access to a shared NFS dir so all 100 of your hosts run the worlds dumbest program that checks to see if 1000 files exist, if not, it picks a psuedo-random number between 0 and 1000, checks to see if its already been calculated, if not, it decides if that number is a mult of 3 or 5 and if it is, then a filename "random-number" appears using dd if=/dev/urandom of="random-number" and you copy 1K blocks equal to the number of blocks in the random number (so file 14.crazy is zero bytes long but 15.crazy is precisely 15K in length) then given 100 workers randomly selecting a random number less than 1000 you have to run way more than 10 rounds but eventually all the shell scripts simultaneously terminate on all the worker nodes because ls | wc -l returned 1000 aka all 1000 results have been calculated. Then you run cat * > result and du -k result to see how many K are used which is the sum of all the mults of 3 and 5 between 0 and 1000... I did this to torture test a small cluster and its NFS server and its network and disk IO a long while back. I remember it took more rounds than you'd guess to test all 1000 digits and of course if varies, unless your psuedo-random number generator is screwed up. Or you could intentionally use a screwed up RNG to see if its any good. Also I did my run using M not K although a motivated lunatic would use G, I suppose, to really torture a NAS. Isn't this a diabolically insane and funny way to solve the problem? On a simpler level, or a differently crazy level, you can do all your math in octal, just because. It won't really change anything but it looks entertaining. And why not write your own octal-dec conversion routine, to print out the result, just because? The point is not to do it the fastest or most obvious way but to screw around with odd ideas, not the same old boring fizzbuzz. Graphical is hilarious instead of using a boring old array. So what happens if you use a PNG graphics image to store your table of multiples? So 15 is 15 black pixels? This is an interesting way to test your ability to squirt out and in pixels. Also does your PNG library interface like 1e6x1 graphics images and how scalable is it when you access the same graphics image 1e3 times does it scale? There is a tiny problem that someone who thinks this is hilarious might use hilarious designs in production code.
- speeder 13y agoGood article but why the hell that horrible font? If I was not hiring currently, I would not have bothered to try to read it...
- TillE 13y agoSeems like a perfectly decent monospaced font. Medium grey on light grey is annoying, though.
- vshade 13y agoBut monospaced fonts aren't good for reading prose.
- kalleboo 13y agoAre we looking at different pages? http://imgb.mp/jmI.jpg http://imgb.mp/jmI.jpg
- kevinconroy 13y agoFont renders differently on iPad (monospaced) vs Mac Book (your screenshot) for me.
- speeder 13y agoI am on Win 8 Laptop with not much resolution and using Chrome, here the font is even thinner and has aliasing artifacts.
- noir_lord 13y agohttp://i.imgur.com/0ygryEl.png http://i.imgur.com/0ygryEl.png FF24/Mint 15 looks fine to me (bit small maybe).
- zorpner 13y ago> 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.
- dnautics 13y ago>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 I think this is the use case that they're referring to. If you're getting a job referral from someone you trust, you probably shouldn't do it. It's also not that much time. I've never done any professional coding in my entire life, and I could write fizzbuzz in at least three languages in less than 10 minutes. Edit: 10 minutes EACH. I'm not that good.
- PeterisP 13y agoThe target audience of FizzBuzz (i.e., those who fail it badly) are indistinguishable from you otherwise, and they outnumber you. They also do send in portfolios and past projects, simply they lie about who did the actual coding in those projects. The exception is when a company is approaching you directly - then it would be insulting. However, if an outside recruiter approaches you, and then hands over to the company... again, you need FizzBuzz or such, because some recruiters are cheaters and will even help hopeless candidates fake their portfolios. Wasting people time hurts - but accidentally hiring someone who'd fail FizzBuzz hurts orders of magnitude more.
- michaelt 13y agoWould you also walk out on your first day if your new boss asked you to do something you considered simple or boring? If so it sounds like FizzBuzz may still serve as a valuable filter!
- zidar 13y agoWhen 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 13y agoI love the five years experience vs. one year of experience repeated five times idea
- nilliams 13y agoSame, I've added that to my 'remember this' list of phrases/quotes/terminology.
- yuliyp 13y agoWow, so simple, and yet it leads to all kinds of discussions of space complexity, what counts as branching, etc.
- troels 13y agoDo you mean FizzBuzz specifically, because then you may just see how well they do on pop-quizzing?
- LocalMan 13y agoWhen 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++); }
- dnautics 13y agoI had no idea that's how strcpy is implemented. Buffer overflow exploits and the like aside (ah the good old days) that is really elegant!
- huhtenberg 13y agoThis is not how strcpy is implemented. It is typically done in assembly.
- deleted 13y ago[deleted]
- andrewcooke 13y agohttps://sourceware.org/git/?p=glibc.git;a=blob;f=string/strcpy.c;h=b71f7536bca7fd2afc5854f681a3629cee2cab6f;hb=HEAD https://sourceware.org/git/?p=glibc.git;a=blob;f=string/strc...
- e12e 13y agoReally? I just did a "apt-get source libc6" and in strings/eglibc-2.17/string/strcpy.c I found: /* Copy SRC to DEST. */ char * strcpy (dest, src) char *dest; const char *src; { char c; char *__unbounded s = (char *__unbounded) CHECK_BOUNDS_LOW (src); const ptrdiff_t off = CHECK_BOUNDS_LOW (dest) - s - 1; size_t n; do { c = *s++; s[off] = c; } while (c != '\0'); n = s - src; (void) CHECK_BOUNDS_HIGH (src + n); (void) CHECK_BOUNDS_HIGH (dest + n); return dest; }
- deleted 13y ago[deleted]
- misterjangles 13y agoTo me fizzbuzz eliminates certain types of candidates who have absolutely no reasoning skills. You would be surprised at how many people are out there who have learned how to regurgitate lessons from school but seemingly have no clue how to solve any real work. These people do manage to get themselves hired based on their academic degree and they wind up contributing absolutely nothing, while consuming time from the developers around them until eventually they are dismissed. You don't want one of these guys on your team. Simple fizzbuzz exercises will usually uncover them unless they have managed to memorize it previously.
- w0rd-driven 13y agoDeleted my post because my mobile screwed it up before I was finished. All good points. FizzBuzz is so simple that it can be regurgitated too or lifted from a Google search on your phone as you're talking with the interviewer. That so many can fail with so many examples is terribly troubling.
- smathieu 13y agoI 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.
- deleted 13y ago[deleted]
- firesofmay 13y agoTotally 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 :)
- w0rd-driven 13y ago"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.
- eldondev 13y ago> I'm sorry but a year+ at those companies proves you've provided at least something of worth to them. Not sure about that. I think there are lots of "well known companies" where a good bluffer can relabel themselves and bounce around enough that nobody realizes they haven't got anything to offer. >We wax poetic about DRY yet you're gonna ask me to repeat myself? Some people can wax poetic pretty effectively without being effective at implementation. I've written a 1 line fizzbuzz python generator in less than 2 minutes. If one is too arrogant/uncompromising to take the two minutes to satisfy this (if asked), or unable to turn it into something interesting ("This is done with generators. I might never do it this way in practice, but the question you asked me was so mind-numbingly boring I had to do it this way to entertain myself"), then one probably won't work that well on an effective team.
- w0rd-driven 13y agoI forget that in most "well known companies" they are much larger in size and people can easily hide behind others in such a place. That's where my ignorance comes in. I've been only part of smaller shops where if you aren't producing, you absolutely do not last. Yet I easily forgot the person with a masters degree that could not pass, was hired anyway, and subsequently fired 3 days later for not improving an iota. I think my frustration is that people like this exist, forcing companies to give the same test to weed them out with no way to skip the question if you can faithfully prove you're not that person.
- 13y ago
- Jemaclus 13y agoFor 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.
- kevinconroy 13y agoGenerally I agree, but I've asked FizzBuzz to mid-to-senior level folks who just can't get it. There are plenty of less qualified programmers who got into entry level positions and have held onto jobs long enough that they are now considered mid or senior level. FizzBuzz provides a great level setter for folks who lack a clearly searchable, well-known code repository. One half-joking suggestion to anyone using your GitHub repo as a resume: make yourself a FizzBuzz project. You can include basic one so the box can be checked, but as a hiring manager, it'd be fun to see novel and humorous solutions to it that show cases your particular background (e.g. front-end developer? Show me the CSS3 solution.)
- tedyoung 13y agoI 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.
- bluecalm 13y agoI'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 ? :)
- mathattack 13y agoI've wondered the same. And the answer is a delusional, "I'll figure it out when I get there."
- whateverfor 13y agoThese 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.
- habitue 13y agoYeah, 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.
- jroseattle 13y agoIf 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.
- gamegoblin 13y agoI 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 13y agoI 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 13y agoI always suspected that anyone who fails fizzbuzz does it because they are unfamiliar with divisibility mathematics. I am always amazed at CS students who have no grasp on relatively simple math. I remember trying to explain binary addition to people in a circuits class when we were implementing ripple-carry adders. I was explaining how binary addition is the exact same as decimal addition except you carry at 2 rather than 10. The guy I was explaining it to asked "What is carrying?". He hadn't done addition by hand in so long he had entirely forgotten. And this is a guy who can code up a functional, decent looking PHP based website in a matter of minutes. I suppose it's even more believable that people would forget long division, remainders, and modulus.
- deleted 13y ago[deleted]
- rpearl 13y agoI 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.