Anybody have any good FizzBuzz type questions that are not the FizzBuzz problem?
I am interviewing someone and FB is relatively well known and not that hard to memorize, so my first stop in a search for ideas is my new addiction SO.
Fizz Buzz is a very simple programming task, asked in software developer job interviews. A typical round of Fizz Buzz can be: Write a program that prints the numbers from 1 to 100 and for multiples of '3' print “Fizz” instead of the number and for the multiples of '5' print “Buzz”.
To pass the test you must write a function that accepts an integer and returns a string. Which string to return depends on the input number: If the integer is evenly divisible by three, it should return “Fizz”. If the integer is evenly divisible by five, it should return “Buzz”.
Solution steps We run a loop from 1 to n and check divisibility by 3 or 5 or both. For i is divisible by both 3 and 5, we add string "FizzBuzz" at the ith index of the output string. Else, if integer i is divisible by 3, we add "Fizz". Else, if integer i is divisible by 5, we add "Buzz".
Players generally sit in a circle. The player designated to go first says the number "1", and the players then count upwards in turn. However, any number divisible by three is replaced by the word fizz and any number divisible by five by the word buzz. Numbers divisible by 15 become fizz buzz.
I've seen a small list of relatively simple programming problems used to weed out candidates, just like FizzBuzz. Here are some of the problems I've seen, in order of increasing difficulty:
These were for Java, and you could use the standard libraries so some of them can be extremely easy (like 6). But they work like FizzBuzz. If you have a clue about programming you should be able to do most pretty quickly. Even if you don't know the language well you should at least be able to give the idea behind how to do something.
Using this test one of my previous bosses saw everything from people who aced it all pretty quick, to people who could do most pretty quick, to one guy who couldn't answer a single one after a half hour.
I should also note: he let people use his computer while they were given these tasks. They were specifically instructed that they could use Google and the like.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With