Better Programming

Advice for programmers.

Follow publication

You're unable to read via this Friend Link since it's expired. Learn more

Member-only story

I Asked the FizzBuzz JavaScript Interview Question and the Results Were Surprising

Bikash Paneru
Better Programming
Published in
4 min readFeb 16, 2021
Woman covering her eyes and looking surprised
Photo by Brooke Cagle on Unsplash

Write a short program that prints each number from 1 to 100 on a new line.
For each multiple of 3, print "Fizz" instead of the number.
For each multiple of 5, print "Buzz" instead of the number.
For numbers which are multiples of both 3 and 5, print "FizzBuzz" instead of the number.

The above text is what we call the FizzBuzz problem in the world of programming interviews. This ‘simple’ question has been around for a long time.

It seems pretty easy, right? I thought so too! I had seen FizzBuzz around but had never actually given much thought about asking it in any interviews. So, this interview season, me and my interview buddy decided to ask FizzBuzz to senior and mid-level developers to see if they would be able to answer.

The framing of the question was simple. The interviewees were asked to share their screen and use any IDE of their choice. There was also no restriction on the programming language they could use — they were even allowed to write pseudocode. However, we did not encourage them to actually run the code that they wrote because we wanted to see if they could follow and debug the flow of their own solution while taking as much time as they needed. Yes, there was no time limit.

Most of the interviewees took the time to properly read the question and seemed to understand what the question was. A few of them thought that the different lines were different questions. However, we immediately nudged them in the right direction. One of the interviewees even went so far as to say, “Are you guys serious? This is the kind of question they ask in high school.”

Most of the interviewees started out well, with a good old for loop from one to 100. One of them even started by creating an array of numbers from one to 100 in pseudo-code style, [1…100]. A few interviewees got stuck after the for loop and just gave up.

What I have realized is that the for loop is not the difficult part of the problem. Most interviewees messed up the body, which looked something like this:

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Bikash Paneru
Bikash Paneru

Written by Bikash Paneru

Technology for Passion, Noodles for Hair and Junk for Food. https://mrdivinemaniac.github.io/

Responses (8)

Write a response