Practical uses for FizzBuzz Part 1

by George 29. January 2010 06:40

In the Army, there were generally questions about soldiering that personnel looking for promotion would be asked. They would spend a day going before a promotion board in their crisp uniform and be asked questions about being a soldier.  Questions like: What are the different MOPP Levels? What is the process for clearing a weapon jam in an M16?  What is the effective range of a M16? What is "Danger close" for an MLRS? 

In case you were wondering, "Danger Close" for an MLRS is a whopping 1km x 1km.

Sadly, software development doesn't let me ask such cool questions. I have to stick with things like "What is inheritance and what is composition, and when would I use either?"

However, much like the questions the Army promotion boards ask, these questions we ask developers are just as useless.  A great soldier may not know the effective range of an M16, but he can hit what he can see -- and that's even better.

A software developer may not know the word 'composition', but they recognize bad design when they see it; and they recognize good design when they see it.

This makes a change of tactics necessary, as it were.

Don't ask questions about Object Oriented design -- have the candidate design something for you.  Don't ask questions about code -- have the developer write code for you.

 

The easiest way to do the first is to use something like Monopoly to conduct the interview. To do the second? Something like Fizzbuzz would do just as well.

 

The great thing about Fizzbuzz (even though it's shockingly simple) is that it can serve to show a few things:

1. Does the candidate know the language? (If someone is using 'Mod' in C#, that's a good sign they don't really work in that language much (which is doubly disconcerting if the word 'Expert' is next to 'C#' on their resume)

2. How do they structure their code? Do they go for the elegant solution? The Simple solution?

3. It provides a basis for refactoring. This shows you if they can think about the potential problems in their code.

 

    for (int i = 1; i <= 100; i++)
{
string result = String.Empty;
if (i % 3 == 0)
result += "fizz";
if (i % 5 == 0)
result += "buzz";
if (result == String.Empty)
result = i.ToString();
Console.WriteLine(result);
}

In our next wonderful adventure, I'll go into how to use a simple programming exercise to determine a candidate's ability.

Tags:

Comments (4) -

Ivan Dwellingham
Ivan Dwellingham United States
3/18/2012 5:19:29 AM #

I want the Diana Ross!What do you expect, I'm gay after all!

Reply

Katrice Cerao
Katrice Cerao United States
4/11/2012 7:27:34 AM #

I felt sorry for him until I learned he named two of his children Casey Anthony....

Reply

how to learn about stocks
how to learn about stocks United States
4/25/2012 8:00:33 AM #

Top 10 Ubuntu Software Centre app downloads for December 2011

Reply

Tory Bemis
Tory Bemis United States
4/28/2012 2:05:04 PM #

I agree, I think the SVN2FTP' form is really interesting and clever design, I like the clean style of Think Vitamin Membership'. Id love to know how to incorporate a send' button like on Social Design House' Im guessing its a big image button directly underneath the message box, correct me if i'm wrong though.

Reply

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Me!

This space intentionally left blank.

Month List

Page List