I would really hate to work in a place that had such a ridiculously low bar to entry that they would consider that a valid test.
I would really hate to work in a place that had such a ridiculously low bar to entry that they would consider that a valid test.
The vast majority (in my experience, 80%+) have no business writing code at any level. We're not talking about bad programmers here, we're talking about people who cannot program, full stop.
I can deal with "I'm not nearly as good as I say I am", I cannot deal with "What's an if statement?", but yet the majority of applicants at most large software firms are like this.
If you are a competent dev, FizzBuzz isn't designed to trap you, it's designed to trap someone far, far, far, far, far, far, far, far less competent than you. Just jump through this hoop and we can start the real interview.
You also make the mistake that FizzBuzz is the whole interview. It isn't. I've run many highly rigorous interviews, FizzBuzz is just the bar for me to talk to you past the 5 minute mark.
What I still don't get is how these people even exist. It's like showing up to an accountant's interview with a box of crayons and a bib. It's disturbing.
But I have this odd suspicion that, in real life, you wouldn't actually walk out.
Actually leaving is a bit harsh, though, since you don't know why they're asking the question. And you're definitely burning a bridge, which is probably a bad idea.
Why don't you ask the interviewer why they're using that question - after you answer it correctly and quickly? That will get you more insight into the company or at least the interviewer.
I sometimes use questions like that very early in an interview to make sure candidates didn't fake their way through the phone screen to get to the on-site interview. People who can't do the simple stuff do sometimes slip through.
I'm not trying to insult the intelligence or skills of the candidate, I'm just trying to see if they can pass that low bar before getting to the interesting questions.