5 ms·
I've been doing FizzBuzz and a few other code-related tests for the last few years. It was an odd shock when I realized that was the /only/ part of the intervi
by techdmn 14y ago
I've been doing FizzBuzz and a few other code-related tests for the last few years. It was an odd shock when I realized that was the /only/ part of the interview process that had any value to me whatsoever. I mean it. I have seen people display radically different personality traits between the interview and work on Monday. The guy who was almost too nervous to speak in the interview won't stop talking peoples' ears off. The guy who really sold himself well is very shy and quiet now that he has to show up every day. I wouldn't believe if it I hadn't seen it. Not to mention language lawyers, etc. But coding tests have predictive value. YMMV of course.
I'm also surprised how many people get it wrong. I see a lot of this (pseudocode):
for (i = 0; i < 21; i++) {
if (i % 3 == 0) {
print "fizz";
} else if (i % 5 == 0) {
print "buzz";
} else if (i % 3 == 0 && i % 5 == 0) {
print "fizzbuzz";
}
}
Yeah, see, one of those branches is never going to be reached.
- potatolicious 14y agoConsider yourself fortunate, I've screened candidates who didn't get past the "for" keyword because they couldn't construct a loop in a language of their own choosing, even after I reminded them that perfect syntax is not necessary. I've had a surprising number of candidates who did not know about the existence of the modulo operator. Not just "I completely forgot about it", but more like "what's the % sign mean?".
- spamizbad 14y agoI'd forgive an entry-level candidate (straight out of college) for not knowing about the modulo operator. We had one who solved it correctly using floor/ceiling. If they're claiming 3+ years of experience though, I'd say not knowing about modulo is a red flag. It means they're being dishonest about their actual experience, or those 3+ years of experience are very narrow, and/or they're not terribly curious about the field.
- swivelmaster 14y agoI once had a candidate claiming to be a senior PHP programmer solve fizzbuzz by doing something like this: if (strpos($i/3, ".") != null) or something like that. I was sad.
- Someone 14y agoI googled to see whether this was creativeness or just copying stuff from the net, and came across http://www.php.net/manual/en/language.operators.arithmetic.php http://www.php.net/manual/en/language.operators.arithmetic.p.... It states: "Operands of modulus are converted to integers (by stripping the decimal part) before processing." => 4.5 % 1.5 is zero, as is 4.6 % 1.9. So, in the world of PHP, there may be logic in that strpos approach. As far as I can tell, it certainly isn't much worse than http://www.webdeveloper.com/forum/showthread.php?76114-Work-out-if-int-is-a-multiple-of-3 http://www.webdeveloper.com/forum/showthread.php?76114-Work-... advocates. And no that is not worth much. I know almost nothin about PHP, and prefer to keep things that way.