Menu Home

Elementary programming

If you want a job as a programmer, you need to know how to fizz buzz.

Apparently some people don’t tell the complete truth on their job applications. I know, I’m as shocked as you are. I don’t know if this is especially true for computer programming jobs, but it wouldn’t surprise me if people claimed to be intermediate proficiency in a specific language – but know barely anything beyond the basic syntax.

The need, therefore, is to identify the people with minimal competency in a language quickly and effectively. One way to do this is to get programmers to play a children’s word game: the FizzBuzz test.

I never tried the fizz buzz game growing up. The basic concept is to count from 1 to 100, but every time a number is a multiple of 3 you say “fizz” instead of the number, and every time it’s a multiple of 5 you say “buzz” instead. Every time it’s a multiple of both you say “fizz buzz.” A little like how the letters in Bingo are replaced by claps, with a hefty dose of mathematics over the top. Players take turns saying the numbers or fizz buzz replacements, and if you mess one up you’re eliminated.

What does this have to do with programming? Well, the FizzBuzz test challenges someone to write code that can produce that list of numbers and replacements: 1, 2, fizz, 4, buzz, fizz, 7, 8, fizz, buzz, and so on. As with any programming, this can be achieved any number of different ways – some more efficient, some more ornate, some positively tortuous. But the point is that this task effectively and immediately exposes the coding fraudsters.

If you want to go into FizzBuzz in more detail then I strongly recommend the link below titled “FizzBuzz in Too Much Detail.” It uses this test to illuminate the nature of decision-making in programming, specifically effort vs. payoff. And if you happen to know Java, check out the satirical implementation in the link titled “FizzBuzzEnterpriseEdition.”

Categories: Mathematics & statistics Sciences Technology

The Generalist

I live in Auckland, New Zealand, and am curious about most things.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: