So...if he had gotten the code right, he would have taken this job and his current job? Because that's the only way his five lines of code are worth $20,000 apiece.
Yes, and he'd have to hold the job for exactly one year, then quit. A better title would have been "Five lines of code cost me a job interview", which is so unremarkable as to not be worth reading.
The most surprising thing in the article, really, is that he managed to have thirty interviews without having an experience like this.
I've always felt that writing code on a whiteboard is a crap way to interview people, and I feel that way every time I'm interviewed that way. At least give me a text editor so my mental associations come back to me quick enough.
Oddly enough, I prefer coding on paper or a whiteboard and transcribing the code if I'm working on a problem I find particularly hard. I think I'm unusual though, I haven't met many people who prefer coding on paper.
I've seen candidates who screw up problems which boil down to trivial "if" or even just "return" statements on the whiteboard (like "write a function which determines if the argument is an even number"). The argument of mental associations makes sense, but having someone in front of a whiteboard with a trivial problem is a good way to tell if the candidate can program at all.
It is crap, and I say that as someone who's gotten hired after white board coding every time. I am a good public speaker, and I like to think I'm a good coder, but damn do I suck at coding on a white board.
If you're a good coder/public speaker, you have to practice white board coding if you're looking for a job.
> I've always felt that writing code on a whiteboard is a crap way to interview people
I've never worked at an organization where folks didn't work through ideas together at a whiteboard. Some of said "work through" involves code snippets.
So, while coding on a whiteboard may not be necessary/useful, communicating about code on a whiteboard is extremely important.
I write all of my code with a keyboard, in a text editor. If I have a keyboard and a text editor my brain remembers how to write code better than if I have a whiteboard and a marker, because I don't write code on whiteboards.
The brain works this way, which is why you feel sleepy when you go to bed (unless you spend a lot of time in bed not sleeping). It's a type of compartmentalization, well known in psychology.
The brain is a funny thing. You can be both good at coding AND at speaking in front a white board, but at the same time suck at coding on a white board. I can tell you that from personal experience.
...right before I had graduated from my undergrad and was looking for something to do after graduation.
...at that point in my career. I had experience at Princeton's Plasma Physics Labs writing data analysis software for nucelar fusion experiments, experience working on artificial intelligence and natural language processing at Google, had worked at a defense startup, and had over 7 years at a lawfirm
huh? All before graduating?
I had done a little over 30 interviews, and had always gotten an offer
Who the hell does 30 interviews and rejects every last offer? WTF? And then he can't write a function he's already written "hundreds of times"? Am I reading this wrong?
I'm the author. Yes, all that happened during my undergrad (Except my experience at the lawfirm, which started in high school and continued through college. I handled all of their technology related stuff. I wound up doing a lot of consulting for various other firms too through recommendations).
The 30 interviews were all the interviews I've ever done, like jackowayed said.
As far as writing the function goes, yea I was just having an off day, which was the point of the post.
I wouldn't hire this guy, what good is a coder that has to have 3 RedBulls and can't do anything productive until the afternoon?
If you can't represent your abilities away from a computer on a whiteboard or in a conversation to a reasonable extent, you are not as good as you would like to think you are, and the guy who can do it is better than you.
He didn't miss the job because he couldn't answer the questions, he missed the job because someone else could.
[edit: Okay, I might be a bit grumpy, but I think the gist of my comment is spot-on]
The point of my post was that coincidences happen. I had an off day (which we all have) that also happened to coincide with an interview. I usually don't need energy drinks or the afternoon (although many software engineers perform better in the evening).
I usually can represent my abilities, and execute on them just fine, in any context. This day was a statistical outlier compared to my average day. If this was routine for me, it wouldn't have seemed so unusual.... but screwing up really badly once after nailing it 30 other times seemed interesting to me.
Hmm, re-reading things, I seem to have been caught up in a thread here (http://news.ycombinator.com/item?id=565038) and in my mindless annoyance I mistakenly applied the thread logic to the post. Apologies.
To be fair he was coming off 4 hours sleep after a cross-country flight to CA. Most people would need a few Red Bulls to think clearly for a tech interview in that situation.