Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Doesn't a for loop contain a conditional? (If i <101)


That is in arbitrary line I am willing to draw in the battle against pedantry. Surely though a fizzbuzz isn't supposed to run forever though right? Gotta end it somehow, and the for loop is idiomatic.


It's a challenge and you can do whatever version you want.

If I'm pedantring about it it's because it can be done with a stricter restriction (or at least I think it can be done).

I'd also add that it isn't a particularly hard problem, so I would recommend that if you are having trouble with solving for the hardest interpretation of the problem, that you keep on trying because there is quite a simple solution.

If I were hiring based on this, your answer is a pass for sure. But it isn't exactly clear to me that you know about cpu comparisions or conditional jumps. In fact I think if you knew about them you wouldn't call it an arbitrary line.

I think there is a python solution as a prototype, but of course the robust solution would be in python to ensure control over the cpu instructions and avoid conditionals for good.


You got me. I'd surely fail your interview. I admit I know nothing about CPU comparisons and conditional jumps.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: