All of you know the trivial fizzbuzz question during the first junior interviews. In my case, it was more than write a solution. There were more requirements: Only two ifelse statements. StringBuilder required. No Map, Collection. No ternary operator. Only Java core (8 or 11). You have only 5 minutes (in my case, but for you it doesn’t matter). My
Tag: fizzbuzz
Variable inside array not updating its value in Java
I was taking a shot at the FizzBuzz problem and decided to use an array to store the first 15 results in array and then iterate through it. But the variable stored in array is not updating its value if updated later in the loop The variable I does not change its value in the for-loop. It just prints empty
Java FizzBuzz 1 Line
How can one complete the FizzBuzz exercise in Codingbat with just a return statement? The code that I last used to solve the problem was: My goal is to have code that looks something like this: Problem This is slightly more difficult version of the famous FizzBuzz problem which is sometimes given as a first problem for job interviews. (See