The SAT of Technical Interviews is Here

Richard Kim
cw Richard Kim
Published in
6 min readNov 16, 2015

--

When colleges faced an overwhelming number of applications, they turned to standardized testing to cheaply chop off the bottom 70% of applicants. As interest in computer science soars, technical companies will probably turn to a similar solution. Why? Well, let’s approach this problem algorithmically.

Consider the following problem: you have a list of candidates and you want to find the top 5 based on a “fitScore” between 0 and 100. The candidate object looks like this:

You have two functions that you can use.

  1. interview(candidate): Gives you a fitScore that is very accurate. Only one interview can run at a time (i.e. runs on the main thread), else costs increase significantly.
  2. test(candidate): calling this sets candidate.testingPerformance to an integer between 0 and 100. This can be run on the candidate’s own computer (i.e. multiple threads), so many can run at the same time. There is a one-time cost to create the test.

The brute force solution is to interview each candidate one at a time. Here’s a visualization:

O(n) algorithm

Blue dots are good candidates with high fitScores. We run interview(candidate) on every object in the list and keep track of the top 5. interview(candidate) is highly accurate, but calling them on every applicant is slow and costly. For example, what happens when we have a much larger input?

larger input size, n

When the number of candidates triples, the total time and cost of interviewing triples, but we’re still only filling up the same 5 spots. How can we improve this algorithm?

The first thought would be to split the input and have multiple machines run interview(candidate) on their own sublist of candidates. However, we know this will significantly increase costs (as outlined in the function specs).

The next thought would be to run test(candidate) on all of the candidates simultaneously, and eliminate the candidates that test below a certain threshold. The remaining candidates are then interviewed individually. This algorithm looks like this:

As you can see, the test taking happens simultaneously on every candidate’s computer, so as the number of candidates increases, the total time stays the same. You might notice that some exceptional candidates were lost and some unexceptional candidates passed. That being said, the candidates that remain are:

So, with a small initial overhead cost, we were able to cut down the number of candidates to a small, higher quality group in constant time. If we adjust our testing threshold correctly, we’ll always have a manageable, constant number of candidates left (eg: 20) that we can interview individually. In other words, the time complexity of this algorithm is constant.

(Note: in practice this is likely used to reduce the pool by an every-increasing percentage rather than to a constant, but the principle is the same).

The Takeaway

If you’ve completed a job application and thought it felt eerily similar to a college application, that’s not a coincidence. Colleges and technical jobs have a lot in common. Beyond searching for the best intellectual candidates they can find, they are both looking to grow their internal cultures and external reputations based on the people they admit. However, finding the right people in any accurate way can be very, very expensive.

This is where the SATs come in. Most people misunderstand the purpose of the SATs. It’s just a method of filtering out the noise. It’s a relatively cheap but inaccurate way of removing applications that likely won’t succeed before deploying expensive methods of detecting excellence.

(source)

Just as colleges all around the world received an influx of applications within the last decade, computer science has received an explosion of interest in the last few years. In response, we can expect a huge influx of applications to top tech companies, and thus a shift in how tech companies review their applicants.

I’ve gone through a handful of interview seasons, and this year my friends and I noticed an unmistakable increase in the number of companies who required a coding challenge before the initial phone screen. I think as early as next year you won’t be able to get a single phone call until you do a timed coding challenge.

How to Prepare

Don’t be the excellent candidate that gets filtered out.

My advice is simple: practice coding questions that will be tested. If you notice that a lot of companies respond to you with a single platform, focus on that platform. Why? Because it’s easy to look at a problem and imagine that you can solve it. It’s very different to finish the problem and compare the results to a suite of test cases.

A timed coding challenge is exactly what it sounds like. You’re given a question that’s relatively simple to solve poorly, but can also be cleverly optimized. You can also run your code against sample input/output to test for correctness, bugs, and algorithm efficiency. One great example is computing the nth Fibonacci number. An exponential-time answer is easy, a linear-time answer is tricky, and making that O(1) space is even trickier.

I’ve noticed that a majority of companies use HackerRank. This is including companies that have previously made their own testing platforms. That strongly signals to me that companies are looking to outsource testing software. HackerRank’s testing experience is solid, their input / output system is relatively clear, and they also give you reasonable feedback from hidden test cases. If there will be a world-dominating testing platform for programming, my money is on HackerRank.

This year I accepted an offer at Google (Alphabet), and I attribute this opportunity primarily to the practice I’ve done on HackerRank. Over the course of 1-2 months, I’ve done roughly a hundred problems in Python (a language I hadn’t previously used much). I highly recommend Python as it saves you tons of time with its amazingly simple input-parsing capabilities. Also, writing in Python is kind of like writing in pseudocode, so it’s much easier to reason about and debug (at this scale). I can say with reasonable confidence that I can complete a coding challenge in Python 30% faster than in any other language I’m familiar with.

You sat through hours of SAT practice tests. Timed coding challenges should be no different. It’s more than just about improving your coding skills (though that’s a huge part of it). It’s also about removing unfamiliar elements for when you’re on the clock. Once you do a few dozen of these, you will live and breathe algorithms, and interviewing will be a piece of cake. Want to get started? Try this on for size.

Questions? Concerns? Comments? Send them my way. Come say hi! Or read about how I built a popular joke app and how it taught me that the app store is broken:

--

--