Skip to content
Advertisement

Tag: fizzbuzz

FizzBuzz using limited number of conditions and StringBuilder

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

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

Advertisement