⬆️ ⬇️

FizzBuzz, or why programmers do not know how to program

[The author of this article is Jeff Atwood, one of the founders of stackoverflow.com . The very same article, despite the rather decent age (it was written in 2007) is still popular, and the term “FizzBuzz question” introduced in it has become commonly used. The original can be found here .]



I was very skeptical of Reginald Braithwaite’s following observation :



“I am a little saddened by the fact that 199 out of 200 applicants for programmer jobs do not know how to program. I repeat: they do not know how to write code . At all."


Reginald refers to the article of the person responsible for receiving new employees, who have to filter out many programmers who cannot write code:

')

“Having conducted enough interviews, I realized that while writing code, inexperienced people stumble not at all on complex and non-obvious tasks, or even on small tasks (for example, implement a coherent list). Most of the problems they cause quite trivial tasks.



I decided to develop a set of questions that would allow me to quickly identify such "non-programmers." For this kind of questions , I gave the name FizzBuzz questions , in honor of the game played by British schoolchildren. A typical FizzBuzz question looks like this:



Write a program that displays numbers from 1 to 100. In this case, instead of numbers that are multiples of three, the program should display the word “Fizz”, and instead of numbers that are multiples of five, the word “Buzz”. If the number is a multiple of 3 and 5, then the program should display the word "FizzBuzz"



A normal programmer should write such a program on a piece of paper in a couple of minutes. But what is interesting is that many people with specialized education cannot cope with this task at all. There were even cases when candidates who submitted resumes for a senior developer job were spending more than 15 minutes on this program. ”


Dan Kegel (Dan Kegel) talks about similar impressions when hiring novice programmers:



“Unexpectedly, many applicants (including those with master's degrees and PhD in computer science!) Find it difficult to answer simple questions. I myself saw how people at interviews cannot write a cycle that iterates from 1 to 10 or do not know what number in the hexadecimal system comes after F. As for less obvious examples, quite a few candidates do not know how to apply recursion to decide which or practical task. You must agree that all these are absolutely basic things, and if a person finds it difficult to answer such questions, then he simply has no programming experience.



I will take the liberty of speaking on behalf of all programmers who have to conduct interviews: we are terribly tired of communicating with people who, in programming, have nothing to do with their feet. Believe me, if you can write a cycle from 1 to 10 in all the languages ​​specified in your resume, if you can solve a simple arithmetic example in your mind and if you know how to apply recursion in a simple (but taken from real life) task, then you already head and shoulders above most of the people in our industry. ”


After reading these three articles, I was seriously worried. I really want to recruit freshly baked IT-specialists - those who have just received education, but have not yet had work experience. In fact, guys should somehow start their careers, why don't I help them with this? But the fact that a person who cannot write even the simplest programs simply has the audacity to call himself a programmer simply infuriates me. I consider this an insult to those who bear this title by right.



It is known that between the states “I learn to program” and “I know how to program” there is a huge gap . I thought that everyone who had submitted a resume for a programmer’s job at least once had this gap already behind. But practice shows that this is not the case. Moreover, I come to the conclusion that the preliminary screening of candidates with questions like FizzBuzz is simply necessary , otherwise we will be ineptly wasting a lot of time on interviews with programmers who are not.



For those of you who consider the task of FizzBuzz too simple (it is, incidentally, intentionally trivial), I will give a comment from the post about the interviews to which we referred at the beginning of the article:



“I would not advise interviewing people to dismiss the FizzBuzz task as too primitive. Rely on it, and you (as I did) will be unpleasantly surprised to see how many applicants do not even have basic programming skills. ”


I think it is foolish to interview an individual without first looking at his code. The interview process in our company requires the candidate to provide us with a fragment of his code even before the telephone interview. And if it comes to a personal interview, then we will definitely give the candidate a small programming task that he must solve with us. Nothing too complicated, just a little exercise for an hour and a half, allowing you to follow all the steps of creating a working application. I must tell you that this strategy works great. Thanks to her, we are talking about programming in interviews, and we don’t bother with hundreds of clever tasks .



The brief result is this: pre-screening is only necessary in order to allow yourself the luxury of interviewing programmers who really know how to program. No matter how sad this fact may be, it remains a fact.



UPDATE:

The best FizzBuzz implementations in the comments:

Source: https://habr.com/ru/post/298134/



All Articles