Comment by cellularmitosis
11 years ago
I've never inverted a binary tree (I'm not familiar with the concept). You claim that makes me a bad programmer. Be careful there: just because somebody hasn't been exposed to something doesn't mean they aren't smart enough to figure it out. Fizz buzz is also flawed in this way: it doesn't test if you know how to program, it merely tests "have you been exposed to the modulo operator yet".
FizzBuzz is not about the modulo operator. You can write it pretty easily without it, in several different ways. If you can't figure out how pretty quickly, you're not a good programmer. Sorry.
It is even kind of reasonable to just substitute a call to some black-box is_divisible_by() if you can't figure out how to do that test ...
No one is claiming that makes you a bad programmer. However, if you got this as a problem to solve and your response is "I don't know" and you stop there, then you are a bad programmer. As I've commented elsewhere, the interviewers want you to ask clarifying questions. Those are often just as important as the code itself. Once you've nailed down the definition of inverting a binary tree (maybe it's just switching left and right node pointers), coding will be trivial. It's much like getting sufficient detail on a feature request before starting to work on the feature.