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

One comment mentioned "Fizz-Buzz" which I hadn't heard of. Interesting tidbit. http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-dev...


That confused me. Am I overlooking something that makes the problem non-trivial?

On further reading I'm pretty sure I'm not, but perhaps the very triviality of the problem confuses people enough that they have difficulty with it. ("Is there some weird edge case I'm not considering?")

The other big question with FizzBuzz is whether it's worth making your code more complicated in order to make it slightly shorter. That is, do you start off with a "if i % 15 == 0" or not? My inclination is yes, because I'd rather have ten lines that obviously work than eight lines that might not.


I interviewed someone, and following a hunch, asked him to write FizzBuzz, and he couldn't do it within a half hour. He wasn't overthinking it; he just couldn't decompose the problem.




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

Search: