Is there really a pandemic of incompetent devs?
The worlds most popular coding challenge could be misleading
I think I’m going to dump “The week in tech” concept, it didn’t seem to be that popular, and I’m way too lazy to keep my eyes open for interesting tech goings on every week.
So to the clickbait title: “Is there really a pandemic of incompetent devs”, If you want the TL;DR version, then no. No there almost certainly isn’t a pandemic of incompetent devs. For the longer, and I’d like to think, more interesting version, read on.
This idea of mass incompetence amongst developers goes all the way back to when I was a mid level dev, struggling to become a senior. Blogging was only just starting to become popular (hard to imagine blogging wasn’t even really a thing less than two decades ago!), and of course like today’s top tweeters and most liked youtube personalities, the early tech bloggers discovered that controversial posts boosted page views. One of these controversial topics they liked to post about is how devs can’t dev very well.
One of the most famous of these was written by Jeff Atwood, who would go on to co found stack overflow. It stated boldly:
199 out of 200 applicants for every programming job can't write code at all. I repeat: they can't write any code whatsoever.
Having interviewed many developers, from every level from junior to lead, I can say with confidence that this stat simply doesn’t ring true.
The article mentions a programming interview question, which has since become infamous. So infamous in fact, that it’s fame probably stops it getting asked that often in interviews. The question is: FizzBuzz.
The challenge is as follows:
Write a function, FizzBuzz that takes an integer argument, i. Loop through ints from 1 to i. For each, print the following on it’s own line:
The number is a multiple of 3: print Fizz
The number is a multiple of 5: print Buzz
The number is both a multiple of 3 and 5: print FizzBuzz
None of the above are true: print the number
An output for i = 5 is as follows:
1
2
Fizz
4
Buzz
This seems like a very simple task. Well, it is a very simple task. So why are so many devs supposedly failing? Are we all incompetent as an industry!?
I think there are 3 things that explain this, but before I go into them, let’s look at my implementation of FizzBuzz so we have some reference. I’m sure some people will point out it isn’t the most elegant solution possible, but as you will see that is kind of the point…
We loop through the numbers 1 .. n.
If i is a multiple of 3, output fizz.
if i in a multiple of 5, output buzz.
If i is neither a multiple of 3 or 5, output i.
Output the newline character.
I get what you’re thinking. This solution seems a little clunky. I do each check for a multiple twice. Since you never print both a number and a string surely an else should be used somewhere?
I’d 100% stick with this solution. There are 3 reasons I think this “no one can actually code” myth started. Choosing a “clunky” solution addresses the first two of these points.
The first reason I think this causes an issue is because fizzbuzz is so easy to write to make to work, but so much harder to write in a graceful manner. Devs in interviews are aware that people will look at, and judge, their code very carefully. This makes them want to write a very pretty version of fizzbuzz.
Note this violates the first law of coding interview tests: make it work first, aka brains before beauty.
People can tell the problem is easy, and so panic when struggling to quickly write out a pretty solution. This leads to them looking like they can’t code.
The second point relates to the first. Back when this problem was first posted many interviewers still insisted coding exercises were done on a whiteboard or via pen and paper (lolololol). When you try and make something fairly simple but niggly like fizzbuzz look pretty in handwritten form, you’re going to make lots of mistakes. When coding on paper there is the urge to “code your way” out of a bug so you don’t have to cross stuff out as that looks nasty. All in all I think many people messed it up purely because they tried to make it nice on paper and got themselves in a pickle.
The final thing I think is going on here is as old as the internet: lying for clicks.
I outright call bullshit on 199 out of 200 applicants for coding jobs failing this. Unless of course they are just posting ads saying “Programmer wanted, earn $100k, no previous experience required” - in which case this is all their fault - then I don’t think almost every person is failing this test. I think they have massively over exaggerated for clicks.
There is a technique that works really well for winning over readers: you make them feel smarter than everyone else. What better way than pander to a readership of developers than to present them with a fairly simple coding exercise which they can do, then tell them 99.5% of devs fail to do it. Waheeey! They are suddenly in the top 0.5% of devs, and so clearly have a bright future. I just know that since you’re smart enough to have subscribed to my substack, you wouldn’t fall for something like this. 😉
Takeway: Always solve tech interview questions in the dumbest way possible which works, you can always refine your solution, but only once you have something working.
Yours in code,
WPG