> Given the area of a circle is given by Pi times the radius squared, write a function to calculate the area of a circle.
> Amazingly, more than half the candidates couldn’t write this function in any language
I don't think this is true. Or, they were interviewing candidates fresh out of college who never really paid attention in any classes. Or, the problem was presented to the candidate in an overly complicated fashion (which is weirdly common in technical interviews) and the interviewee was confused, although that seems unlikely.
I think it's easy to get wrapped up in this mindset of "oh we need super complex algorithm whiteboarding because candidates nowadays don't know how to code!" when you hear stories like this, and it's just not true -- at least in my experience of interviewing candidates. Maybe I've just been lucky.
There is a reason why fizzbuzz is a famous interview question. There are plenty of people who can't code (to any reasonable standard) but still apply to programming jobs. They might be fresh out of college, or they might come from a job where they were doing glorified IT or making Excel spreadsheets.
"super complex algorithm whiteboarding" is obviously not the answer. You want something so simple no qualified person could fail even under stress, but hard enough that you know that the person is confident in writing if-statements. "Iterate a B-Tree in-order" filters too many people, "compute the area of a circle" is maybe a bit on the easy side.
Sigh. I tried using fizz buzz as an interview question for awhile and never got a single applicant who could solve it. Some just had no idea how to do much of anything but it turned out almost no-one had ever even heard of the modulo operator before.
The point of FizzBuzz is to see if the person understands the basic concepts of a loop and "if" tests. You're supposed to give them the modulo operator to ensure you're testing the right thing.
I don't agree. I think a module operator is common enough that it should be known, and even if they don't know it, they should be able to quickly make a module function. (Something like a while loop that decreases value a with value b while a>b and returns a)
You say you don't agree, but you don't disagree either. Perhaps you should know a modulo operator but that's still not what FizzBuzz is for. It's to see if the candidate has the most basic concepts of loops and tests.
Adding knowledge of a relatively obscure operator (can't remember the last time I needed it in real life) just makes it a trivia test.
To be fair, if the interviewer is doing it properly, either they'll give you the data structure as part of question, or they'll let you pick whichever B-tree design is convenient.
Controversial opinion of my own: not being able to solve fizzbuzz doesn't necessarily indicate lack of programming ability. The "trick" there is the modulus operator, and I can easily imagine somebody who was otherwise a good, experienced, effective developer never having come across the modulus operator.
I cannot imagine a situation where someone is a good, experienced, effective developer who has never come across the modulus operator. I just put about 6 seconds of thought into it and you could also program:
* Fizzbuzz with a loop that has a recursive call inside.
* Fizzbuzz with a loop that has two additional, resetable counters
I don't even work as a developer and managed that in less than one minute of thought. Any experienced developer who cannot program Fizzbuzz isn't good.
> Amazingly, more than half the candidates couldn’t write this function in any language
I don't think this is true. Or, they were interviewing candidates fresh out of college who never really paid attention in any classes. Or, the problem was presented to the candidate in an overly complicated fashion (which is weirdly common in technical interviews) and the interviewee was confused, although that seems unlikely.
I think it's easy to get wrapped up in this mindset of "oh we need super complex algorithm whiteboarding because candidates nowadays don't know how to code!" when you hear stories like this, and it's just not true -- at least in my experience of interviewing candidates. Maybe I've just been lucky.