Scala-bee-lity 🐝

Fizz Buzz is one of the first technical interview practice questions I’ve encountered.

The problem entails outputing an array of string representations of numbers from 1 to n. If the number is a multiple of three the string representation should be ‘Fizz’, if a multiple of five it should be represented as ‘Buzz’, and if a multiple of both represent it as ‘FizzBuzz’.

n = 15,

Return:
[
"1",
"2",
"Fizz",
"4",
"Buzz",
"Fizz",
"7",
"8",
"Fizz",
"Buzz",
"11",
"Fizz",
"13",
"14",
"FizzBuzz"
]

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jack

Jack

15 Followers

Magician, Mathematician, and Software Engineer