Skip to main content

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
  1. 01Two Pointers pattern with 3 variations
  2. 02Sliding Window fixed and dynamic templates
  3. 03Binary Search on arrays and answer space
  4. 04BFS/DFS for trees and graphs
  5. 05Dynamic Programming top-down and bottom-up
  6. 06Backtracking with pruning techniques
  7. 07Heap operations and use cases
  8. 08Stack for monotonic and matching problems
  9. 09Linked List in-place manipulation
  10. 10Interval merge and overlap techniques
  11. 11Greedy choice property identification
  12. 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