Academia.edu interview question

Variation of FizzBuzz, with added complexity