Fizz Buzz Interview Question

Jacky Lin
2 min readJul 3, 2020

My favorite interview question

I was working on a Udemy course (Interview-bootcamp-algorithms-and-data-structure) and came across this problem. The goal of this problem is to print the number from 1 to N, however for every multiplies of three it should print “Fizz” and every multiplies of five, it should print “Buzz”. For every numbers which are multiplies of both three and five should print “FizzBuzz”.

For someone who just graduated from Flatiron Bootcamp, I thought this would be an easy question however it got me running circles around my brain.

The first step to solving this problem is understanding what the question is asking for. The second is looping through the number from 1 to N, and the easiest to do that is using the for loop.

Perfection! If you ran this code in your console, this is what you should get:

There are hundreds of ways to approach this problem, hundreds of way to do this problem with cleaner code. But in my opinion this is the easiest and fastest way.

--

--