| Java | ||
| LICENSE | ||
| README.md | ||
Fizz Buzz
The popular puzzle/game FizzBuzz in different variants.
What is Fizz Buzz?
Fizz Buzz is a game played by young children to practice math, particularly division. The players take turns counting up, but when the number is divisible by 3, they say "Fizz" instead of the number, and if it is divisible by 5 they say "Buzz". If it is divisible by both 3 and 5, they say "FizzBuzz" instead.
A typical sequence would look like this: "1, 2, Fizz, 4, Buzz, Fizz, 7, 8, ..., 14, FizzBuzz, 16, 17, Fizz, ..."
FizzBuzz as a coding test
FizzBuzz as a coding puzzle is sometimes used when learning a new programming language, similar to a slightly more complex "Hello World" program. It is also a popular coding test for technical interviews, intended to efficiently weed out programmers who can't solve the bare minimum of the easiest programming problems before spending more time and effort to evaluate an actual competent programmer's skill.
In the context of programmer interviews, some argue that FizzBuzz is too difficult (!) since a candidate might fail due to trivial things like not knowing the modulo operator, since it is not needed very often by some programmers. However, a competent programmer should be able to come up with a solution to extremely simple problems like "is this number divisible by 3" on their own, despite lacking knowledge of some particular language feature. This code base contains different implementations of FizzBuzz, many of which do not require certain language features like, e.g., the modulus operator.
Contrary to other FizzBuzz variants like the popular "FizzBuzz Enterprise Edition", these are not intended as a joke, but as actual alternatives, for example in case one needs to implement it in an unfamiliar language or forgot some syntactical details. Or, more likely, one might need a similar technique in a totally different situation, and it is always good to be aware of alternative options (and their trade-offs). If it inspires some to think differently about programming language syntax vs. problem solving ability, e.g., those who conduct technical interviews for entry-level programmers, that is also a win.