Pete Zaitcev (zaitcev) wrote,
Pete Zaitcev

One year of FizzBuzz

FizzBuzz is an example of an interview question where the challenger is given a trivial problem with the objective to belt out a complete program.

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

Most good programmers should be able to write out on paper a program which does this in a under a couple of minutes.

Want to know something scary ? - the majority of comp sci graduates can’t. I’ve also seen self-proclaimed senior programmers take more than 10-15 minutes to write a solution.

Something scarier for me personally is that it took me 5 minutes to do it. I don't know just who would be able to finish in 2 minutes. It looks like they are measuring the speed with which a person can write on paper instead of programming ability.

If they start asking this shit at interviews, my only hope is real estate or insurance.

P.S. English kids who play this game in kindergarten are freaking geniuses. The only sensible plan seems to be to keep two counters, which is actually quite challenging. I saw mental excersises like that, given in all seriouseness. For example, you read a long string of icons and count the number of ducks and airplanes in it, separately. Virtually nobody can keep track of 4 items together. The alternative for the kids is to sum numbers for a division by 3 really quickly. I don't know if kids are up to it.

UPDATE: Yenya wrote "Pete mentions that even some comp.sci graduates cannot solve this problem." I don't think it was I. The original article did.


Comments for this post were locked by the author