Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

For one thing FizzBuzz is like... 5-6 statements? This function has 13. FizzBuzz has a whopping 1 variable to keep track of. This function has so many I'm not even going to try to count. I'm not going to keep arguing about this, but if you want to believe they're equally simple then you'll just have a hard time convincing other people. That's all I have left to say on this.


sort by: page size:

I think fizzbuzz-level logic is so simple it's not really abstracted away when programming. No matter how many nice libraries you have you can't avoid writing loops and if checks.

This was literally part of my first programming assignment in college. Can people really not do this? Isn't fizzbuzz considered too obvious these days? I feel like I must be misunderstanding...

Yes. Fizzbuzz is redundant, perhaps by design. If you start thinking to optimize the redundancy away, like “why do I need to divide by 15, if I am already dividing by 3 and 5”, you spend some precious 30 seconds thinking, and look exactly like an idiot who doesn’t know how to program at all.

I think FizzBuzz is complete bullshit, I find it very hard to believe most programmer's can't solve this.

At least with fizzbuzz you are working through how to logically solve a problem. This is just regurgitating a formula. I don't see how this is helpful.

I don't ask multiple questions like FizzBuzz, but I do ask for FizzBuzz. (I will explain the modulo operator if necessary because it doesn't come up that often in web development and people many forget about it until prompted.) Everything else about FizzBuzz (loop over a range, use a conditional, define a function, compare, etc.) is so basic you would think you wouldn't need to test it - but then you run into a person with 10 years experience who can't do it.

It's a (sadly) useful screen. Even more sad when you realize how popular and widespread that particular question is.


That's honestly more impressive for creativity sake!

FizzBuzz is just an example of the general problem of "given a set of things, do something to a subset of those things" which comes up often in real world settings. If you knew enough to set up a loop and apply some conditional inside of it, then you passed better than some of the programmers I've worked with.


A FizzBuzz is a for loop and if-elif-elif-else in the simplest implementation. If you can’t come up with code for it (given the full problem statement, of course), then you can’t program at all.

Fizzbuzz isn't a trick questions that you have to have heard of. It's designed to be an EXTREMELY easy question, answerable by anyone with even a basic knowledge of programming. It's not a game. It's a way to weed out people that don't know anything.

If you have been programming for 35 years, you'll probably be appalled by how easy it is. Look it up.


Fizzbuzz is useful because people fail it even if you give them info about loop structures and info about mod operators.

It's only sometimes about people not being aware of a language feature. It's usually about people not being able to program.


Personally I prefer a fizz buzz that doesn’t make them variables. The loop is so small and it’s obviously never “hot” enough code to make it worthwhile to pull the variables out. It looks like over-optimization to me.

What makes it not simple like FizzBuzz? You will not be able to come up with a reason why this one single function is copyrightable, but a FizzBuzz function isn’t. It’s one function in 15 lines of code. Get 1,000,000 developers to implement that function and you’re not going to have anywhere near 1,000,000 substantially different implementations.

You're reading way too much into fizzbuzz. Whenever I get a problem like this on a white board I know that it's just a screening question, so I solve it. Solving this toy problem is nothing like solving actual problems in the real world. If you use fizzbuzz for its intended purpose, great. If you're doing it like this, you're going to reward the people who are incompetent enough to need to draw out every implication of a 3 line function.

There’s a finite number of ways to implement a working FizzBuzz (or anything else) in any given language, that aren’t substantially similar, is my point. At least without introducing pointless code for the explicit purpose of making it look different.

I would attribute some of it to translating the word problem into a logic problem, which I think Fizzbuzz is really testing. Once you see it's just one conditional testing multiples of 3 and 5, and understand it covers the whole problem, it becomes trivial.

FizzBuzz has to be the simplest coding exercise out there after hello world. No matter how much pressure you feel it can't be hard to figure that out?

I disagree. What's tricky about a naive solution for FizzBuzz? The only argument I could think of is "well it uses modulo which isn't all that standard". Not knowing modulo (or "how do I check if a number can be divided by another number") is a very bad sign (imo)...the rest is printing stuff, branching, a loop, methods/functions and getting a program to run (+maybe TDD). Those are all rather fundamental building blocks.

People really need to stop lumping fizzbuzz into their hatred of "trivia" questions. You don't do variations of fizzbuzz. Fizzbuzz is not a challenge, it is not trivia, it is not a trick question or a brain teaser. It is the simplest, most inane function you can ask someone to write. It exists purely to filter out people who simply can not write any code at all. It is a test of "does this person understand the concept of a loop, and the concept of a conditional". That is it.

I mean I would even consider fizzbuzz a riddle. It’s one of the simplest programming tasks I have ever been asked in a technical assessment. Do you have a preferred alternative?
next

Legal | privacy