Up until that point it had never occurred to me that someone might apply for a programming job who could not write the simplest programs. Thus it would never have occurred to me that someone asking me such a simple question just wanted to see the obvious simple answer.
I'd have assumed they wanted me to use as much of the language as I could. So if they asked me to do it in Python, for example, I'd have tried for something like this:
def fizzbuzz(n, *args):
cur = ['' for x in range(1,n+1)]
for m, postfix in args:
cur = [y+postfix if x%m==0 else y for x, y in zip(range(1,n+1), cur)]
cur = [str(x) if y == '' else y for x, y in zip(range(1,n+1), cur)]
return cur
print("\n".join(fizzbuzz(100, (3, 'fizz'), (5, 'buzz'))))
...and since Python is not one of my main languages there is a good chance I'd botch it.Most good developers are already employed, so there's this constant pool of unemployed programmers (the 1% who can't do fizzbuzz) applying for all the jobs they can.
I'd question the heck out of it looking for tricks. Then I'd probably think "no they want something complicated. It can't be that"
I'd probably totally fail it. I've been writing code every day for over 25 years but if you asked me that in an interview, I'd totally completely utterly fuck it up.
I'd walk out and the interviewer would think me profoundly incompetent. Then I'd go home and have a terrible day thinking "wtf was that? All he wanted was that. You could write that when you were 7 on an apple 2, wtf were you doing?"
So now I'm just enjoying my time contributing to open source. Whatever.
It's a great time to not work, unemployment is lucrative.
Likewise I got asked about python with 2 list comprehensions. Then I got asked to do the same thing without an intermediate variable. Basically they wanted a nested list comprehension. This was not a difficult task, but not something that I ever do, as I find nested list comprehensions terrible for readability - I always use an intermediate variable. It would be easy to mess this up under the stress of an interview.
Those things frustrate me in interviews, I can think of 4 ways to immediately do it but I know for a fact they only have 1 way written down and it's my job to guess it. If I say "you can make a field" and they have zero knowledge of number theory well my chances go right out the window.
To them I obviously have a "wrong" answer. They ask you to be clever but only in some proscribed secret way that they have no intention of disclosing. Nonsense.
If instead I respectfully show them the multiple ways, it's still naturally "combative" because there's no other way to reliably answer the question.
They're just asking for experience to fail. They're looking for something who coached themselves, not someone who actually knows anything.
No wonder silicon valley is awash in cargo cult driven shit software. Look at the process.
Yet again an interview process that selects for dimwits.
Might as well guess what number they're thinking of
You could do the exact same thing, but with sanity. When you ask what they do without the modulo operator, you're looking to see if they just have a cookbook method memorized, or if they can handle having to adapt it. You don't have a "right" answer - if their answer works, it works. If it's kludgy, that might be a bit of a mark against them, but less so if they know that what they did is kludgy. And so on.
It's not all like what you describe. There are people who can actually interview.
If someone tossed me a 6502 assembly book (in case the candidate didn't know it) and a simulator and told me to implement fizzbuzz in that and create some test script, now we're talking. You never work with 6502? Even better! That's every new job: a bunch of new stuff.
We leave the amorphous world where there's giant stratas of assessments and opinions and have a concrete problem
Two of the four couldn't finish fizzbuzz (in the language of their choice) in 30 minutes. It feels a bit unethical to name their employers, but they were companies that would be familiar anyone who reads HN.
When I worked for FAANG, IIRC, the ratio was about the same, so I don't think it's a problem of recruiting.
Re typing: You can usually hear it unless the mic is muted (part of the reason I try to keep the conversation going).
These are people who likely happened to be "lucky" and rose through to management/team lead positions before they had time to truly learn the details of programming, and then they spent years dealing at higher levels of abstraction and their foundational knowledge atrophied.
The number of expert beginners[1] in our field might surprise you.
[1]: https://daedtech.com/how-developers-stop-learning-rise-of-th...
I believe knowing the fundamentals is critical for being able to reason well about the higher levels of abstraction. As Alan Perlis put it back in 1968:
> In a situation where code actually has to be produced, nobody should be allowed in the system who doesn’t write some given number of lines of code per month. I think that one of the major problems with the very large programming projects has been the lack of competence in programming which one observes as soon as one goes above the very bottom level.
He goes on to propose a scheme were people at all levels in the development effort get some time to get their hands dirty on a rotating schedule. That sounds very sensible, in my opinion.
Why write fizzbuzz yourself when you can just import it? https://www.npmjs.com/package/fizzbuzzify
My old job was a bit like that, I spent most of my time just creating new models and building API endpoints, or finding gems/packages/AWS services that did what we wanted to do (it did make for a nice looking resume though, with a laundry list of AWS skills). In the two years I worked there, there were only a handful of times I had to write any code that was more complex than fizzbuzz. It was an interesting product, but you could've taught a smart 17 year old kid how to do everything I did.
I'm happy that these days I'm working at a much more mentally stimulating job. I regularly have to use what I learned from my compsci degree (especially operating systems and networking), and solve complex problems that require me to actually think. It's the kind of work that validates why I went to university.
Codility and Leetcode... screen that folks can code, but the folks who tend to be good at a quick grind don't always produce good code. Not a huge fan of it. I don't even look at the report anymore.