69 points · by andrelaszlo · 7y ago · 174 comments
> The famous fizzbuzz test simply asks "are you aware of the modulo operator?"
Nope. The famous fizzbuzz test simply asks "can you actually write code at all?", because it turns out that some people applying for software development jobs basically can't. Even people with relevant-looking experience on their CV/resume. Even people who talk convincingly about what they've done.
(If you don't know about your preferred language's modulo operator but can do truncating integer division, you can do FizzBuzz that way instead. If you don't know how to do division, you can do it by having counters that count up mod 3 and mod 5, or one counter that counts up mod 15, and you don't need "mod" in your vocabulary to do any of that.)
Now, whether a candidate can write code -- like whether they know their language's modulo operator -- is also just one bit of information, but it's a really important bit of information that turns out to be tricky to get. This is also one reason for the "code on a whiteboard" tasks that many interviews use, which the author also doesn't like.
It may be that those are bad ways to get that one bit of information. But the author doesn't seem to appreciate what problem those things he criticizes are trying to solve.
1. Interviewing interns or new engineers while telegraphing the fact that your interviewers are absolutely uncreative.
2. Showing mid-senior interviewees that are a good fit that there is either a glaring hole in the recruitment team’s ability to filter out unfit candidates or that the interviewer thinks everyone is a dumbass but themselves.
Worse it would push for people that _excel_ at writing trivial interview code, which in my experience is inversely proportional to how much they are going to contribute to the success of the company. Though this is admittedly anecdotal.
Worse still you're going to be sending a signal to the interviewee that you are a kind of company that values trivial code. It's an interview both ways, the company gets evaluated too. The better the dev, the more offers they have so they might just not pick you based on stuff like this. They'll just get a _gut feeling_ that it's not a place they're going to like - that kind of thing.
As an interviewer, I personally don't think it's worth that bit of information, both in a game theory best outcome sense and just as a basic human decency.
No one is looking for people who can write fizzbuzz the fastest, or optimal in any way. They are looking for you to clear a low bar filter.
And this skill gets pushed down, forgotten.
It’s perfectly possible to write excellent battle tested and performant production code for years without encountering any of the stuff you see in the interviews.
And then they go to an interview and someone demands they wiggle out that piece of info from their long _long_ memory, in an unfamiliar env / os / periphery. With a huge time pressure...
Some people are good at that sort of thing, some people are good developers. Doesn’t mean they’re the same people.
The first time I was given this problem on an interview it took me two attempts to get it right. That is, I wrote the code, ran it and it failed to do multiples of 15 properly
I went back and fixed it.
Would you count that as a failure?
I am curious as to how they would do with fizzbuzz.
There's going to be stuff that isn't done the way you want, in the company policies, in the code base, in the architecture, in the way the team works. If you're going to respond in an I'm-above-this, salt-the-earth kind of way when that happens, then no, I don't want to hire you. Go destroy some other workplace.
As I said, this is orthogonal to whether your criticism of the use of fizzbuzz is valid. Your response may make you feel better, but it's showing me a lot about who you are, and it's not improving your hireability.
If I were asked fizzbuzz in an interview, I think I'd say something like "I'll answer that. But I expect the rest of the interview to be at a considerably deeper level."
As somebody who was often interviewing other people fighting for jobs at top companies I worked for, I would never ever offend them by throwing FizzBuzz in their faces; I don't have such arrogance in me. I would rather try to figure out what clicks with them and throw them something tasty where they can show off, then increase pressure to see what needs more work, then explain/discuss what could have been improved. I would respect their time and help them to learn something on that single interview they had with me. Never throw into their faces that they are frauds which is implied by employing FizzBuzz. One doesn't have to be a super psychologist, just simple empathy is sufficient to understand that people perform best when they are respected and treated as adults.
I think that sort of worldview puts you below the hiring bar, regardless of your technical ability.
Next time you need a lawyer (I am sure you will), ask them which new laws were enacted in the UK in the year 1648 and if they couldn't answer, don't hire them!
- if when you looked at the job req and it said we were looking for C#/Java/Python/JavaScript developers and you wrote it in Haskell, that’s one signal that you probably won’t produce solutions that meet the customer’s need.
- if we are hiring Haskell developers and I can’t understand the code that means you write unmaintainable, over architected code and that you would still be a net negative for the company.
Anyway: If it somehow happens that I'm interviewing you and you write a fizzbuzz program in super-fancy Haskell designed to be incomprehensible (if it's not designed to be incomprehensible then no, I'm not going to be unable to understand it for 30 years), then from my perspective I've learned: (1) you can indeed write code, (2) you're very smart, (3) you're a bit of an asshole. That's actually quite a lot of information for five minutes of interview time. (If you're super-smart but it takes you more than five minutes to write that fizzbuzz program, then you're prioritizing being an asshole over doing the job, because for sure you could have done it way quicker if you'd wanted; might not be a good sign.)
And if it somehow happens that I'm interviewing you and you misinterpret something entirely different that I say as advocacy for fizzbuzz in interviews, and go off on a rant about how no one any good should ever work for my company: no hire, have a nice day.
Do you know your language's modulo operator? I went down a rabbit hole the other day porting some Python code to another language and discovered that modulo acts differently in different languages for rather subtle reasons.[1]
It took me, frankly, more time and iteration to implement Python style modulo correctly than I would have in an interview, or be able to muster while conversing with someone.
[1] https://en.wikipedia.org/wiki/Modulo_operation (see the table on the right)
(I deal with the other cases by making sure only to use % or similar on nonnegative numbers. If I ever encounter a case where I need to take remainders and performance is so important that I can't afford to do that, I'll double-check with the language documentation and leave a comment saying what the actual behaviour is. That's never happened yet.)
I don't have concrete reasons for thinking so, but my general impression is that this attitude is significantly more common in IT than other environments.
People make mistakes on everything,[1] no matter how trivial. Therefore, it can be threatening to even a genuinely competent person to be judged on a really elementary task, because even though it is simple to do, the margin for error is correspondingly small. The easier it is, the less excuse for any hiccup.
Of course, you just said you are not judging on minor issues, but it's hard to believe even assuming your best intentions. The simpler a task, the more judgmental human nature compels one to be, and the more confirmation bias will work to magnify any later errors.
[1] https://en.wikipedia.org/wiki/Muphry%27s_law aka Skitt's law
I am not against it at all. It opens the conversation to some technical aspects that can be very intersesting to talk about.
As a candidate I love getting technical in interviews because It allows me to see how my prospective manager thinks. If we have radically different ways of taking care of a technical problem it's a red flag for me.
In the same area, I like the "let's talk about your last project" question too.
So, I've had my share of technical interviews and here what I observed :
I am usually unable to produce good software when the specs I'm supposed to use are not precise enough. I don't mean not complete enough. I mean not precise enough.
Be it on the job or in interviews I seriously question the ability of some interviewers to produce good technical interview questions.
By good I mean precise, using the right vocabulary.
I do not mean complete. You can knowingly give an incomplete spec to the candidate to see what kind of questions he/she would ask to try and get the whole picture. (or if he/she goes head first into an unsolvable problem)
But the details that are given need to be explained in precise terms. Not in a shadowy weird dialect based on a model that only the interviewer understand.
I've had my share of technical interviews and most of my fail attempts at live coding were due to (my lack of skill but also) questions not precise enough or misusing technical terms (sometimes even not grammatically correct questions).
The latter usually make me feel awkward because I wonder if those interviewers simply lack the minimum intelligence to explain a simple feature with precise words.
Good engineers I have worked with always use precise words to describe precise concepts. Using wrong or imprecise vocabulary is proof of a lack of understanding of the job and/or a will to try and sound "smart" or "tech-savvy" to compensate for some kind of inferiority complex.
So maybe a good advice to interviewers would be : technical questions on interviews yes. But good technical questions.
Have you ever considered that part of this is hoping that interviewees will ask questions seeking more precision? A lot of times on the job, you don't get such precision. There are unknowns you have to answer for yourself, and sometimes the right questions are more important than the technical approach.
That's why I insisted on the difference beetween imprecise and incomplete.
> I do not mean complete. You can knowingly give an incomplete spec to the candidate to see what kind of questions he/she would ask to try and get the whole picture. (or if he/she goes head first into an unsolvable problem)
I feel that using wrong technical vocabulary in a question is not a sign of a interviewer trying to make the candidate ask questions. Maybe it's just me.
our fizzbuz variant asks to print numbers from 1-100, and basically everyone among the few that did the fizzbuz part right got that part wrong, mostly printing 0-99 but also had one 0-100 printed.
this doesn't immediately disqualify a candidate of course, because the are a lot of reasons behind the mistake including the interview stress, but on requisite driven project attention to details is a major benefit.
Now, I’ve probably taken 100+ math exams in my life and I’d be happy to provide data from any one of them. Why trump all that data with 15 questions? Viewing the application process as a pure machine learning problem, their decision seems crazy.
I've written two articles along these same lines:
When they arrive on site, we give them a 90% completed program that needs 2-3 lines of code to finish. We tell them they can use the web to look up anything they need to. We're mainly looking to see how the candidate thinks, and we discuss what they're doing and why. We're more concerned about the why than the what.
Once this is done (about 15-20 minutes in), we have a reasonable understanding if someone would be able to do the work. Next we try to figure out how much they would need to learn to be productive, and try to see if the candidate would be a good fit culturally.
We had one candidate who a minute or two into the live coding exercise said "Geez, I really don't think I can do this." I reminded him we weren't looking for a correct answer and to just give it a try, and he wouldn't. I thanked him for his time and ended the interview.
It's coming up with what you took in your data structures/algorithms class a decade ago on the spot and write full functions about them, especially on a whiteboard, that gets really annoying, and makes programmers feel like they have to refresh their knowledge of an entire class (plus a bunch of other trivia from across CS) every time they want to find a new job.
One nit, though:
> The famous fizzbuzz test simply asks "are you aware of the modulo operator?"
FizzBuzz also tests basic programming skill, and it's surprising how often people fail that part. FizzBuzz isn't necessarily the best test of that; I know one interviewer who instead uses "write a function to swap two numbers". But some test of basic programming skill does help, albeit it should happen long before the in-person interview.
The XOR trick is cute but you shouldn't use it on anything larger or more modern than a Cortex-M0. Just put it through a temporary variable and let register renaming deal with it.
(Perhaps a more interesting question would be a multi-threaded examination of swapping two numbers...)
Finally it implies it could have asked a better interview question ;)
a = a ^ b
b = a ^ b
a = a ^ b
The above syntax works well in Python, but of course Python also had the much simpler tuple unpacking:
a, b = b, a
tmp = a; a = b; b = tmp
When a compiler generates code, it maintains a mapping from variables to registers. So when the source code refers to the variable 'a', the compiler might map this to register %eax, and 'b' to %ebx, and it will use this to generate assembly code (or IR or bytecode or whatever).
A good compiler will recognize the three-line variable swap above, and optimize it so that the mapping simply changes at that point. So any references to the variable 'a' before the swap will refer to %eax, and after will refer to %ebx.
This requires zero instructions, and zero is less than three :)
tmp = a, a = b, b = tmp?
For some reason, I find it impossible to figure things out when I am looking over someone else's shoulder, or in a meeting, but when I am seated at my desk, it is vastly easier.
There seems to be an attitude of "I had to go through this, so I don't see why new hires shouldn't" hidden under a thin layer of justifications but in fact we're playing a game with very limited information. We probably don't even have the tools to know if we're doing good or bad hires except in extreme cases. We almost certainly don't know if we're rejecting the wrong people. Still we pretend like it's working.
To me, it seems overly rigid, pattern-matching against a too-narrow idea of what a good developer/employee/team member is. So much could be improved by just adding some flexibility, but maybe we're afraid of losing the illusion of having a Process and Objective Criteria.
Maybe I'm naive, but aren't we looking for what people are good at and what they might bring to the table? Maybe someone likes programming puzzles and whiteboards, let them do it, but don't insist if it freaks another person out. Maybe someone else would rather do a take-home assignment, but don't insist on it if someone else don't have the will to do several hours of unpaid work. Others might prefer pair-programming in person, technical quizzes, Codility-style problem solving online, actual paid work on a project basis.
Sometimes (well, maybe even typically) the beginning and ending of an application process are with different groups, and types, of people.
Depending on where you put your job postings you can get really swamped by them.
I think one ought to consider the possibility that if the vast majority of interviewees can't code at all, there is something wrong with the company/process. I mean, I'm not saying it necessarily follows, but the question is worth considering.
I have never been asked to implement FizzBuzz, so I can't buy the claim that "everybody does it".
Rightly or wrongly, if I was asked tomorrow, I wouldn't have the preconception that it was appropriate or necessary, and thus wouldn't necessarily choose to continue if I thought it was indicative of culture. If other people react similarly, it doesn't necessarily matter if it is a reasonable standard of competence; you're still skewing the pool in other ways than you intend.
When I was doing interviews I was always mostly discussing motivation. Most of the time the hires turned out very good, but I did happen to have one bad one and it cost us quite some time.
The golden question being "who gets to decide who is an asshole"
Ironically a paragraph down they say:
"You are NOT hiring for "team fit""
On the other hand, "hiring for future potential" sounds great but is really vulnerable to personal bias since it's inherently about the unknown future. If you want to run a deterministic interview process you need to have a standard set of questions and a rubric for assessing answers, written up in advance.
It doesn’t have to be perfect, I don’t have to be completely right, and after going and doing a proof of concept, I might be completely off base or realize there is something so didn’t think about. But I am expected to “pseudo-architect” on the fly.
The syllogism you're proposing overlooks some human variables.
Interpersonal interaction tends to completely occupy my cognitive capacity, the moreso if the other person is a stranger, or if they are challenging me in some way (such as, for example, posing puzzles and evaluating the quality of my answers). I can't think about logical operations under those conditions. I require peace and detachment from human concerns in order to think that way.
This is, of course, a personal quirk, or, if you prefer, disability, and nobody should have to bear the burden of it but me. But I've been an actual 10X programmer on a shipping product, as verified by DVCS statistics. I submit that as evidence that I can, in fact, code. I just can't do it in interview conditions.
I also can't navigate while interacting with someone. I can drive just fine; I can operate a vehicle safely. I just can't navigate. Everyone in my close family is aware of this limitation. When my daughter was a teenager, she exploited this quirk for laughs. I have to admit, I thought it was pretty funny, too. In particular, I remember a pause in a conversation where I looked around and realized that I was parked at a Safeway in Capitola, California, and had no idea how I got there. My daughter and I both laughed when I realized what had happened.
But if you want me to drive, and you want to reach a specific, predictable destination, you have to leave me alone to navigate.
Similarly, if you want me to be a 10X programmer, or indeed any kind of working programmer, you have to leave me alone to do it.
Maybe I'm not the only one.
I won't argue that you should accommodate me, or people like me. Maybe you don't need us. That's okay. I've found other ways to get by--being hired by people already familiar with my other work, for example, or making my own products. It's maybe a less predictable career path than the usual, but it's worked so far.
But for obvious reasons, I can't agree with your claim.
I'd take someone who says "I can't live-code while talking about it, but here's an example of my code and I can explain how it works" over someone who tries to BS me.
- if they are confident and fail, I'll pass on them
- if they are nervous and we'll fail, we'll talk about it, and move on with the interview
- if they succeed, I'll move on w/the interview
- if they refuse, I'll hire them immediately and recommend them for promotion
Hosting a tech Q&A site doesn't make you the canonical source of how to structure interviews.
The live coding interview style was a toxic and negative contribution to the tech industry as a whole, IMO.
Really, you should read it (unless you were only trolling). It is a very fast read and full of insight.
Also, "tech Q&A site " is a huge mischaracterization of Joel's blog. He has really insightful articles like "Evidence based Scheduling", or the ones about (not) rewriting-code.