So, this is pretty geeky, but I found it amusing.Â My friend read this article which states that most computer programming candidates cannot actually program.Â So, as is obviously neccesary when a blog article slaps you with a virtual glove, we each worked out our own little solution to the problem that was presented as an example of what candidates could typically not do:
Write a program that prints the numbers from 1 to 100. But for multiples of three print â€œFizzâ€ instead of the number and for the multiples of five print â€œBuzzâ€. For numbers which are multiples of both three and five print â€œFizzBuzzâ€.
Most good programmers should be able to write out on paper a program which does this in a under a couple of minutes. Want to know something scary? The majority of comp sci graduates can't. I've also seen self-proclaimed senior programmers take more than 10-15 minutes to write a solution.So, this went back and forth a few times between us, escalating.Â This morning, I emailed him this:
Turns out it actually runs faster than a one-liner in several situations because it only prints to STDOUT once rather than for every number.
Ahh, what are pointless fixations if not fun?