If you're a SaaS company and you're hiring a sales person, instead of the typical "sell me this pen" you can even replace it with "sell me FizzBuzz".
I'm telling you, it's bullet proof.
If you're a SaaS company and you're hiring a sales person, instead of the typical "sell me this pen" you can even replace it with "sell me FizzBuzz".
I'm telling you, it's bullet proof.
Outside that, yeah. It indeed boggles the mind that the vanilla version of it could be failed by anyone who has taken elementary programming course.
You can make FizzBuzz incredibly complicated if you deviate from the vanilla FizzBuzz.
RunFizzBuzz("");
RunFizzBuzz("3=Fizz,5=Buzz");
RunFizzBuzz("7=Rutabaga");I like this exercise and I sent it to a friend who has a few years of programming experience but is still learning heavily.
The first solution lacked the number being printed but everything else was right. Second solution had the number, but he missed the FizzBall when the number was divisible by both three and five. The third solution lacked the Fizz when it was divisible by three. Finally his fourth solution was correct.