Earlier quoted context omitted.
I've seen: 1) Incorrect ordering of output "Buzz Fizz" 2) Printing only Fizz or Buzz for 15. 3) Starting at a number different to 1 (say 0) 4) Off by one error at the end (going to 99, instead of 100) 5) Forgetting to print out the number when neither Fizz nor Buzz is output (first output is Fizz for 3) 6) Always printing out the number. (3 Fizz) and that's the people who can code at all. Then you get people who can'…
Fantastic list of mistakes! It made realize that I've made all of these mistakes on tasks similar in complexity of Fizzbuzz. I write a lot of scripts in different languages some of them quite domain specific. Why do I make mistakes? Most of time the mistakes stem from the fact that I do not have to get it right the first time and I may have misread the specifications. As Hemingway said: "The first draft of anything i…
The FizzBuzz test exists to quickly filter out candidates who really cannot code at all, despite what they say in their CV, what jobs they have done in the past, or what courses they have passed.
If you can show that yes, you understand what for loops and if statements are, and can write 10 lines of code roughly correctly, the test is passed and the interview can continue with more interesting questions.
If no, then it saves everyone time to just cancel the interview.