On the page you linked to about the FizzBuzz test, there's a comment to the effect that Real Developers, upon learning about the FizzBuzz test, *immediately* go off and see what they can whip up quickly. Which cracked me up, because that's exactly what I did. 😂
An obvious works-in-any-language solution took about a minute, but I took another minute to make a particularly Python-ish version:
threes = ["Fizz" if n%3 == 0 else "" for n in range(1,101)]
fives = ["Buzz" if n%5 == 0 else "" for n in range(1,101)]
for n,x3,x5 in zip(range(1,101), threes, fives): print(f'{n:3d}: {x3}{x5}')
print()
That comment also mentions that Real Developers can't resist posting their solutions… 🙄
There is always the option of conducting an in-person test with the candidate.
I failed my last one :)
> you might get hundreds of people reaching out, and you don't have the material resources to personally interview them all in person
And you think that you will have the material resources to review the source code for all of them in this case? 😅
But in my case, it was online for a large corporation. So yeah they have the resources.
But there is no silver bullet here I think.
"Trusted strings", "t[str]", introducing fictional "stuff"(even "quoting" PEP) ... horrible.
My chat: https://chatgpt.com/share/68923e7e-7630-800c-9f45-7f55a53db5ac
On the page you linked to about the FizzBuzz test, there's a comment to the effect that Real Developers, upon learning about the FizzBuzz test, *immediately* go off and see what they can whip up quickly. Which cracked me up, because that's exactly what I did. 😂
An obvious works-in-any-language solution took about a minute, but I took another minute to make a particularly Python-ish version:
threes = ["Fizz" if n%3 == 0 else "" for n in range(1,101)]
fives = ["Buzz" if n%5 == 0 else "" for n in range(1,101)]
for n,x3,x5 in zip(range(1,101), threes, fives): print(f'{n:3d}: {x3}{x5}')
print()
That comment also mentions that Real Developers can't resist posting their solutions… 🙄
This is a fantastic idea. It's simple, obvious in retrospect, but not something I've seen mentioned before.