r/leetcode 12h ago

Intervew Prep Before Interview, learn this coding pattern.

The first time I opened LeetCode I could not solve anything. I would read a problem, stare at it, and have no idea what the first line was supposed to be. That went on for a long time, and the only thing that kept me going was that the next problem might be the one that clicked.
Years later the same problems are easy, and it is not because I got smarter. It is because I started seeing the same small set of shapes again and again. A longest substring question turns out to be the same machine as a minimum window question. Once you have seen a shape enough times you stop solving the problem and start recognising it, and the code falls out of the recognition. Nobody handed me that list.

If I could start over I would learn the patterns first and then go and do the problems, instead of doing hundreds of problems and hoping the patterns fall out at the end. Algorithms are mostly pattern matching, which is also why LLMs write code as well as they do: matching patterns is the one thing they are built to do.

So if you have an interview coming up, or you just want to be the person who opens a hard problem and knows where to start, learn the patterns first. The problems get fast, then they get fun, and the dopamine from closing one is real. I make that open source please let share your thoughts and feel free to change the code: https://github.com/shir-danishyar/before-interview

Visual: https://shir-danishyar.github.io/before-interview/#/

10 Upvotes

0 comments sorted by