FizzBuzz without multiplication or division
jacob.jkrall.net
jacob.jkrall.net
Yes, there are 100 ways to solve it. That doesn't matter. It's not meant to be a major intellectual challenge.
if(ix==15) ix = 0;
Should I change this to say ix = ix & 15;
Or is that too specific to 3,5-Fizzbuzz?It would work with a 2,8-fizzbuzz, though.
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; istr = string(i)
if '5' in istr or istr[-1] == '0':
print "Buzz",I find it extremely hard to believe, but I've read on two other blogs that it's a common test given to interviewees.
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.
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.