Free preview · 3 excerpts
DSA Pattern Cheat Sheet
Quick reference for 12 essential coding patterns.
View full resource outline (PDF unavailable here)
This 8-page cheat sheet covers all the essential patterns you need for coding interviews. Each pattern includes when to use it, the template code, time/space complexity, and common problems that use the pattern.
Original outline: PDF · 8 pages
Resource outline
12 items- 01Two Pointers pattern with 3 variations
- 02Sliding Window fixed and dynamic templates
- 03Binary Search on arrays and answer space
- 04BFS/DFS for trees and graphs
- 05Dynamic Programming top-down and bottom-up
- 06Backtracking with pruning techniques
- 07Heap operations and use cases
- 08Stack for monotonic and matching problems
- 09Linked List in-place manipulation
- 10Interval merge and overlap techniques
- 11Greedy choice property identification
- 12Trie implementation and applications
Preview
3 of 12- Two Pointers: Use when dealing with sorted arrays or when you need to find pairs. Time: O(n), Space: O(1)
- Sliding Window: Use for subarray/substring problems with a constraint. Time: O(n), Space: O(k)
- Binary Search: Use when search space is sorted or monotonic. Time: O(log n), Space: O(1)
- ... and 9 more sections
Save or print the preview shown above. This export contains the preview only, not the full PDF.
View text version
DSA Pattern Cheat Sheet Preview only — not the full PDF Two Pointers: Use when dealing with sorted arrays or when you need to find pairs. Time: O(n), Space: O(1) Sliding Window: Use for subarray/substring problems with a constraint. Time: O(n), Space: O(k) Binary Search: Use when search space is sorted or monotonic. Time: O(log n), Space: O(1)