3 ms·
I would not want developer to write this kind of code in production applications but I would very much hire a person who is capable of coming up with the code l
by FpUser 4y ago
I would not want developer to write this kind of code in production applications but I would very much hire a person who is capable of coming up with the code like this.
- dotancohen 4y agoThis whole point of Fizzbuzz is to see how one structures their code. Or at least ascertain that one _can_ write code in the first place.
- tpxl 4y agoHow much structure can a fizzbuzz have exactly?
- galoisgirl 4y agoYou can make it easily extendable for division by 7.
- arethuza 4y agoHow much structure would you like? https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
- trashtester 4y agoshudder Sometimes I wonder why some dev teams take 10x longer to develop some functionality than what I would consider reasonable. Then I see code like this.
- dotancohen 4y ago> How much structure would you like? top = 100 data = { 3: "fizz", 5: "buzz" } for i in range(1, top+1): output_num = True for j in data: if i%j == 0: print(data[j], end="") output_num = False if output_num: print(i) else: print("") This is enough structure to anticipate the inevitable customer changing the requirements. No magic numbers in the real code. Of course, I just banged this out in a web browser text editor. In PyCharm that better be wrapped in a function at minimum, or a module.
- FpUser 4y agoI could not care less about the purpose of FizzBuzz. In my other life I've interviewed many programmers and I did not get disappointed. But I would never ask them to do live coding in a first place.
- warrenm 4y ago..except they probably wouldn't come up with janky code like this - especially not during the interview This is something you memorize to try to show off
- FpUser 4y ago>"person who is capable of" - is not equal to actually doing it on an interview unless it was their own original code