26 comments

[ 2.6 ms ] story [ 69.6 ms ] thread
Are there really people who apply for programming jobs but aren't able to write a simpler version of that program?

I find it extremely hard to believe, but I've read on two other blogs that it's a common test given to interviewees.

I've certainly had applicants who really struggled with it.
Do you dictate the language in which it's written, or let them choose? That's the only thing I could see being a valid hangup for anyone applying to a programming job...
The position for which I use this question is titled "Experienced ASP.NET/C# Developer", so I really expect the candidate to know C#.
It's not like a sea of qualified candidates lines up for every programming job. If you post a job listing on any major jobs board, 99% of the candidates that respond will be one of the following:

1) A contractor from another country (usually India) saying they'll do the same work on contract for some crazy low rate.

2) Someone who cannot write coherent English.

3) Someone CAN write coherent English and is NOT a contractor, but their resume shows that they are completely unqualified for the position. The kind of people who's most relevant qualification for "Senior Software Engineer" is "Microsoft Word, 50WPM" They likely just spammed their resume to every listing they saw.

Lots of chaff, very little wheat.

With that said, anyone can choke in an interview. When I was young and inexperienced I blanked when asked to write a linked-list in C++. The sad part? I anticipated this question and "practiced" it at home 3 before the interview transpired. Needless to say, I was red-cheeked after staring at a blank Whiteboard for what felt like an eternity (turns out it was only 5 minutes) - after which point I capped the marker, apologized for wasting the interviewers time, and left.

I was surprised at how many 'experienced' candidates came in for interviews at my last job who literally could not correctly code a 'for' loop.
Most applicants are below average quality. This is because the good applicants get a job quickly while the bad ones go on to apply for many many more jobs.

Add in the increasing number of people with no passion for programming who studied it simply because they thought is was an easy well paying job, and you have people that apply for programming jobs that lack basic capabilities.

Is FizzBuzz getting used so often in interviews that we're supposed to expect that people will have seen it before, thus the need to put a twist on it? This may say quite a bit about the unoriginality of interviews, if that is the case.
I use it as a warm-up in every interview question, and it takes longer to actually write a solution than to reason your way through it, so I've had a long time to think specifically about this problem while waiting for candidates to finish typing. It's always interesting to see what sort of half-baked idea I come up with by the end.
I've had several technical phone interviews and programming challenges in the past week, and nothing has been even close to as easy as FizzBuzz. Do places actually give it out in interviews?
I only use it as a warm-up, because I understand that interviews are pretty stressful. Then I'm dumbfounded when someone who applied for the "Experienced ASP.NET/C# Developer" position can't even get through my warm-up.
We used to give it to candidates who showed up overly early to interviews. Something reasonably simple they could do waiting in reception while we got people together for the actual interview. I think the success rate was around 50% with the most common error being incorrect conditionals.
Part 2 (http://jacob.jkrall.net/fizzbuzz-without-multiplication-or-d...) has my favorite solution in the series.
Me too. What do you think about the line

     if(ix==15) ix = 0;
Should I change this to say

     ix = ix & 15;
Or is that too specific to 3,5-Fizzbuzz?
Are those really equivalent? What if ix == 15?

It would work with a 2,8-fizzbuzz, though.

(comment deleted)
Whoops, I wrote that far too late last night. 15&15 = 15, so of course it wouldn't work :)

A 2,8-fizzbuzz would only need 8 items in the circular array since the least common multiple of 2 and 8 is 8:

    ix = ix & 8;
This is a weakened version of FizzBuzz---I was taught the version that has you buzz on any number that is divisible by five OR which has a five in its base-ten representation. Which would be a lot harder to do without multiplication or division. :)
It would actually be pretty easy to do without (explicit) multiplication or division: just convert it to a string and check text properties. Whether or not it would be any faster is another question, to which I'm almost certain the answer is no.

  istr = string(i)
  if '5' in istr or istr[-1] == '0':
     print "Buzz",
For that to be valid, in my opinion, you first have to write an integer-to-string converter that also doesn't use multiplication or division. From what I've seen (and written) of such code, that's not trivial.
Hmm... the printf("%d\n") in my solution uses division implicitly, for that very reason.
Feels like the lookup array could be generated at compile time by the C preprocessor somehow...
FB has really been overanalyzed. It's a test of if you can program at all. 90% of applicants couldn't pass it so it was once a useful quick first line filter if they have any skills at all.

Yes, there are 100 ways to solve it. That doesn't matter. It's not meant to be a major intellectual challenge.

The simplicity of the problem, when combined with the repetition of dozens of coding interview warm-ups, converts my restless mind into a FizzBuzz chaconne composer.