It's interesting that you can't imagine code that explicitly prints fizzbuzz with a third conditional. It's as simple as this:
for i in fizzbuzz range
fizz = i % 3 == 0
buzz = i % 5 == 0
if fizz and buzz print fizzbuzz
else if fizz print fizz
else if buzz pritn buzz
else print i
If you want to see how they react to changing requirements, then ask them to change it. It's stupid to look at someone's answer to a toy problem and treat it like it's production code.
> It's stupid to look at someone's answer to a toy problem and treat it like it's production code.
There are no toy problems in interviews. The way you approach a toy problem says everything about how you would write production code according to the 'how to hire programmers' manual v 3.3.
Obviously that's not how it should be but if you're going to places where they think 'fizzbuzz' is going to weed out the ones they don't want then you'd better be showing off your capabilities.
for i in fizzbuzz range fizz = i % 3 == 0 buzz = i % 5 == 0 if fizz and buzz print fizzbuzz else if fizz print fizz else if buzz pritn buzz else print i
If you want to see how they react to changing requirements, then ask them to change it. It's stupid to look at someone's answer to a toy problem and treat it like it's production code.