Skip to content

Latest commit

 

History

History
78 lines (61 loc) · 3.13 KB

File metadata and controls

78 lines (61 loc) · 3.13 KB

LeetCode Interview Prep — 8-Week Learning Plan

Current State

  • 250+ problems solved in Java, strongest in Tree (87) and DP (24)
  • Weak areas: Graph, Greedy, Sliding Window, Trie, Topological Sort, Union Find (1-2 each)

Phase 1: Strengthen Foundations (Week 1-2)

Topic Target Focus
Array/Two Pointers +10 Prefix sum, in-place ops, 3Sum variants
Hash Table +8 Frequency maps, grouping, two-sum variants
String +8 Substring problems, palindromes, parsing
Sliding Window +8 Fixed/variable window, min/max substring
Stack/Queue +6 Monotonic stack, next greater element, calculator

Phase 2: Core Algorithms (Week 3-4)

Topic Target Focus
Binary Search +6 Search on answer, rotated array, matrix search
Sorting +6 Custom comparators, merge sort apps, bucket sort
Greedy +8 Intervals, jump game, task scheduler
Backtracking +8 Permutations, combinations, constraint satisfaction
Recursion +4 Divide and conquer, memoization bridge to DP

Phase 3: Advanced Data Structures (Week 5-6)

Topic Target Focus
Graph +10 BFS/DFS on grid, shortest path (Dijkstra, BFS), cycle detection
Trie +5 Word search II, autocomplete, prefix matching
Union Find +5 Connected components, accounts merge, redundant connection
Heap +5 Top-K, median stream, merge K sorted lists
Topological Sort +4 Course schedule, alien dictionary, build order

Phase 4: Hard Problems & Patterns (Week 7-8)

Topic Target Focus
Dynamic Programming +10 Knapsack, interval DP, bitmask DP, string DP
Segment Tree/BIT +4 Range query, range update
Design +5 LRU/LFU cache, iterator, rate limiter
Combination/Mock Mixed topic practice, timed sessions

Weekly Routine

Day Activity Time
Mon-Fri 2-3 new problems (topic of the week) 1.5-2 hr
Sat Review wrong/slow problems from the week 1 hr
Sun 1 timed mock interview (2 problems, 45 min) 1 hr

Per-Problem Workflow

  1. Read — understand constraints, edge cases (3 min)
  2. Plan — identify pattern, write approach in comments (5 min)
  3. Code — implement cleanly (15-20 min)
  4. Test — dry run with examples + edge cases (5 min)
  5. Optimize — can you improve time/space? (5 min)
  6. If stuck >25 min — read hint/solution, then re-implement from scratch

Key Patterns to Master

  1. Sliding Window — variable/fixed size
  2. Two Pointers — same/opposite direction
  3. BFS/DFS — trees, graphs, grids, backtracking
  4. Binary Search on Answer — min of max, max of min
  5. Monotonic Stack — next greater/smaller
  6. Union Find — dynamic connectivity
  7. DP State Design — what defines a subproblem?
  8. Topological Sort — dependency ordering
  9. Interval Merge/Sweep Line — overlapping ranges
  10. Prefix Sum/Diff Array — range queries in O(1)