TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Fizzbuzz isn't a coding test

35 pointsby kapilkaleover 12 years ago

22 comments

AngryParsleyover 12 years ago
<i>Ask some smart business analysts with no coding experience to solve FizzBuzz in Excel. All should be able to do it.</i><p>Instead of asserting this fact, put the hypothesis to the test. Ask some smart business analysts and see how many of them can solve fizz-buzz. You're much more likely to win over the audience if you have some data.<p>Really though, I think this post is needlessly controversial. The whole text could have been, "It makes sense to hire people with no programming experience who can solve fizz-buzz." I don't know how many people fall into that category. I'm not sure how good they'd be or how long they'd take to get up to speed, but that's fine. It's something I can think about and engage with.<p>The rest of the post is just arguing over definitions. If by "coding" you only mean "turning pseudocode into code", then yes a lot of things people call coding aren't coding. Likewise if by "think analytically" you mean "is able to solve fizz-buzz," then of <i>course</i> companies want programmers who can "think analytically."<p>No matter what definitions you use, the hiring practices are the same. Fizz-buzz still acts as a negative filter. People who can't solve it aren't hired. People who can solve it may or may not be hired depending on how other things go.
SomeCallMeTimover 12 years ago
I think that FizzBuzz is just filtering out incompetent applicants who shouldn't be trying for programming jobs to begin with. Joel on Software described this phenomenon back in 2005. [1] His key takeaway is that 99%+ of people applying for developer jobs may be unqualified for pretty much any coding job, but they keep applying anyway.<p>He describes how he and other companies get 200 applicants for most job postings, of which only one may actually be "good enough." I've seen numbers like that myself when on the hiring end. So everyone thinks they're hiring the top 0.5%, even though the same 199 losers are spamming their resumes to every job posting.<p>Well, a simple way to filter out that 199 is to apply FizzBuzz or equivalent.<p>[1] <a href="http://www.joelonsoftware.com/items/2005/01/27.html" rel="nofollow">http://www.joelonsoftware.com/items/2005/01/27.html</a>
评论 #4594867 未加载
lopatinover 12 years ago
Who cares the about what FizzBuzz REALLY is? Can't we all just agree that it's a programming test because anybody who calls them self a programmer should possess these painfully simple analytic skills. If you can translate pseudocode to code, but can't write pseudocode for FizzBuzz, you're a translator not a programmer.
评论 #4591841 未加载
techdmnover 12 years ago
I've been doing FizzBuzz and a few other code-related tests for the last few years. It was an odd shock when I realized that was the /only/ part of the interview process that had any value to me whatsoever. I mean it. I have seen people display radically different personality traits between the interview and work on Monday. The guy who was almost too nervous to speak in the interview won't stop talking peoples' ears off. The guy who really sold himself well is very shy and quiet now that he has to show up every day. I wouldn't believe if it I hadn't seen it. Not to mention language lawyers, etc. But coding tests have predictive value. YMMV of course.<p>I'm also surprised how many people get it wrong. I see a lot of this (pseudocode):<p><pre><code> for (i = 0; i &#60; 21; i++) { if (i % 3 == 0) { print "fizz"; } else if (i % 5 == 0) { print "buzz"; } else if (i % 3 == 0 &#38;&#38; i % 5 == 0) { print "fizzbuzz"; } } </code></pre> Yeah, see, one of those branches is never going to be reached.
评论 #4592002 未加载
danielamitayover 12 years ago
&#62; "Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”<p>Aside from explicitly stating "Hey, encapsulate IF/ELIF/ELSE statements in a FOR loop", FizzBuzz doesn't seem too analytical--am I wrong?
评论 #4591924 未加载
评论 #4591725 未加载
评论 #4591920 未加载
评论 #4592257 未加载
smosherover 12 years ago
I see a frightening number of people buying into the disturbing assertions made in TFA:<p>- that analytical thinking isn't necessary for programming.<p>- that translating pseudocode is a sufficient test of programming skill.<p>- that Excel isn't equivalent to a programming environment, or somehow doesn't count as programming.<p>- that FizzBuzz requires <i>higher-order</i> thinking. It's not like you're asking someone to implement lists as lambdas. Or the this website's namesake (the Y Combinator.)<p>Each one of these items is a big fat WTF.
spaghettiover 12 years ago
I don't think engineers should ever spend their time asking Fizzbuzz. Engineers' time is valuable. And blocking off an hour for a phone screen can interrupt the day. If a preliminary code sample filtering step is used then engineers can jump straight into the meaty interview questions.<p>The vast majority of people who don't know programming basics like loops and conditionals won't make it to the phone screen stage. Someone might look up the solution to the programming quiz but they'll immediately fail the first interview question. And this can be partially mitigated by rotating puzzles or even changing numbers in the puzzles.<p>The code sample filtering step should have both a sufficiently tricky puzzle and a bank of at least 20 common corner cases. Just run the test cases automatically. The vast majority of candidates will be eliminated without wasting any engineers' time.
评论 #4592209 未加载
alexlandeover 12 years ago
I've got to disagree here. The whole point of FizzBuzz is that it's a straight-forward analytical problem that you should be able to do easily if you understand the fundamentals.
antiterraover 12 years ago
I think some part of this issue has to be that computer science does not fully equate to coding, and the balance of coding to theory curriculum varies significantly. If you're hiring recent grads then it might make sense to give a little leeway, to help them along and see if you see some spark of analytic ability. Maybe interview nerves are an issue.<p>If your candidate can't do fizzbuzz but is claiming to be an experienced programmer in the required language, the situation should raise a red flag.
michael_fineover 12 years ago
It's not coding, in the strictest sense that it has no computer science or is solely syntactic, but it works at weeding out people who can't <i></i>build anything<i></i>. At least this level of analytical thinking is necessary for any programming task, and therefore Fizzbuzz serves its purpose.
danielharanover 12 years ago
&#62;"Ask some smart business analysts with no coding experience to solve FizzBuzz in Excel. All should be able to do it."<p>Bahaha. I want to see you try. And weep.
pjungwirover 12 years ago
How many people have actually been asked Fizzbuzz in an interview? I recently interviewed at several places, before deciding I'd rather try my hand at independent consulting. At least two were companies with (apparently) superb engineering teams. But no one asked me this question, or any preliminary coding question at all. I was asked to code, but only after the companies had paid money to fly me out, put me up in a hotel, and have their team spend a day talking with me. I would be <i>delighted</i> to be asked this question, because I'd take it as a sign that the company values its time and is discriminating in its hiring.
tjr226over 12 years ago
FizzBuzz isn't a coding test, I agree. It's an interview prep test. If a candidate can't take 15 minutes to read up on common interview questions and prepare a simple answer, then they shouldn't be hired.
评论 #4591822 未加载
评论 #4592032 未加载
gregjorover 12 years ago
It is a coding test, and here are the answers:<p><a href="http://www.geekschool.org/programming/fizzbuzz/" rel="nofollow">http://www.geekschool.org/programming/fizzbuzz/</a><p>FizzBuzz in lots of languages, including LOLCode.
fleitzover 12 years ago
Higher order thinking is pretty much required to make any working program of minimal complexity. aka. be a programmer.<p>If you have to hand a programmer pseudo code in order to write a program, you'd be better off hiring competent programmers to write you a compiler and then you can get rid of the programmers who can't think and code it yourself in your fancy new higher order language.
评论 #4591884 未加载
recursiveover 12 years ago
If fizz buzz is too complicated, what would be an example of a problem a programmer should be able to solve? Why do programmers exist?
ChuckMcMover 12 years ago
There is analysis and there is coding. I've met and worked with people who had both skills (awesome) and only one of the two (less awesome). If you're limited in the number of people you can hire (startup) then you want both skills in the same person. I think any business analyst would agree with that.
kuahyeowover 12 years ago
How useful is translating "pseudocode into a working program"? I doubt the utility of that skill as a programmer
评论 #4592025 未加载
评论 #4592028 未加载
评论 #4592027 未加载
wheelerwjover 12 years ago
seeing this makes me cry. I can code this is at least three languages (java, php, python) and I can't even get an interview for a junior dev position. I got bored the other day and tried to write it recursively because why not, right?
icefoxover 12 years ago
Spelling mistake: bale =&#62; able
评论 #4591718 未加载
tokenadultover 12 years ago
It is, of course, up to each manager to decide what a person is being hired to do. If you want to hire someone to do something useful for you at your company, it's a very good idea to give the job candidate a work-sample test. For some kinds of programming jobs, a fizzbuzz coding test is a (very easy) work-sample test. I've heard a story similar to those in other comments here about 100 applicants to a company that uses Web back-end programming to serve up online, adaptive lessons. The test the hiring supervisor used was "Write a program using a for loop to print the integers from 1 to 100." No language was specified. He has not yet had ANY applicant, even though all his applicants have computer science degrees, many having master's degrees, submit a working program to do that. Not one.<p>This is discussed so often on Hacker News I have a FAQ on the issue of company hiring procedures. There are many discussions here on HN about company hiring procedures. From participants in earlier discussions I have learned about many useful references on the subject, which I have gathered here in a FAQ file. The review article by Frank L. Schmidt and John E. Hunter, "The Validity and Utility of Selection Models in Personnel Psychology: Practical and Theoretical Implications of 85 Years of Research Findings," Psychological Bulletin, Vol. 124, No. 2, 262-274<p><a href="http://mavweb.mnsu.edu/howard/Schmidt%20and%20Hunter%201998%20Validity%20and%20Utility%20Psychological%20Bulletin.pdf" rel="nofollow">http://mavweb.mnsu.edu/howard/Schmidt%20and%20Hunter%201998%...</a><p>sums up, current to 1998, a meta-analysis of much of the HUGE peer-reviewed professional literature on the industrial and organizational psychology devoted to business hiring procedures. There are many kinds of hiring criteria, such as in-person interviews, telephone interviews, resume reviews for job experience, checks for academic credentials, personality tests, and so on. There is much published study research on how job applicants perform after they are hired in a wide variety of occupations.<p><a href="http://www.siop.org/workplace/employment%20testing/testtypes.aspx" rel="nofollow">http://www.siop.org/workplace/employment%20testing/testtypes...</a><p>EXECUTIVE SUMMARY: If you are hiring for any kind of job in the United States, prefer a work-sample test as your hiring procedure. If you are hiring in most other parts of the world, use a work-sample test in combination with a general mental ability test.<p>The overall summary of the industrial psychology research in reliable secondary sources is that two kinds of job screening procedures work reasonably well. One is a general mental ability (GMA) test (an IQ-like test, such as the Wonderlic personnel screening test). Another is a work-sample test, where the applicant does an actual task or group of tasks like what the applicant will do on the job if hired. (But the calculated validity of each of the two best kinds of procedures, standing alone, is only 0.54 for work sample tests and 0.51 for general mental ability tests.) Each of these kinds of tests has about the same validity in screening applicants for jobs, with the general mental ability test better predicting success for applicants who will be trained into a new job. Neither is perfect (both miss some good performers on the job, and select some bad performers on the job), but both are better than any other single-factor hiring procedure that has been tested in rigorous research, across a wide variety of occupations. So if you are hiring for your company, it's a good idea to think about how to build a work-sample test into all of your hiring processes.<p>Because of a Supreme Court decision in the United States (the decision does not apply in other countries, which have different statutes about employment), it is legally risky to give job applicants general mental ability tests such as a straight-up IQ test (as was commonplace in my parents' generation) as a routine part of hiring procedures. The Griggs v. Duke Power, 401 U.S. 424 (1971) case<p><a href="http://scholar.google.com/scholar_case?case=8655598674229196978&#38;q=Griggs+Duke+Power&#38;hl=en&#38;as_sdt=2,24" rel="nofollow">http://scholar.google.com/scholar_case?case=8655598674229196...</a><p>interpreted a federal statute about employment discrimination and held that a general intelligence test used in hiring that could have a "disparate impact" on applicants of some protected classes must "bear a demonstrable relationship to successful performance of the jobs for which it was used." In other words, a company that wants to use a test like the Wonderlic, or like the SAT, or like the current WAIS or Stanford-Binet IQ tests, in a hiring procedure had best conduct a specific validation study of the test related to performance on the job in question. Some companies do the validation study, and use IQ-like tests in hiring. Other companies use IQ-like tests in hiring and hope that no one sues (which is not what I would advise any company). Note that a brain-teaser-type test used in a hiring procedure could be challenged as illegal if it can be shown to have disparate impact on some job applicants. A company defending a brain-teaser test for hiring would have to defend it by showing it is supported by a validation study demonstrating that the test is related to successful performance on the job. Such validation studies can be quite expensive. (Companies outside the United States are regulated by different laws. One other big difference between the United States and other countries is the relative ease with which workers may be fired in the United States, allowing companies to correct hiring mistakes by terminating the employment of the workers they hired mistakenly. The more legal protections a worker has from being fired, the more reluctant companies will be about hiring in the first place.)<p>The social background to the legal environment in the United States is explained in many books about hiring procedures<p><a href="http://books.google.com/books?hl=en&#38;lr=&#38;id=SRv-GZkw6TEC&#38;oi=fnd&#38;pg=PA271&#38;dq=Validity+and+Utility+of+Selection+Models+in+Personnel+Psychology&#38;ots=iCXkgXrlOV&#38;sig=ctblj9SW2Dth7TceaFSNIdVMoEw#v=onepage&#38;q=Validity%20and%20Utility%20of%20Selection%20Models%20in%20Personnel%20Psychology&#38;f=false" rel="nofollow">http://books.google.com/books?hl=en&#38;lr=&#38;id=SRv-GZkw6...</a><p><a href="http://books.google.com/books?hl=en&#38;lr=&#38;id=SRv-GZkw6TEC&#38;oi=fnd&#38;pg=PA95&#38;dq=Validity+and+Utility+of+Selection+Models+in+Personnel+Psychology&#38;ots=iCXkgXrnMW&#38;sig=LKLi-deKtnP20VYZo9x0jfvqzLI#v=onepage&#38;q=Validity%20and%20Utility%20of%20Selection%20Models%20in%20Personnel%20Psychology&#38;f=false" rel="nofollow">http://books.google.com/books?hl=en&#38;lr=&#38;id=SRv-GZkw6...</a><p>Some of the social background appears to be changing in the most recent few decades, with the prospect for further changes.<p><a href="http://intl-pss.sagepub.com/content/17/10/913.full" rel="nofollow">http://intl-pss.sagepub.com/content/17/10/913.full</a><p><a href="http://www.economics.harvard.edu/faculty/fryer/files/Fryer_Racial_Inequality.pdf" rel="nofollow">http://www.economics.harvard.edu/faculty/fryer/files/Fryer_R...</a><p><a href="http://books.google.com/books?hl=en&#38;lr=&#38;id=frfUB3GWlMYC&#38;oi=fnd&#38;pg=PA9&#38;dq=Validity+and+Utility+of+Selection+Models+in+Personnel+Psychology+%22predictive+validity%22+Duke+Power&#38;ots=5O9Hx_E1vY&#38;sig=g-zERWztBWq3h4guEuv9VVkTh8I#v=onepage&#38;q=Validity%20and%20Utility%20of%20Selection%20Models%20in%20Personnel%20Psychology%20%22predictive%20validity%22%20Duke%20Power&#38;f=false" rel="nofollow">http://books.google.com/books?hl=en&#38;lr=&#38;id=frfUB3GWl...</a><p>Previous discussion on HN pointed out that the Schmidt &#38; Hunter (1998) article showed that multi-factor procedures work better than single-factor procedures, a summary of that article we can find in the current professional literature, for example "Reasons for being selective when choosing personnel selection procedures" (2010) by Cornelius J. König, Ute-Christine Klehe, Matthias Berchtold, and Martin Kleinmann:<p>"Choosing personnel selection procedures could be so simple: Grab your copy of Schmidt and Hunter (1998) and read their Table 1 (again). This should remind you to use a general mental ability (GMA) test in combination with an integrity test, a structured interview, a work sample test, and/or a conscientiousness measure."<p><a href="http://geb.uni-giessen.de/geb/volltexte/2012/8532/pdf/preprint_j.1468_2389.2010.00485.x.pdf" rel="nofollow">http://geb.uni-giessen.de/geb/volltexte/2012/8532/pdf/prepri...</a><p>But the 2010 article notes, looking at actual practice of companies around the world, "However, this idea does not seem to capture what is actually happening in organizations, as practitioners worldwide often use procedures with low predictive validity and regularly ignore procedures that are more valid (e.g., Di Milia, 2004; Lievens &#38; De Paepe, 2004; Ryan, McFarland, Baron, &#38; Page, 1999; Scholarios &#38; Lockyer, 1999; Schuler, Hell, Trapmann, Schaar, &#38; Boramir, 2007; Taylor, Keelty, &#38; McDonnell, 2002). For example, the highly valid work sample tests are hardly used in the US, and the potentially rather useless procedure of graphology (Dean, 1992; Neter &#38; Ben-Shakhar, 1989) is applied somewhere between occasionally and often in France (Ryan et al., 1999). In Germany, the use of GMA tests is reported to be low and to be decreasing (i.e., only 30% of the companies surveyed by Schuler et al., 2007, now use them)."<p>Integrity tests have limited validity standing alone, but appear to have significant incremental validity when added to a general mental ability test or work-sample test.<p><a href="http://en.wikipedia.org/wiki/Employment_integrity_testing" rel="nofollow">http://en.wikipedia.org/wiki/Employment_integrity_testing</a><p><a href="http://apps.opm.gov/ADT/Content.aspx?page=3-06&#38;JScript=1" rel="nofollow">http://apps.opm.gov/ADT/Content.aspx?page=3-06&#38;JScript=1</a><p><a href="http://www.princeton.edu/~ota/disk2/1990/9042/9042.PDF" rel="nofollow">http://www.princeton.edu/~ota/disk2/1990/9042/9042.PDF</a><p><a href="http://www.hotelschool.cornell.edu/research/chr/pubs/reports/abstract-14602.html" rel="nofollow">http://www.hotelschool.cornell.edu/research/chr/pubs/reports...</a><p>To sum up, if you want someone who has some minimal level of programming ability to work for you, you have to TEST that ability among all applicants for your position.
评论 #4592945 未加载
tismeover 12 years ago
If I were presented with the 'fizzbuzz' test on a job interview I'd walk out.<p>I would really hate to work in a place that had such a ridiculously low bar to entry that they would consider that a valid test.
评论 #4591995 未加载
评论 #4591806 未加载
评论 #4591802 未加载
评论 #4591797 未加载
评论 #4591952 未加载
评论 #4591804 未加载