Hacker News new | ask | show | jobs
by strken 4 days ago
Fizzbuzz is interesting because it relies on either the candidate remembering the modulo operator, or the interviewer allowing them to write a modulo function. I can understand why a candidate could forget how to find the remainder from an integer division.

The bigger issue is not having seen fizzbuzz before, really.

4 comments

I've always wondered how people who write code could possibly be unaware of the modulo operator. In the 8-bit and 16-bit CPU era, or even just when working with data types of that width, one has to be aware of wraparound / overflow if the value gets too large and that's what modulo is. Is it just developers who came of age in the 64-bit CPU era that have this gap?
>I've always wondered how people who write code could possibly be unaware of the modulo operator.

Worked for 25+ years in regular business software - banking , insurance etc. I never recollect using the modulo operator.

When one's primary handling of numbers comes down to either linear (single-dimensional) lists or money, then you won't use modulo very much.

But any time you're walking over a discrete multidimensional list packed into a linear list, or walking over any discrete periodic signal (one very common example would be walking a linear array of screen pixels, walking over pcm samples in an audio waveform, literally 100% of GPU programming and 90+% of SIMD programming) you will want to be able to translate between "how far from the start am I" and "how far into the current cycle am I", and modulo handles that.

Similarly for almost anything involving time calculations (and for the same reason: because they are periodic). Modulo is literally described as "clock arithmetic" after all.

Here you can find Tempestt Bledsoe singing about it, lol https://youtu.be/fqtzqcJ6agE?t=570s

So you are absolutely correct that there do exist avenues in programming which can dodge this particular raindrop, I hope you aren't opposed to the idea that they are at least few and far between? ;)

>I hope you aren't opposed to the idea that they are at least few and far between? ;)

Absolutely not. Part of the reason why I mentioned the areas that I work in, are for that reason. I suspect that the vast majority of software jobs are of the kind I mentioned.

As the HN user 'strken' correctly pointed out, fizzbuzz can stump an experienced job candidate if he has never used the modulo operator.

Fizzbuzz is not the least bit interesting on a technical level. It's interesting because even though it's trivial to "cheat" (you can just learn/memorize Fizzbuzz specifically), it still works because people so incompetent they can't even write something as trivial as Fizzbuzz are unlikely to have heard of it.

Fizzbuzz is used to confirm an already present suspicion of complete incompetence, not to assess skill (ability to pass is not a meaningful signal).

I said "interesting" but I really meant "bad". You might as well test someone on whether they remember bitwise operators.

I feel that you did not address the specifics of what I wrote. It's a silly test because it's meant to cover the bare basics but it still relies on knowing/remembering the modulo operator, which junior hires might reasonably not have seen. If everyone didn't already know about fizzbuzz it would be even more stupid.

I’ve personally experienced devs who could not sum a collection of ints, “in any language of your choice”.

I’m not talking about devs who got hung up on integer overflow issues (or even off-by-one errors), but rather “just couldn’t get started at all”. I have no idea what they did before or what they expected to do if they got the job, but I doubt it would turn out well.

Yep, I've seen that too. I start with "sum an array of ints" due to the known problems using fizzbuzz, and there are software engineer candidates who can't or won't do it. Nobody believes you until they see a candidate like this themselves.

My pet theory: A lot of companies are very, VERY big, and a clever person who doesn't know how to do their job but can identify a weak manager, can simply get lost in them. Hiding away getting the paycheck, but doing nothing except convincing their manager they're doing things. I've definitely met a few people in my career that I believe were doing exactly that.

Yeah, I've seen that too, even in pre-LLM times.

I don't have a good explanation for how candidates with zero ability to write code can make it through a hiring funnel to sit in front of you. Maybe they don't know what they don't know.

No, fizzbuzz trips people who already have a job because they make two for loops, make too few IFs, or generally don’t have a logic mindset and get out of the interview saying “This is not something that’s asked for in the job!”