Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> To play devil's advocate: difficult coding questions are a way to minimize false positives

Apparently, Fizz-Buzz is still a "difficult" coding question, considering the number of candidates that still squirm at the prospect of answering it.



Fizz-buzz is a difficult problem. There are a few different ways to solve the problem and every single one has some uglyness about it that should make a qualified programmer squirm and hate their answer. It is simple enough that any qualified programmer can discover one of the possible solutions on their own and get it working in less than an hour, but then they will likely go back and research because it seems like there should be a better solution (there isn't, there are different ones with different pros and cons)


> Fizz-buzz is a difficult problem. There are a few different ways to solve the problem and every single one has some uglyness about it that should make a qualified programmer squirm and hate their answer

What are you talking about? The question is basically just a gotcha to catch out folks that don't know about the modulo operator. Or is this satire and I completely missed the joke?


Implementations details of fizzbuzz are ugly. There are a couple different ways to implement it (not all use the modulo operator!), but not matter how you implement it there is a special case that doesn't elegantly fit your algorithm and in turn your code is ugly in ways it seems like a better design could fix.

That you cannot find a an elegant solution to what seems like it should have one is what makes it difficult. A good sign of a good programmer is then you ask them about their code after it works they will say they don't like this solution and would like to spend time making it cleaner. If you know there isn't an elegant solution of course you won't bother spending that time, but if you don't know that if seems like there should be a better answer if you can just restructure the code a little.


mod by five, mod by 3, a printf in each of the four branches. Trivial, no?


Yeah it’s just to filter out those who are hopeless, which is far too many.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: