Fizz Buzz is a common developer interview question; so common it’s almost cliché!
The challenge is designed to weed out 99.5% programming job candidates who cannot creatively use their coding knowledge to solve coding problems.
Want to give it a shot?
Fizz Buzz Write a FizzBuzz.java program that outputs numbers from 1 to 100… with a catch:
For multiples of 3, print Fizz instead of the number. For the multiples of 5, print Buzz. For numbers which are multiples of both 3 and 5, print FizzBuzz.
example:
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 Fizz 19 Buzz ... 97 98 Fizz Buzz