4 ms·
Why do people say "doing fizzbuzz" rather than just programming? Fizzbuzz is just a trick question to see if new programmers know how to use the modulo operator
by UnoriginalGuy 13y ago
Why do people say "doing fizzbuzz" rather than just programming? Fizzbuzz is just a trick question to see if new programmers know how to use the modulo operator or not.
- rmc 13y agoFizzbuzz is a test for programming-ability. It's easy to explain, easy to grade, easy to run. If you wanna check if someone can programme, then someone else has already come up with a good test (fizzbuzz) to give them.
- precisioncoder 13y agofizzbuzz I find is also used as slang for "Groks simple programming". I would say any fizzbuzz equivalent would be fine too.
- Wilya 13y agoKnowing how to fizzbuzz doesn't make you a good programmer. But not being able to do it is a very strong signal that someone can't program in any professional setting, no matter what they pretend. It's a very simple and effective test to rule out people who think/pretend they can program, but really can't.
- exDM69 13y agoI have been to student recruitment events at universities hiring software engineers for quite advanced level jobs. We give out a programming quiz (with a nice prize) at these events and we include the fizzbuzz puzzle. We allow solutions in any language and give out style points for nice solutions. Our experience is that the answers to fizzbuzz are a good classification criteria in vetting who has got programming abilities and who has not. Most people who actually try can solve it, but the ones who are talented give out either a perfect and simple solution or do something elegant and go for the style points. The ones who don't give out a fumbling solution that is too long or shows signs of not being comfortable with the task at hand, even if they manage to write a computer program that produces the correct results. As silly as it may sound, the fizzbuzz test is a good classifier for programmers. I didn't believe it until I saw the evidence from the quality of candidates we got.
- eterm 13y agoFizzbuzz isn't just modulo, as evidenced by the amusing number of incorrect solutions under the original article.
- ajuc 13y agoYou can solve fizbuzz without modulo operator: bool divisible_by(int a, int b) { return a==((a/b)*b); } It doesn't require anything more than knowledge about what division means, and I think it's fair play to require such knowledge from programmers.
- Houshalter 13y agoMaybe this is a stupid question, but wouldn't that always return true? (a/b)*b just cancels out the b right? Unless there is weird floating point stuff going on.
- Dylan16807 13y agoOr even if you don't know anything about integer math, you can use repeated subtraction. Or ask for help on finding a multiple and do the rest of the structure yourself. Or keep a counter to 3 and a counter to 5 and reset them when they fill up. Definitely not a gimmick question about whether you know about modulus.