There are hundreds upon hundreds of questions on Leetcode and I wanted to see if there’s a source where I can learn the most common patterns ( sliding window , bfs , dfs etc) instead of trying to do 400 questions
Just about any fundamentals of computer science textbook. I'm not trying to be snarky. I'll give you the benefit of the doubt and assume you're not a cs/softeng grad that copied all their homework from their friends, and are a non-tech type trying to change career paths. Things like bfs/dfs are basic algorithms that any textbook will cover, along with all the other basic theoretical stuff you need to practice in problems. Things like "sliding window" aren't really covered in most books, because it's just "looking through an array"... When people say "we can do this with a sliding window", it's not because there's a cs technique called "sliding window" that is taught in school. You're just solving a problem with a loop or two. Terminology like "sliding window" and "inchworm" just emerge naturally when discussing it. I guess that's similar to "patterns" but... Just do problems and you'll see the patterns. Trying to memorize them is an awful idea. You should know them from experience. If you're just learning to program and trying to apply specific techniques to problems, I highly recommend HackerRank. You can go by topic, and solve increasingly difficult problems within an area.
sliding windows are demonstrated in sedgewick’s book via rabin karp
OP is asking for deliberate practice advice, youre telling him not to worry about optimizing his time. https://www.google.com/amp/s/tim.blog/2007/11/07/how-to-learn-but-not-master-any-language-in-1-hour-plus-a-favor/amp/
get a competitive programming textbook and it should be more than sufficient (still helps to practice a few problems though)
Introduction to algorithms
Your best chance of performing well is discovering those patterns yourself through the completion of problems. That's the only way you'll be prepared systematically for any question that could arise. Otherwise you're just playing long odds that the pattern you've memorized is applicable to any problem at hand
That's very inefficient. Has nobody wrote a book and guide on the top N most common patterns/tricks you can use to solve leetcode question. I'm sure OP was looking for a 80/20 solution and many of us would like that too.
The point is to be prepared in a systemic way instead of memorizing existing solutions. Even if it looks a problem falls into a known category so you can apply a corresponding pattern, problems are unique, solutions should be provided adequate to the problems. There are tons of moments when an existing pattern needs to be modified to achieve the right solution. So without general Education in CS it is hard to be ready to all interview questions not even mentioning to do the job well if hired.
I’m about 150 leet in and still don’t feel confident to know exactly what to do to learn the tricks and strategies
OP - on solving Leetcode problem, do you always look at the solution too after giving your solution? That's one way to learn about optimized solution and other possible solutions.
that’s the only way to hide company name i think 💁♂️
Yup don’t wanna get rekt for posting on blind