(09-28-2018, 12:56 PM)Evan Wrote: I dont think what they were asking was out of line for a devops engineer.
Fizzbuzz and algorithms are out of place for devops, but sounds like you did better than most anyway
EDIT: just saw the article is from 2007. Figures. These college kids are a lot smarter these days. I know because I do Job Fit Interviews for them.
Just wrote the FizzBuzz program out in my IntelliJ in 5 minutes.... I have a degree in CIS (not CS) and only two years experience in a basic software engineer role. People really can't do that? Wow....
Inefficient but base code with old school Java for loop
void class Fizzbuzz () {
int[] list = {1, ...100};
for (int i = 0; int i < list.length; i++){
if (list[i] % 3 = 0) {
System.out.println("Fizz");
}
else if (list[i] % 5 = 0) {
System.out.println("Buzz");
}
else if (list[i] % 3 = 0 && list[i] % 5 = 0){
System.out.println("FizzBuzz");
}
else {
System.out.println(list[i].toString());
}
}
}
Java 8+ loop:
void class Fizzbuzz () {
int[] list = {1, ...100};
for (Int i : list){
if (i % 3 = 0) {
System.out.println("Fizz");
}
else if (i % 5 = 0) {
System.out.println("Buzz");
}
else if (i % 3 = 0 && i % 5 = 0){
System.out.println("FizzBuzz");
}
else {
System.out.println(list[i].toString());
}
}
}
