Skip to main content

FizzBuzz Problem

Hello guys, today I'm discussing about a well-known interview question, asked for logic measurement of a backend developer in many IT company.
fun fact: This is discussed in Stackoverflow's Annual Survey 2019.


Fizz Buzz Problem 

Problem statement: 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”

PS: I'm using javascript to solve this problem

Solution:

This is really simple, but tricky question if you don't pay attention.
Happy Codding.

Comments

Popular posts from this blog

Live Game Streaming on YouTube

Hello Guys, Today I gonna talk about how to stream your mobile gameplay to YouTube Gaming. Nowadays, PUBG (PlayerUnknown's BattleGround) is the most trending mobile game. Many Pro players upload/stream their gameplay to YouTube and earn money through monetization. Ok. Let's start. First of all Download YouTube Gaming App. After download, open the app and create/choose your google account for your YouTube channel. If you're a new user then you have to wait for 24 hours until you stream your gameplay (YouTube need to activate your account). Now Just click on the first icon(streaming icon) on the top left corner and this screen will appear: Click Next and select Stream if you want to live stream your gameplay or Record if you want to save the video to your phone and upload it later. Select the video format you want to upload/stream. Click next, you'll see a tips screen, read it and click next. Now, Select the game you want to stream or record. Add the st

Dynamic Form and Grid with C# in WPF

Ever wanted to generate the form & grid dynamically and add data from some data source? Here's to help you. Create a WPF project in Visual Studio. Add a UserControl and name it mainUserControl.xaml Now add a stackpanel just like this : <UserControl x:Class="TestApp.mainUserControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:SaiData.TestApp" mc:Ignorable="d" > <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="5*"/> <ColumnDefinition Width="43*"/> </Grid.ColumnDefinitions>

Automate Build & Deploy React production build with gitlab-ci to Linux base server (AWS)

Right now as everyone wanting to automate literaly everything, this post will show you how you can automate the react build and deployment. I am using create-react-app getting started with react and assuming you have a similar setup. Setup .gitlab-yml file for gitlab auto deploy Here's the whole .gitlab-yml file that you can copy directly to root of your project. Breaking each line: image: node : 10 cache:   paths: - node_modules / This line define the node version that should be used by the docker instance of shared gitlab-runner and the path defines to cache the node_modules dir. before_script: - apt - get update - qq & & apt install - y openssh - client openssh - server - mkdir - p ~ / . ssh - echo - e " $SSH_PRIVATE_KEY " > ~ / deploy . pem - chmod 400 ~ / deploy . pem - '[[ -f /.dockerenv