Better Programming

Advice for programmers.

Follow publication

Member-only story

How You Practice With Leetcode for Interviews Is Probably Bad

Nathan Patnam
Better Programming
Published in
8 min readAug 27, 2020

--

Photo by Pexel

I’m writing this article because I never want someone to put in hundreds of hours into Leetcode and for them to get a false sense of confidence that they can pass any coding interview. Then, when they get rejected from all of their interviews because they don’t understand the technical interview process or the criteria being assessed, to have that crushing feeling of remorse, thinking, “I wasted hundreds of hours and/or hundreds of dollars on Leetcode.” I’ve had painful first-hand experience of this.

I think it’s great to practice your problem-solving coding skills with Leetcode or even AlgoExpert, especially if you are unfamiliar with data structures like stacks, queues, heaps, tries, etc. In the past, I’ve purchased monthly subscriptions for both when I was actively interviewing for internships in college. However, I think there’s a lot of value in understanding what interviewers are expecting in a technical interview. Even if you were to get the most optimal solution for a given problem, that’s not all we are looking for (which surprises many people).

From an interviewer’s perspective, we evaluate candidates on five different axes during a coding interview. Some of the specifics may vary from company to company, but the overall criteria remain the same. I’ll use a trivial coding question as an example, but you can imagine that the same concepts apply as the questions get harder or more complex.

1. Clarifying Ambiguity

Suppose I gave you a question like, “given a collection of numbers, return the largest number,” in an interview. Do you immediately start coding, or do you spend some time (5, 10, or even 15 minutes) asking some questions upfront and try to identify some of the edge cases? Over time, you will get better at asking questions and identifying edge cases. If you have never done this before, next time, when you are solving a Leetcode problem, start thinking about some of the test cases, Leetcode may be running against your solution behind the scenes. Clarifying questions you may want to ask for the problem above (I purposely left the question vague since you may face this type of wording in an interview) are:

--

--

Nathan Patnam
Nathan Patnam

Written by Nathan Patnam

Software Engineer @ Salesforce & Avid Baker. Happy to chat or mentor, my calendar is at https://calendly.com/nathanpatnam Portfolio: https://nathanpatnam.com

Responses (6)

Write a response