Granted, it is not a thing you should give everyone. I can usually tell when I look at a resume that such a thing is likely to be pretty pointless (It points me to a github account I can look at instead? Why bother? The resume is clearly written by someone who knows what they're talking about and isn't stuffing everything they've ever done onto a page in a game of buzzword bingo? Probably safe.) so I don't give fizzbuzz tests to everyone but sometimes you have to be sure.
Hopefully I'll have some good github stuff to point potential employers to soon (i'm working on some things now). But at least I know that I should be able to pass some of the incompetency gauges fairly easily!
also, i've never heard of buzzword bingo before, but it sounds interesting! maybe i'll make a program for buzzword bingo. You can use it in your interviews! :P
But actually, fizzbuzz is just the bottom level. You also want to do basic coding exercises for whatever specific area you are hiring for, such as:
- Set up an extremely basic web app that lets the user enter a name and echoes it back to them.
- Make a sprite move across the screen.
- Display a 3d cube with different colors on each side and make it rotate.
- Make it play some music.
- Aggregate the data in this simple database.
- Here's some naive producer-consumer code. Make it thread-safe.
- Debug this code that has memory issues.
- Critique this (flawed) design.
- Update the CSS to make this page look nicer.
Basically, you never want to get into a situation where you've hired someone who has managed to talk his way through life. It's far less headache to just use a few sanity checks on every potential hire.
sub isIP {
return (shift =~ m/^((\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])$/)? 1 : 0;
}The Stanford CS Ph.D. candidate whose solution included a Perl function for converting decimal numbers of up to three digits to binary was rejected.
- writing a subroutine
- understanding Perl parameter passing
- understanding Perl regexps, including =~, anchoring, alternatives, metacharacter escaping, character classes, and repeat counts;
- the ternary operator.
And then you could probe things like:
- Do they know how to fix the bug in your version where it incorrectly accepts an IP address with a newline appended to it?
- Do they know it would still work without the return and the ?1:0?
- Can they figure out that they could simplify and clarify the code substantially with qr?
- Do they understand why someone might prefer a non-regexp-based approach? :)
The guy was writing some really weird stuff. When asked to explain, he confidently told us that in C++, every time you reference the iterator variable inside the loop, it gets increased. His solution was something like:
for (int i = 1; i <= 10; i++)
{
printf("%d\n", i); // <== i gets incremented!
i--; // need to compensate for the extra increment!
}
(except I'm pretty sure he didn't get printf right)So, yeah, I see FizzBuzz as a wonderful way to weed out the incompetent right away, allowing you to focus on deciding whether you need capable or exceptional.
Incidentally, one of the guys on my senior project team in college didn't understand how variable assignment worked. He would write:
int flagsVar = COMMON_BASE_FLAGS;
flagsVar = ADDITIONAL_FLAG_I_WANT;
CallAPI(flagsVar); // Why doesn't it work?!
He graduated.