LeetCode Compilation

My qualifications: I have solved 600+ and counting problems under my LeetCode account. At the ~450 mark in summer ’21, I aced my coding interviews to help land a full-time mid-level ML engineer position at a top tech company out of college (higher TC than average Google L4).

My advice for beginners: You only need ~=200 quality solves to pass most interviews, so with discipline, it is not difficult. Going through common problem themes and motifs one by one is more efficient than randomly solving problems, and the problem compilations I did during college were tremendously helpful. I started with these lists: 1, 2, 3. Then I solved curated LeetCode lists like Top 100 Liked and Algo 170 twice while refreshing my knowledge on topics along the way. I recommend doing the same (or similar), and you will be more than ready when you finish.

For video solutions, I love Hua Hua‘s videos if you can understand Chinese (though they’re many English channels run by Indian YouTubers that equally suffice). I also made a GitHub repo for generating automatic test cases to test on LeetCode’s interface. You can customize it to make LeetCoding more efficient.

These are some problems I found that I think were more instructive than average, grouped by common themes or motifs. The parentheses are meant to amuse and not be hints. Good luck!

Linked List

141. Linked List Cycle (cute)


271. Encode and Decode Strings (creative)

418. Sentence Screen Fitting (into the weeds)

2132. Stamping the Grid (knowledge of 304 is a must)


363. Max Sum of Rectangle No Larger Than K (dp with a twist)

2033. Minimum Operations to Make a Uni-Value Grid (has a useful fact)

Stack/Priority queue

294. Basic Calculator (also 227, and 772 since I like to suffer)

659. Split Array into Consecutive Subsequences (should be hard)


297. Serialize and Deserialize Binary Tree (ultimate dfs for trees)

742. Closest Leaf in a Binary Tree (def not a normal tree med)

1245. Tree Diameter (learn a bfs tree fact)


694. Number of Distinct Islands (instructive dfs)

293. Shortest Path in a Grid with Obstacles Elimination (dijkstra)

317. Shortest Distance from All Buildings (don’t overthink…)

934. Shortest Bridge (do you understand dijkstra?)

1192. Critical Connections in a Network (important concept for dealing with cycles)

Two Pointers

442. Trapping Rain Water (awesome)

27. Minimum Window Subsequence (instructive)

Binary Search

4. Median of Two Sorted Arrays (worth the suffering)


51. N-Queens (good to know 46 first)

267. Palindrome Permutations II (get 46 first)

465. Optimal Account Balancing (implementation practice)


84. Largest Rectangle in Histogram (practice your visualization)

85. Maximal Rectangle (do this after 84)

312. Burst Balloons (reverse thinking)

354. Russian Doll Envelopes (know your 300. first)

370. Range Addition (dumb but smart)

1416. Restore The Array (death to corner cases)

1444. Number of Ways of Cutting a Pizza (dp for helping to count)


751. IP to CIDR (a little sadistic, but worth it)

1538. Guess the Majority in a Hidden Array (*head slamming*)

%d bloggers like this: