About leetcode based interviews
Defining an interview loop structure is a balance between minimising number of interviews (speed of decision and candidate experience) and maximising number of insights about candidate. Although we aim for having the most valuable interviews, many companies opt for LeetCode challenges, which offer limited signals about candidates. This article delves into why a LeetCode interview might not be the best choice for your company.
What is leetcode programming interview?
In short, leedcode programming interview is a format of programming interview where a candidate is asked to implement an algorithm that based on a set of rules and input will produce a specific output. For more details please check my post about Different types of programming interview.
What’s wrong with leetcode interview?
Main purpose of a programming interview is to assess how good of a programmer the candidate is. But what does it mean to be good at programming? First and foremost it means the candidate can read code.
“Indeed, the ratio of time spent reading versus writing is well over 10 to 1. We are constantly reading old code as part of the effort to write new code. …[Therefore,] making it easy to read makes it easier to write.” Robert C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship
To fix a bug or to implement a feature we need at first to understand the structure of our current codebase. We need to know flows and how different parts of the code interact with each other. We do that primarily by reading the code.
Writing easy to understand, testable and extensible code is the second essential skill needed to be good at programming. At the end of the day we write code for others so they can easily use it and build on top of it.
Leetcode interview does not test how well a candidate navigates the existing codebase. The interview starts with a task and empty editor. There is no code to read.
Leetcode interview focuses on writing code. The problem presented during such interview will test knowledge about programming language of candidates choice (with most emphasis on data structures). It will test mental flexibility when candidates have to implement a solution that covers all corner cases in nested loops with variables used for iteration that are dependent on each other. All that under pressure of time. The implemented solution will be impossible to judge from a maintainability perspective. It will usually be enclosed within a single method with the goal of producing the most efficient solution to the problem. The testing of the implementation either will be provided by the interviewer (to verify correctness) or the candidate will have to write it on their own. Anyway, it’s easy as the code will not have any side effects (IO, exceptions etc). Leetcode’s interview rarely focuses on extensibility (anyone ever heard about making reversing binary tree algorithms extensible?).
Leetcode interviews have very little connection to an everyday engineering job. A candidate can have 20 years of battle tested experience and “scars” from the huge scale migrations and integrations but still fail the interview. Succeeding in the interview requires additional time and practice outside of everyday job which should tell enough about its usefulness. As a result every day companies passes on applicants that are great fit but who aren’t particularly good at solving algorithmic problems.
Does it ever makes sense to do leetcode interview?
There are three situations where leetcode makes sense.
Graduate students
When graduate students look for a job they often do not have any experience on their CV. Because of this it is hard to assess their skill as they are joining a company to develop skills. Leetcode can be one of the tools for deciding about such candidates as they just left university and should be proficient in leetcoding.
Algorithms heavy job \ position
There are companies that heavily rely on algorithms in everyday job. Good example of such a company is Here which makes GPS navigation and maps. The first step in their interview process is a leetcode challenge that consists of implementing multiple geometric algorithms.
Overwhelming number of candidates
Companies that receive thousands of applicants every single day need to have a cheap and easy way to filter them. Leetcode interview screening as one of the first steps of the interview process makes sense in such a situation. The company decides it’s fine to drop some of the good fit candidates but gains a smaller pool of people that will require interviewing.
What now?
There are alternatives to leet code interviews. If you work for a company which does leet code during interviews and you do not think it makes sense then bring it up with your manager. Be warned, they might ask you to do some work to make a change so do this only if you really believe and care about improving hiring process. I do and that’s why I write about companies that do not do leetcode. That’s why I wrote this article. And that’s why if you want to make a change but need help you can contact me here.