When you are interviewing job candidates, how do you know if they can really write good code? Do they simply copy/paste previous code from other projects? Or do they lead the development with new and creative code? In an interview, you need to ask only one question:

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”.  Link to original question

Sounds pretty trivial right? You would be surprised at how many developers can not complete this simple exercise. Here are some comments from hiring managers who asked this question:

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.

I’ve personally interviewed graduates who can’t answer “Write a loop that counts from 1 to 10” or “What’s the number after F in hexadecimal?” Less trivially, I’ve interviewed many candidates who can’t use recursion to solve a real problem.

Pretty alarming huh? So in your next interview, you can skip past the normal questions “Tell me about your previous project.  Have you used Hibernate/JSF/Framework X”?  Instead, just cut to the chase and ask the FizzBuzz question.