Cowabunga. I do totally believe you, though. I was the guy doing fizzbuzz screens at a prior job. Before that, I would not have believed the failure rate for that step of the process. "The person has a job as a senior software engineer? Of course they'll ace fizzbuzz! It's insulting to even suggest otherwise!" And yet. I bet at least a third of the candidates simply could not pass that to save their lives. I went out of my way to be the friendly, relaxed, conversational interviewer, too. I never wanted to turn away a good candidate because I intimidated them or made them feel uncomfortable. And with all that, it
still didn't work out.
A concrete example: one person could not get it through their head that they could write a function to return the correct value, then unit test that function with arbitrary known values. My question: "how do you know if it gets the right answer for 1,000,000,000,005?" What I wanted:
def fizzbuzz(n): ...
assert fizzbuzz(1_000_000_000_005) == "fizzbuzz"
or something similar. What they offered:
"OK, we'll loop from 1 to n and write each of the values out. Then we can compare the contents of that file with a test case!"
"How is that going to work for values like 1 trillion something?"
"We can compress it!"
"And how long is this unit test going to take?"
"Well, let's assume we can process a million answers per second..."
"Aren't you going to run out of hard drive space at some point?"
"We can use `tail` to get the last few lines!"
"OK, let's start over. Can you imagine any way to test some arbitrary value in O(1) time?"
"Nope, can't be done."
"Sigh."