With so many layoffs I figure many talented engineers will have to go through the shitty Leetcode lifestyle one more time. Here’s my contribution. If you have less time and don’t know where to start, start from here: Learn these techniques. These are comprehensive af and you’ll become master Yoda if you spend time consciously on these topics. Plan on spending about 2-3 weeks. LEETCODE PATTERNS 1. Two pointer, fast/slow pointers 2. Bfs, dfs 3. Topological sorting 4. Dijkastra, (bellmon ford, kruskal if you want Yoda power), def know about min spanning tree 5. Recursion w/ memoization 6. Bit manipulation (Yoda power) 7. Tree traversal top-down and bottom-up 8. Inorder, preorder, postorder (def learn reconstructing BST if you have postorder - uber asked me this) 9. DP using table instead of recursion to save memory space 10. LRU cache using HM and DL list, (LFU cache for Yoda power) 11. Min heaps (priority queue) and use cases. Classic example being top K style questions. Another classic: find median of a continuous stream of integers. 12. Matrix classic questions: minesweeper, rotting orange, viral video etc where they ask for minimum steps before all oranges rot. It’s a classic BFS technique 13. binary search technique to find element in sorted and rotated array 🥵 look it up this is a killer 14. backtracking, permutation/combination, set generation. Classic example is the combination sum problem. AFTER you’ve gathered knowledge and practiced some questions on topics above, start doing LC Tagged 3-4 days before that company’s interview. Also do Blind 75 speedrun on a weekend and drink coffee 2 times. Retain all the knowledge until you land a job. Yoda power questions are rarely asked. If I find gems in the comment section I will come back and update this post. Finally, never stop loving yourself and the people around you. Success and happiness is just around the corner. -———————————————————————- user @bananapipd shared a handy list of grind75 questions so take a look at that along with blind75 https://www.techinterviewhandbook.org/grind75 Also check out my similar thread about system design interview: "SYSTEM DESIGN TOPICS 🙏 (bookmark this thread) (Software Engineering Career)" https://us.teamblind.com/s/nxNoaABg -———————————————————————- #engineering #swe #leetcode #techniques
Thank you so much!
Thank you so much!
Blind or Grind 75 m confused 😕
Why do you say min spanning tree is a must I’ve never heard of someone being asked that
Kruskal has been asked, some union find related question
I haven’t been asked yet, but MST is an easy concept unlike DP. The ROI is big enough to warrant everyone should spend 30 mins to learn it. And 30 mins is more than enough for MST. afair, we sort the edges based on weight and start connecting in ascending order and skip the edge that would cause cycle. How to check for cycles efficiently? THAT is the part one needs to know here. Hint: quick union vs quick find (use one or the other depends on the situation)… again I have not been asked this ever. Most interviewers would be scared to ask this lmao but please just learn it.
The first time I heard of leetcode was in 2016. I tried to solve easy problems but found them difficult, so I gave up. In early 2019, I had an interview for a CV/ML position at a self-driving car company, so I started solving leetcode problems a month before the interview. After failing the interview, I once again gave up. Up to this point, I had solved fewer than 100 problems. I am a non-CS PhD (my PhD is in Engineering), and for my PhD research, I audited a few ML, non-linear optimization, and graph theory courses. During 2020, there were layoffs, and my salary at a startup was significantly reduced. I was able to secure phone screens at all the FAANG companies but could not clear them. Then, in July, I was browsing interview experiences on Leetcode, and I read one comment that said, "Leetcode every day keeps unemployment away." Then, from August 2020 onwards, I decided to learn algorithms and data structures and solve at least one problem a day on Leetcode. Initially, it was difficult to solve even easy problems, but with consistency and hard work, I was able to solve more than 1100 problems. I never focused on explicitly learning patterns; when you solve a lot of problems (and read discussions), you will learn patterns implicitly. I used to think in 2019 that leetcode problems are difficult and I do not have enough time. To counter this, I made a habit of spending at least 30 minutes a day on leetcode ("Little drops make the mighty ocean").
Wow
hard work and consistency wins everything else. You have a PhD, you definitely have a discipline that most people can’t even imagine.
Thank you so much
For Dijsktra/MST, I suggest learning Prim's algorithm as well, its 2 line code change from Dijsktra, and really hones in on helping you understand why such algorithms work
> 5. Recursion w/ memoization > 9. DP using table instead of recursion to save memory space These are the same thing
No the tabular method is iterative instead of recursive. In some problems when using tabular method you don’t need past sub problems so you don’t have to memoize all the subproblems. You only need to save the previous step. That’s the space optimization I meant. O(1) space Meanwhile if you solve using recursion, the stack size will be taking space O(recursion depth) ie O(n) most likely space.
I think Google knows, he's just saying that it's all DP. Listing it as "top-down and bottom-up DP" would've done the trick. Google just needs to use his words :)
🔥