DSA
The 14 coding interview patterns in JavaScript and Java, with templates, dry runs, variants, pitfalls, and a playbook for recognizing which pattern to use.
Start here for pattern-based DSA prep: sliding window, two pointers, intervals, linked lists, trees, heaps, subsets, binary search, and topological sort. Based on the dsa-patterns repository, expanded with reusable templates, worked dry runs, extra problem variants, and common bugs. Every pattern has runnable JavaScript and Java code, and every snippet was executed against test cases. The original repository also has Python versions. When you want problems to practice on, the LeetCode 30-Day Plan lists 150 problems grouped by pattern, with direct LeetCode links.
- 01Pattern Playbook
How to recognize the right DSA pattern, an interview framework, complexity cheat sheets, extra patterns beyond the 14, JavaScript and Java gotchas, and a practice roadmap.
Table of Contents1. Recognition Table2. A Decision Flow for Unknown Problems3. The Interview Framework4. Constraints Tell You the Complexity5. Complexity Cheat Sheet6. Patterns Beyond the 147. Combining Patterns8. JavaScript Gotchas That Break Solutions9. Java Collections Cheat Sheet10. Java Costs and Traps11. A Reusable Java Interview Template+3 more - 02Patterns: Arrays, Strings and Linked Lists
Sliding window, two pointers, fast and slow pointers, merge intervals, cyclic sort, and in-place linked list reversal with templates, dry runs, variants, and Java implementations.
- 03Patterns: Trees, Heaps, Search and Graphs
Tree BFS and DFS, two heaps, subsets and backtracking, modified binary search, top K, K-way merge, and topological sort with templates, dry runs, variants, and Java implementations.
- 04LeetCode 30-Day Plan
A 30-day, five-problems-a-day LeetCode revision plan grouped by pattern, with direct problem links, difficulty tags, and pointers to the matching pattern notes.