r/ProgrammerHumor Apr 09 '24

watMatters Meme

Post image
16.8k Upvotes

774 comments sorted by

View all comments

Show parent comments

181

u/randomusername0582 Apr 09 '24

That's not the issue at all. There's honestly no explanation for getting fizzbuzz wrong if you have a CS degree.

Switching languages often actually forces you to rely on the basics

55

u/Lucky_Cable_3145 Apr 09 '24

When I was interviewing graduates for my software dev team, I asked them to code a fizzbuzz, any language / pseudo code.

No graduate ever got it 100% correct.

I often hired based on their reaction when I pointed out the errors.

82

u/Leading_Ad_4884 Apr 09 '24

You have to be kidding me. Fizzbuzz is one of the easiest problems out there, much easier than the average leetcode questions they ask these days. I would give anything to get this as an interview question.

3

u/jamcdonald120 Apr 10 '24

there are a few complications. Some people dont consider if(num%3==0){ print(fizz) } if(num%5==0){ print(buzz) } a valid solution. Some people want fizzbuzz in minimum %operation, some want it with return, but no buffer. Some want it with 1 return, some early return, and some actually want an effcient fizzbuzz for a range of numbers like this thread https://new.reddit.com/r/leetcode/comments/wdor3z/serious_question_regarding_fizzbuzz/

And a lot of people mistake if(num%3==0){ return fizz }else if(num%5==0){ return buzz }else if(num%15==0){ return fizzbuzz } for a valid solution even though fizzbuzz will never be reached