inessential by Brent Simmons

A Coding Challenge Can’t Show How I Solve A Problem

Some number of people, on Twitter and elsewhere, have told me that it’s not about getting the right answer — it’s about showing the interviewer how you go about solving problems.

I’ve read a bunch of the advice on this, and the advice says things like: “Start talking. Restate the problem. Talk out an approach. Consider how much space/time it will use. And then start writing code.”

Which is of course not at all how I solve problems. I usually start with some hazy intuitive approach and start writing code. I code and think at the same time. I revise what I wrote, or even delete it. Then I go for lunch.

I come back to it, and if I’m still stuck I look in the documentation. Or Apple’s dev forums or Stack Overflow or Wikipedia. I might ask someone on my team or I might ask some friends on a Slack group. Or maybe I figure out an approach on my own after all, and then just do web searches to validate the approach.

And — this is critical — as I’m doing all of this I’m using the IDE I always use, with autocorrect, profiler, debugger, etc. All my tools. Where I’m used to the text editor and its syntax coloring and how it balances braces. Where hitting cmd-S — as I habitually do — doesn’t result in my browser prompting me to save the current page.

And — even more critical — I don’t have a 45-minute time constraint. Nobody is watching me type and judging. I’m writing code to solve a problem, rather than writing code to get a job.

There’s a huge difference between “solve this performance problem with a binary search” and “pass this test so you can feed your family.”

* * *

There’s a whole small industry to help people prepare for these tests — so it’s not like you’re getting the authentic programmer showing up. You’re getting the person who’s prepared for one of these.

Because of that, an interviewer is even less likely to learn how a candidate approaches solving a problem. Instead, they’ll learn how well the candidate prepared to make a good impression — which tells you nothing about how they’d actually solve a problem.

I think these end up favoring people with more time to prepare. It probably helps if college isn’t a decades-old memory — the closer you are to taking tests in school, the more comfortable you’ll be, and the less you’ll feel like this is an absurd exercise with no meaning.