Algorithms in interviews: Hazing ritual or valuable vetting technique?

Daniel Bean - Jul 14 '20 - - Dev Community

This article first appeared on the Triplebyte blog and was written by Joseph Pacheco. Joseph is a software engineer who has conducted over 1,400 technical interviews for everything from backend, to mobile, to low-level systems, and beyond. He’s seen every quirk, hiccup, and one-of-a-kind strength you can think of and wants to share what he’s learned to help engineers grow.

Academic algorithms tests on interviews can really put people off. Their presence is often considered a pointless hurdle, a relic of a bygone era of traditional testing techniques that are no longer relevant. And with the rise of bootcamps and other resources, an ever-increasing number of engineers lack a traditional computer science (CS) background. So why do companies rely on them so heavily? Here are a few reasons that might surprise you.

It’s Not About Reinventing the Wheel

Before we get to the juicy stuff, we need to address the elephant in the room: Companies don’t ask you to implement a BFS because they expect you to do so on the job. They know most programmers don’t touch academic data structures and algorithms on a daily basis. Every modern programming language in the world has marvelously crafted performant implementations of pretty much anything you can think of at your disposal. Except in rare, niche circumstances, you are never going to implement a binary search tree from scratch as part of production code. In fact, you’d be a fool to do so. Reinventing the wheel is a waste. It’s inimical to productive, high-value software engineering. We’re all on the same page about this.

They’re a Lingua Franca

Candidates come from myriad backgrounds. They have differing strengths and know a breadth of differing technologies. The one common denominator among most candidates is CS fundamentals. They offer a structured, widely available universe of knowledge that acts as a microcosm of software problem-solving. At the very least, companies need to know you can solve problems, and academic algorithms can test that very effectively. Using this material as a base, interviewers can create problems of limited, digestible scope that require zero knowledge of any particular platform, technology, or engineering philosophy. And even if you’ve never been in a CS class, it’s something you can pick up (and easier than you think – Triplebyte has put together some free algorithm educational resources to check out here.

In a way, this actually creates a level playing field. It allows interviewers to wade through the noise and get a look at how different people solve exactly the same problems. It’s by no means without limitations, but it’s amazingly convenient that the same exact material can reveal strengths in candidates with wildly different backgrounds.

They Test for Intellectual Elasticity

Besides, companies are often not interested in candidates who only know and care about one thing. They want to see flexibility in the breadth of material you can tackle as business needs change and technologies evolve. Academic algorithms are often outside the scope of your daily routine – something you don’t specialize in. If you can master them, and keep that skill fresh, it’s not crazy to think you can master other things outside of your comfort zone. At any point, changes in the market could demand a paradigm shift in the way you’re approaching a project or some novel approach for a sneaky problem only your users have encountered. The more you can take a step back and utilize every possible resource or path, the more you can deliver results.

They Make You a Better Engineer

When it comes to algorithms, nuance matters a lot. Engineers who notice these nuances and manage them correctly tend to notice nuances in other areas of engineering. And this might indicate an ability to avoid the kinds of mistakes that can arise from less organized technical thinking. While that’s obviously helpful for companies looking to build great teams, it’s also convenient that simply learning this material can help you become more precise in your own thinking. It’s a two-way street that helps you just as much (if not more).

Aside from that, they force you to think about efficiency and space. Of course, some companies will need you to be highly conscious of this depending on what you’re doing, particularly the mammoth companies that build all their tools from scratch. But even if your specialty doesn’t usually demand this kind of thinking, it has unexpected, positive side-effects on the way you write code. Let’s say you’re a mobile developer. Most of the time, you don’t even deal with data large enough to have to worry about efficiency. Brute force is fine most of the time. But suddenly, you’re getting reports that your app is crashing. Having even a rough understanding of time and space complexity, particularly how they apply to the foundational data structures on your system, could save hours of downtime and your app’s reputation. The academic stuff, while it may seem far off and distantly relevant, has this way of being useful when you least expect it.

They Even Reveal Character

A candidate’s reaction to being asked algorithms questions can also be very revealing. It is baffling how many think it’s a good idea to lecture their interviewer on the pointlessness of asking one question or another, and that often comes up during algorithms assessments because of their controversial nature. Being unwilling to accept the situation for what it is says a lot about how you will carry yourself on the job. Are you going to be a team player, or are you going to dig in your heels when your ego has been hurt? Are you going to do what’s needed to solve problems, or complain about why those problems shouldn’t be happening? It’s natural to feel resistance when you think your dignity is being threatened. It’s also natural to push back against inefficiency and indeed noble to fight for optimization. But don’t forget how important it is to exercise a habit of humility and be willing to assume best intentions.

Embrace What Is

In lieu of a more sophisticated way of measuring your technical strengths directly — which, by the way, Triplebyte happens to be working on — algorithm tests can be great and highly accessible ways to peer into key skills in a structured, replicable manner. And for the foreseeable future, they aren’t going anywhere. Even Triplebyte’s CEO agrees:

I fundamentally do not believe that good programmers should have to learn special interviewing skills to do well on interviews. But the status quo is what it is ... A startlingly high percentage of interview questions reduce to breadth-first search or the use of a hash table to count uniques. You need to be able to write a BFS cold, and you need to understand how a hash table is implemented.

The interview algorithm testing process is far from ideal, but it’s also not pointless. Attempting to see how it might be valuable, even advantageous with the right mindset, will help you get the jobs you really want. In the words of Marcus Aurelius, “What stands in the way becomes the way.” And even better stated by Ryan Holiday, “The obstacle is the way.”

Triplebyte helps engineers assess and showcase their technical skills and connects them with great opportunities. You can get started here.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player