Speaking from personal experience, the number of people with multiple years of experience and multiple degrees in CS (usually BS and MS) who can't pass FizzBuzz is really high.
http://www.gayle.com/blog/2016/1/fizzbuzz-youre-doing-someth...
It doesn't sound like this is the problem, though, in all the cases. It sounds like someone who majored in CS was unable to write this.
Which seems inconceivable to me. And yeah, "inconceivable" is often based on wrong assumptions (it was the basis of one of the oft-repeated lines from cinema: you keep using that word. I do not think it means what you think it means).
But... is there a chance that maybe "CS" just means different things from different programs. I feel like it should be... well, impossible for someone who graduates from a proper CS program to fail to write fizz buzz.
I know, I know, the "no true scotsman" is already getting typed into the response field. But here's the thing, I'm not defining a "proper" program as one that results in an ability to write fizz buzz. I'm defining it as a program that contains, at a minimum, basic algrothmns and data structures. Do people graduate with CS degrees without coding a linked list, binary tree, doing basic sorting, and set permutations?
I'd say if you take that one required class, it should be more or less impossible to not write fizz buzz. I'd be interested in knowing what the "CS" curriculum was for people who can't write this.
I know people confuse CS and IT/CIS, but even at that, those majors generally require at least one basic CS class.
That said... I keep hearing about fizzbuzz, and I'm not sure what I think of the complaint. I hear something along the lines of "We need to do technical screening because you wouldn't believe how many people can't do fizz buzz", but the questions aren't fizz buzz, they're "find all matching subtrees in a binary tree", often at the whiteboard, in 45 minutes. I'm not saying that this is (or isn't) unreasonable, just that there's an awful big difference between fizz buzz and the kind of questions I've encountered in a typical tech interview.
Or keep two extra counters that you increment every iteration and reset when they hit 3 or 5.
Not knowing modulus or bitwise ops etc isn't a good sign, but it isn't disqualifying. Not being able to get fizzbuzz working should be disqualifying, though, unless you're willing to teach someone to program completely.
I am sure that any CS major couos write fizz buzz, on their computer, for the purpose of their homework assignment or whatever.
Whether or not they can do the same thing, in 15 minutes, on a whiteboard in front of someone is a different story.
The moral of this story is that writing code, on a blank slate, while having to have all the syntax memorized, and having everything conpile without having access to a compiler, is a real skill that many people haven't even attempted to do.
I straight-up tell people I don't care if you use the wrong method name (in Python is it ends_with() or endswith? toupper, to_upper, or upcase?). Heck, I even tell them I don't care what language it is as long as it's not too weird.
A few months back I interviewed someone who was currently employed as a software engineer at a major company in Silicon Valley, who couldn't even figure out how to write a tiny little program which kept track of state across method calls. I told him that he could store the state in global variables, make an object to track the state, or anything else he wanted; still couldn't make any progress outside creating a single stateless function. I was truly puzzled.
#include <iostream>
using namespace std;
int main()
{
for (int i = 1; i <= 100; i++)
{
if ((i % 3 == 0) && (i % 5 == 0)) cout << "FizzBuzz" << endl;
else if (i % 3 == 0) cout << "Fizz" << endl;
else if (i % 5 == 0) cout << "Buzz" << endl;
else cout << i << endl;
}
} #include <iostream>
using namespace std;
int main() {
for (int i = 1; i <= 100; i++) {
bool t = (i % 3 == 0);
bool f = (i % 5 == 0);
if (!t && !f) { cout << i << endl; continue; }
if (t) cout << "Fizz";
if (f) cout << "Buzz";
cout << endl;
}
}
But most interviewers are interested in the basic logic of the process.That's not even close to true. I've interviewed people with Ph.D.'s in Computer Science and a documented 10+ years of experience as a "developer" of some sort, who can't write Fizzbuzz.