Shelf · DSA Patterns

DSA Patterns

Patterns and recognition tricks only. No problems or solutions here; practise in your DSA book.

Problems and solutions live in your existing DSA book. This book is patterns only.

9 chapters · 54 cards · 9 chapters written · #6 in your reading order

Difficulty
Priority
  1. Clarify the input and output contractEasyP1Know cold
  2. Sequence signals and competing patternsMediumP2Know cold
  3. Search, rank and frontier signalsMediumP2Know cold
  4. Dependency and repeated-state signalsMediumP3Talk about it
  5. Translate constraints into feasible complexityMediumP1Know cold
  6. State and challenge the invariantMediumP2Know cold
Difficulty
Priority
  1. Complexity and amortizationMediumP1Know cold
  2. Derive cost from work rather than indentationMediumP1Know cold
  3. Read the common-complexity tableEasyP1Know cold
  4. Account for auxiliary and output spaceMediumP2Know cold
  5. Count recursive calls and stack depth separatelyMediumP2Know cold
  6. Know when quadratic work is acceptableEasyP2Talk about it
Difficulty
Priority
  1. Arrays and dynamic-array operation costsEasyP1Know cold
  2. Hash maps and sets under stated assumptionsEasyP1Know cold
  3. Stacks, queues and dequesEasyP1Know cold
  4. Heaps as partial orderMediumP2Know cold
  5. Trees and tries by key structureMediumP2Talk about it
  6. Graphs, union-find and the which-one tableMediumP3Talk about it
Difficulty
Priority
  1. Two pointers and safe in-place movementMediumP2Know cold
  2. Fixed sliding windowsEasyP2Know cold
  3. Variable sliding windowsMediumP2Know cold
  4. Prefix sums and range accountingMediumP2Know cold
  5. Fast and slow pointer invariantsMediumP2Know cold
  6. Merge intervals and cyclic sort prerequisitesMediumP2Know cold
Difficulty
Priority
  1. Binary search with a boundary invariantMediumP2Know cold
  2. Binary search on the answerHardP3Know cold
  3. Sort then scan without losing the contractMediumP2Know cold
  4. Top-K with bounded heapsMediumP2Know cold
  5. Quickselect as rank partitioningHardP4Talk about it
  6. Monotonic stacks and queuesMediumP3Know cold
Difficulty
Priority
  1. DFS templates and traversal stateMediumP2Know cold
  2. BFS, level-order and grid traversalMediumP2Know cold
  3. Backtracking with reversible stateMediumP3Know cold
  4. Topological sort and dependency cyclesMediumP3Know cold
  5. Union-find for changing connectivityMediumP3Talk about it
  6. Dijkstra with explicit heap assumptionsHardP3Talk about it
Difficulty
Priority
  1. Define a sufficient DP stateHardP3Know cold
  2. Derive recurrence and dependency orderHardP3Know cold
  3. Memoization versus tabulation in 1D and 2DMediumP3Know cold
  4. Recognize the knapsack familyHardP3Talk about it
  5. LIS and string DP state familiesHardP3Talk about it
  6. Space optimization without losing dependenciesHardP4Talk about it
Difficulty
Priority
  1. A minute-by-minute coding-round protocolEasyP5Know it exists
  2. Think aloud at decision pointsEasyP2Talk about it
  3. Dry-run on paper with a state ledgerMediumP2Know cold
  4. Test your own implementationMediumP1Know cold
  5. Recover when stuck without bluffingMediumP2Talk about it
  6. Python-specific interview mechanicsMediumP2Know cold
Difficulty
Priority
  1. Pattern practice systemEasyP5Know it exists
  2. Spaced recall with adjustable intervalsEasyP5Know it exists
  3. Mix patterns to test recognitionMediumP5Know it exists
  4. A self-assessment rubric with evidenceEasyP5Know it exists
  5. Log a solved problem so learning compoundsEasyP5Know it exists
  6. Review the rotation and choose the next repairMediumP5Know it exists