Tuesday 17 July 2018

The Buzz About FizzBuzz

FizzBuzz in tech, is a programming question designed to be trivial for people who can code, and a real test for people who can't. Basically, if you can't even solve FizzBuzz, you don't belong in any programming job. At all.

The test goes like this...

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".


Yep, it really is that simple. All you really need to know is how to iterate (For or While loops), logic Conditionals (If-Else statements) and how to use the Modulus operator to determine the divisibility of x by y. Stuff any fledgeling programmer would know.

To be brutally honest, FizzBuzz would barely be a Level 2 kata on CodeWars!

When the issue of FizzBuzz crops up, understandably, the first instinct most engineers get is to attempt to solve it. No, I'm not going to be exploring the many different ways to solving FizzBuzz today. If this is your thing, there's a list you can consult. Instead of how to solve FizzBuzz, let's take a look at the deeper question of why FizzBuzz?

Yes, why Fizzbuzz?

More than ten years after it first came out, FizzBuzz is still in use in some places today as an entry-level interviewing test.

Hiring managers claim that it is a great filter to weed out those who can't program at all. I think that's an astonishingly low bar for what I assume is a job where the complexity of the code is a lot higher.

There is also this (presposterous-sounding but apparently true) claim that 40% of job applicants can't solve it. And honestly, I don't think that says anything about how daunting a task FizzBuzz is. I mean, am I supposed to feel all special because I can solve FizzBuzz because "40% of job applicants can't solve it"? Get real. This only tells me that the wrong kind of people are applying for the job, because people who actually code for a living don't get stumped by FizzBuzz. Besides, it's a job. Anyone can apply for a job, including your neighbour's grandmother. The job applicants are simply job applicants, period, and there's nothing you can say to convince me that these people who are capable of failing the FizzBuzz test are actually professional programmers. Or even amateur ones.

Why not Fizzbuzz?

OK, it's not that I don't think FizzBuzz is effective for separating programmers from non-programmers. It clearly works. What I'm saying is, we shouldn't have to go there in the first place. Why are people who can't program, applying for programming jobs? Because hirers advertise for degrees in Computer Science, not the ability to solve FizzBuzz. Attract the right candidates and you won't have to waste time filtering out 40% of them.

Besides, being able to solve FizzBuzz simply means you know how to use a For loop, If statements and the Modulus operator. Big fat hairy deal! These should be a given! There are things far more important for a programmer employee to have, than the ability to solve FizzBuzz.

Can the programmer solve FizzBuzz under pressure? Under time constraints?


Coding under pressure.

Is his (or her) code clean, readable and extensible? If not, does that programmer understand why it's not, and why it's important for it to be so? Are the variables aptly named? Are the comments (if any; having no comments isn't a bad thing if you're only solving something like FizzBuzz) actually useful? Is your candidate a cowboy cop or does he understand the value of teamwork? To be clear, there's a place for both in the right context. What does your organization need?

These seem petty, right? Code should work, end of story? If that's the candidate's attitude, that candidate should forget about having a place at the table. Professionals care about excellence. In this day and age, programming has increasingly become a team sport. The ability of a programmer to communicate and collaborate with others, has become key. The ability to solve something as trivial as FizzBuzz is only, and will always be, nothing more than elementary.

That's all. Buzz off!
T___T

No comments:

Post a Comment