Why Can't Programmers.. Program?

Notice from @riking:

Please put all solutions to FizzBuzz –here– instead of in this topic. Alternately, don’t do it at all - we’ve clearly had enough proof that it’s possible.

(Existing comments from before Discourse containing only solutions were moved there.)

*The original post by @Toepopper follows. *


Very very common, alas. I once interviewed a candidate for a VBA job (yes, you can stop booing for the peanut gallery) whom I asked to swap two variable contents without using a temp variable. It’s the standard a=a+b, b=a-b, a=a-b problem. His answer? Well, I can’t do it in VBA, but if you let me use Excel I can put the values in two cells and swap the cells’ contents using a third cell.

We hired the guy who said, well, “if they’re integers, then I’d do it by a=a|b, b=a^b, a=a^b. But I don’t know how to do it if they’re strings.”