Leetcode and interviews
by Nick
Originally published on LinkedIn
Stagefright. In an interview situation it is the worst. I have the greatest conversations and then as soon as I get asked to do the simplest coding puzzle my mind goes blank.
To fight this, I’ve been doing a daily kata practice of working on a LeetCode puzzle. Not only do these serve as a “mental warm up”, but a few times they helped me uncover things I’ve forgotten (from lack of use), or things I never really understood deeply.
I’ve also started livestreaming/recording my practice sessions to help amp up the “intentionality” of my efforts. In doing this I am:
-
Working in public, which is basically what we all fear in the interview. It’s a livestream so anyone could drop in!
-
Thinking out loud: Companies give out the challenges to see how you think. Talking while I code is kind of unnatural, so this is an opportunity to do this. (Watching yourself on a recording is a great way to realize which words you overuse. I say “like” waaaaay too much. 😬)
-
Showing that I can do it! By recording these, even the bad ones where I struggle, I can now go back and quiet my doubts. Also, if it ever comes to it, I can share the playlist out and show a potential employer that yes, I can actually solve a puzzle.
-
I am documenting things I don’t know. This might not sound like a positive, but hear me out: knowing where the boundary of your knowledge is essential. Being in unfamiliar territory is scary, especially in the pressure cooker of an interview. Nobody is perfect or all knowing and having it recorded keeps me from dismissing a challenging problems as “Oh, you’d never do that in the real world”.
So to wrap this up, LeetCode style interviews are a fact of life for the working programmer. A little bit of daily practice with it can go a long way!
PS: did you know that LeetCode has a cheatsheet page? It is a really useful reminder of certain patterns that come up in these puzzles. Its a great reminder of things you might not do on a daily basis at work (like code up a breadth-first search for a graph). Log in to check it out in detail: https://leetcode.com/explore/interview/card/cheatsheets
tags: thinking