I recently switched jobs, and as a part of that switch I had to do something that I’ve always hated: algorithm interviews.
For those unfamiliar, what I’m dubbing as algorithm interviews are interviews where an interviewer gives you some problem to solve that typically involves writing an algorithm using one of a number of different data structures. Stacks, arrays, maps, tries and so on.
They’ve become almost universally hated in the industry - and for mostly good reason. If you’re asked to write an algorithm that checks if a string is a phone number, how does that predict if you’ll be a good web developer?
So what do?
I discovered a neat little trick the last time I was interviewing for jobs: you can get better at solving those algorithm problems.
When I first started in my career as a programmer I lived in abject fear of these types of interviews. I had internalized that I was bad at algorithm problems and that was just…it. I assumed, for some unknown reason, that I was fundamentally, irreversibly bad at them and that that just could not change.
But as I grew more confident in myself as a developer I figured it would be worthwhile for me to practice a few problems before I started another job search.
I started poking through the easy problems on leetcode and confirmed my fears: a problem that was supposed to take ten or fifteen minutes would often take me multiple hours. Rough.
But then they started only taking a half hour or so.
And then they started being downright easy.
So I moved onto the medium difficulty problems. Those too would take me multiple hours. And then an hour. And then a half hour and so on.
So I discovered that with enough practice, even if you consider yourself awful at these types of problems, you can become good at them.
What’s the upside for companies?
So we know people hate algorithm interviews and we now also know that with enough practice you can become good at solving those types of problems.
And that brings us to what these algorithm interviews can select for:
- They can select for naturally gifted developers who don’t need to practice and can just fly through the interview problems without any studying.
- They also select for developers who are willing to put in the significant amount of time to become good at the interview problems.
As a company, you obviously want to select for both of those types of developers. If you’re, say, Google or Facebook, you probably get enough applicants that you don’t really need to worry about the fact that there are great, hardworking developers who won’t spend the time to become proficient at those types of problems and will thus fail your interviews.
Most of these companies also have separate stages of the interview process that will dig deep into your competency in whatever stack you’re applying for, so they hopefully don’t get people who are great at algorithms that know nothing about web development or whatever the job entails.
Takeaways
So the bad news is it kind of makes sense for these giant companies to employ those algorithm interviews.
The good news is, if you’re willing to put in the time, you can become good at them. Now whether you should put in the time is a totally different question.