DSA Bootcamp — JavaScript Edition
12 Weeks.
28 patterns. 198 problems.
00
Study methodology
Phase 1 — Day 0
Learn
30–60 min per problem
- Read problem carefully (5 min)
- Try to solve WITHOUT hints (15–20 min max)
- If stuck, read ONE approach (5 min)
- Code the solution yourself (10–15 min)
- Test with examples (5 min)
- Mark: ✅ solved alone, ⚠️ needed help
Phase 2 — Next Day
Review
15–30 min per problem
- Solve WITHOUT looking at code
- If can't remember, quick peek at notes only
- Must code from scratch
- If easy → Mark ✓✓ mastered
- If struggled → Mark ⚠️ review again
Phase 3 — After 1 Week
Reinforce
10–20 min per problem
- Solve from scratch, zero hints
- Should finish in under 15 min
- If smooth → Mark ✓✓✓ pattern mastered
- If struggled → Repeat in 3 days
Do
- Read ONE pattern explanation (15 min max)
- Copy template to notes, then solve
- Document each pattern in your own words
- Solve 1 easy first, then 2–3 mediums
- Write solutions in plain JavaScript
Don't
- Watch long explanation videos
- Take extensive notes instead of coding
- Read multiple explanations for one pattern
- Skip the spaced repetition reviews
- Move on if Phase 1 was ⚠️ on everything
01
Time schedule
Daily split
Morning (university pace)1.5 hrs — new problems
Evening (university pace)0.5–1 hr — review
Morning (summer)4 hrs — new problems
Afternoon (summer)3 hrs — more problems
Evening (summer)1–2 hrs — review
Weekly structure
Days 1–5New patterns + problems
Day 6Review ALL week (Phase 2)
Day 7Mock interview + reflection
End of Week 4/8/12Full month review
ImportantFollow order, not day numbers
02
Weeks 1–2 — Arrays & Two Pointers
31 problemsWeek 1 · Days 1–5
Two Pointers (Opposite Direction)
Days 1–2
JS Template
let left = 0, right = arr.length - 1;
while (left < right) {
if (condition) return result;
else if (sum > target) right--;
else left++;
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 1 | LC-167 Two Sum II | Easy | Day 1 | Day 2 | Day 8 |
| 2 | LC-125 Valid Palindrome | Easy | Day 1 | Day 2 | Day 8 |
| 3 | LC-26 Remove Duplicates | Easy | Day 1 | Day 2 | Day 8 |
| 4 | LC-283 Move Zeroes | Easy | Day 1 | Day 2 | Day 8 |
| 5 | LC-977 Squares of Sorted Array | Easy | Day 2 | Day 3 | Day 9 |
| 6 | LC-15 3Sum ⭐⭐⭐ | Medium | Day 2 | Day 3 | Day 9 |
| 7 | LC-16 3Sum Closest | Medium | Day 2 | Day 3 | Day 9 |
| 8 | LC-11 Container With Water ⭐⭐ | Medium | Day 2 | Day 3 | Day 9 |
Prefix Sum
Days 3–4
JS Template
const prefix = new Array(n + 1).fill(0);
for (let i = 0; i < n; i++) prefix[i+1] = prefix[i] + arr[i];
// Range sum [l, r]: prefix[r+1] - prefix[l]
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 9 | LC-303 Range Sum Query | Easy | Day 3 | Day 4 | Day 10 |
| 10 | LC-724 Find Pivot Index | Easy | Day 3 | Day 4 | Day 10 |
| 11 | LC-238 Product Except Self ⭐⭐⭐ | Medium | Day 3 | Day 4 | Day 10 |
| 12 | LC-560 Subarray Sum = K ⭐⭐⭐ | Medium | Day 4 | Day 5 | Day 11 |
| 13 | LC-523 Continuous Subarray Sum | Medium | Day 4 | Day 5 | Day 11 |
| 14 | LC-974 Subarray Sum Divisible K | Medium | Day 4 | Day 5 | Day 11 |
Kadane's Algorithm
Day 5
JS Template
let maxSum = arr[0], curr = arr[0];
for (let i = 1; i < arr.length; i++) {
curr = Math.max(arr[i], curr + arr[i]);
maxSum = Math.max(maxSum, curr);
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 15 | LC-53 Maximum Subarray ⭐⭐ | Easy | Day 5 | Day 6 | Day 12 |
| 16 | LC-152 Maximum Product Subarray | Medium | Day 5 | Day 6 | Day 12 |
| 17 | LC-121 Best Time Buy/Sell Stock | Easy | Day 5 | Day 6 | Day 12 |
Review Day — Day 6
Re-solve all 17 problems (Phase 2)
Easy problems: under 15 min. Medium problems: under 25 min. Mark anything you struggled with for extra review.
Mock Interview — Day 7
3 problems in 65 minutes
1 Easy (10 min) + 1 Medium (25 min) + 1 Medium (30 min) — all random from problems 1–17.
Week 2 · Days 8–14
Sliding Window — Fixed Size
Days 8–9
JS Template
let windowSum = arr.slice(0, k).reduce((a, b) => a + b, 0);
let maxSum = windowSum;
for (let i = k; i < arr.length; i++) {
windowSum += arr[i] - arr[i - k];
maxSum = Math.max(maxSum, windowSum);
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 18 | LC-643 Max Average Subarray | Easy | Day 8 | Day 9 | Day 15 |
| 19 | LC-1004 Max Consecutive Ones III | Medium | Day 8 | Day 9 | Day 15 |
| 20 | LC-438 Find All Anagrams ⭐⭐ | Medium | Day 9 | Day 10 | Day 16 |
| 21 | LC-567 Permutation in String | Medium | Day 9 | Day 10 | Day 16 |
| 22 | LC-1456 Max Vowels in Substring | Medium | Day 9 | Day 10 | Day 16 |
Sliding Window — Variable Size
Days 10–11
JS Template
let left = 0;
for (let right = 0; right < arr.length; right++) {
// add arr[right] to window
while (/* window invalid */) {
// remove arr[left]
left++;
}
// update result
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 23 | LC-3 Longest Substring No Repeat ⭐⭐⭐ | Medium | Day 10 | Day 11 | Day 17 |
| 24 | LC-209 Min Size Subarray Sum ⭐⭐ | Medium | Day 10 | Day 11 | Day 17 |
| 25 | LC-340 At Most K Distinct Chars | Medium | Day 10 | Day 11 | Day 17 |
| 26 | LC-904 Fruit Into Baskets | Medium | Day 11 | Day 12 | Day 18 |
| 27 | LC-424 Longest Repeating Char ⭐⭐ | Medium | Day 11 | Day 12 | Day 18 |
| 28 | LC-76 Minimum Window Substring ⭐⭐⭐ | Hard | Day 11 | Day 12 | Day 18 |
Two Pointers — Hard Problems
Day 12
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 29 | LC-42 Trapping Rain Water ⭐⭐⭐ | Hard | Day 12 | Day 13 | Day 19 |
| 30 | LC-18 4Sum | Medium | Day 12 | Day 13 | Day 19 |
| 31 | LC-75 Sort Colors (Dutch Flag) ⭐⭐ | Medium | Day 12 | Day 13 | Day 19 |
Review — Day 13
Review all 31 problems (Week 1: Phase 3 / Week 2: Phase 2)
Focus on ⚠️ problems. Create your pattern cheat sheet.
Mock Interview — Day 14
3 problems in 75 minutes + reflection
Which patterns do you know well? Which need more work? Are you hitting time limits?
03
Weeks 3–4 — Hashing, Intervals & Sorting
32 problemsWeek 3 · Days 15–21
HashMap — Frequency Counting
Days 15–16
JS Template
const freq = {};
for (const item of arr) freq[item] = (freq[item] || 0) + 1;
// Or use Map:
const map = new Map();
for (const item of arr) map.set(item, (map.get(item) || 0) + 1);
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 32 | LC-1 Two Sum ⭐⭐⭐ | Easy | Day 15 | Day 16 | Day 22 |
| 33 | LC-217 Contains Duplicate | Easy | Day 15 | Day 16 | Day 22 |
| 34 | LC-242 Valid Anagram | Easy | Day 15 | Day 16 | Day 22 |
| 35 | LC-49 Group Anagrams ⭐⭐ | Medium | Day 15 | Day 16 | Day 22 |
| 36 | LC-347 Top K Frequent Elements ⭐⭐ | Medium | Day 16 | Day 17 | Day 23 |
| 37 | LC-451 Sort Chars by Frequency | Medium | Day 16 | Day 17 | Day 23 |
| 38 | LC-128 Longest Consecutive ⭐⭐⭐ | Medium | Day 16 | Day 17 | Day 23 |
Merge Intervals ✨ NEW
Days 17–18
JS Template
intervals.sort((a, b) => a[0] - b[0]);
const merged = [intervals[0]];
for (const curr of intervals.slice(1)) {
if (curr[0] <= merged[merged.length-1][1])
merged[merged.length-1][1] = Math.max(merged[merged.length-1][1], curr[1]);
else merged.push(curr);
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 39 | LC-56 Merge Intervals ⭐⭐⭐ | Medium | Day 17 | Day 18 | Day 24 |
| 40 | LC-57 Insert Interval ⭐⭐ | Medium | Day 17 | Day 18 | Day 24 |
| 41 | LC-252 Meeting Rooms | Easy | Day 17 | Day 18 | Day 24 |
| 42 | LC-253 Meeting Rooms II ⭐⭐⭐ | Medium | Day 18 | Day 19 | Day 25 |
| 43 | LC-986 Interval List Intersection | Medium | Day 18 | Day 19 | Day 25 |
| 44 | LC-435 Non-overlapping Intervals ⭐⭐ | Medium | Day 18 | Day 19 | Day 25 |
| 45 | LC-759 Employee Free Time | Hard | Day 18 | Day 19 | Day 25 |
HashSet Advanced
Day 19
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 46 | LC-202 Happy Number | Easy | Day 19 | Day 20 | Day 26 |
| 47 | LC-136 Single Number (XOR) | Easy | Day 19 | Day 20 | Day 26 |
| 48 | LC-349 Intersection of Arrays | Easy | Day 19 | Day 20 | Day 26 |
Review — Day 20
Review all Week 3 problems (Phase 2)
Mock Interview — Day 21
3 problems in 75 minutes
Week 4 · Days 22–28
Cyclic Sort ✨ NEW
Days 22–23
JS Template
let i = 0;
while (i < arr.length) {
const correctIdx = arr[i] - 1;
if (arr[i] !== arr[correctIdx]) {
[arr[i], arr[correctIdx]] = [arr[correctIdx], arr[i]];
} else i++;
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 49 | LC-268 Missing Number | Easy | Day 22 | Day 23 | Day 29 |
| 50 | LC-448 Find All Missing Numbers | Easy | Day 22 | Day 23 | Day 29 |
| 51 | LC-287 Find Duplicate Number ⭐⭐ | Medium | Day 22 | Day 23 | Day 29 |
| 52 | LC-442 Find All Duplicates | Medium | Day 23 | Day 24 | Day 30 |
| 53 | LC-645 Set Mismatch | Easy | Day 23 | Day 24 | Day 30 |
| 54 | LC-41 First Missing Positive | Hard | Day 23 | Day 24 | Day 30 |
Bitwise XOR ✨ NEW
Days 24–25
JS Template — XOR properties: a ^ a = 0, a ^ 0 = a
let result = 0;
for (const num of nums) result ^= num;
// result = the unique number
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 55 | LC-136 Single Number | Easy | Day 24 | Day 25 | Day 31 |
| 56 | LC-260 Single Number III | Medium | Day 24 | Day 25 | Day 31 |
| 57 | LC-476 Number Complement | Easy | Day 25 | Day 26 | Day 32 |
| 58 | LC-832 Flipping an Image | Easy | Day 25 | Day 26 | Day 32 |
Modified Binary Search
Day 26
JS Template
let left = 0, right = arr.length - 1;
while (left <= right) {
const mid = left + Math.floor((right - left) / 2);
if (arr[mid] === target) return mid;
else if (arr[mid] < target) left = mid + 1;
else right = mid - 1;
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 59 | LC-704 Binary Search | Easy | Day 26 | Day 27 | Day 33 |
| 60 | LC-34 Find First & Last Position ⭐⭐ | Medium | Day 26 | Day 27 | Day 33 |
| 61 | LC-33 Search Rotated Array ⭐⭐⭐ | Medium | Day 26 | Day 27 | Day 33 |
| 62 | LC-153 Find Min Rotated Array | Medium | Day 26 | Day 27 | Day 33 |
| 63 | LC-162 Find Peak Element | Medium | Day 26 | Day 27 | Day 33 |
Review — Day 27
Review all Week 3–4 problems
Mock Interview + Month 1 Review — Day 28
4 problems in 90 min + 10 random problems from Weeks 1–4
04
Weeks 5–6 — Linked Lists, Stacks & Heaps
34 problemsWeek 5 · Days 29–35
Fast & Slow Pointers (Floyd's Cycle)
Days 29–30
JS Template
let slow = head, fast = head;
while (fast && fast.next) {
slow = slow.next;
fast = fast.next.next;
if (slow === fast) break; // cycle detected
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 64 | LC-141 Linked List Cycle ⭐⭐⭐ | Easy | Day 29 | Day 30 | Day 36 |
| 65 | LC-142 Cycle Start ⭐⭐ | Medium | Day 29 | Day 30 | Day 36 |
| 66 | LC-876 Middle of Linked List | Easy | Day 29 | Day 30 | Day 36 |
| 67 | LC-234 Palindrome Linked List ⭐⭐ | Easy | Day 30 | Day 31 | Day 37 |
| 68 | LC-143 Reorder List ⭐⭐ | Medium | Day 30 | Day 31 | Day 37 |
| 69 | LC-202 Happy Number | Easy | Day 30 | Day 31 | Day 37 |
Linked List Reversal
Days 31–32
JS Template
let prev = null, curr = head;
while (curr) {
const next = curr.next;
curr.next = prev;
prev = curr;
curr = next;
}
return prev;
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 70 | LC-206 Reverse Linked List ⭐⭐⭐ | Easy | Day 31 | Day 32 | Day 38 |
| 71 | LC-92 Reverse Between ⭐⭐ | Medium | Day 31 | Day 32 | Day 38 |
| 72 | LC-25 Reverse K Group ⭐⭐⭐ | Hard | Day 32 | Day 33 | Day 39 |
| 73 | LC-61 Rotate List | Medium | Day 32 | Day 33 | Day 39 |
| 74 | LC-24 Swap Nodes in Pairs | Medium | Day 32 | Day 33 | Day 39 |
Linked List — Misc
Day 33
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 75 | LC-21 Merge Two Sorted Lists ⭐⭐ | Easy | Day 33 | Day 34 | Day 40 |
| 76 | LC-2 Add Two Numbers ⭐⭐ | Medium | Day 33 | Day 34 | Day 40 |
| 77 | LC-19 Remove Nth from End ⭐⭐ | Medium | Day 33 | Day 34 | Day 40 |
| 78 | LC-138 Copy List Random Pointer | Medium | Day 33 | Day 34 | Day 40 |
Review — Day 34
Review all Week 5 problems
Mock Interview — Day 35
3 linked list problems in 75 minutes
Week 6 · Days 36–43
Stack Basics
Days 36–37
JS Template
const stack = [];
stack.push(item); // push
const top = stack.pop(); // pop
const peek = stack[stack.length - 1]; // top without removing
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 79 | LC-20 Valid Parentheses ⭐⭐⭐ | Easy | Day 36 | Day 37 | Day 43 |
| 80 | LC-155 Min Stack ⭐⭐ | Easy | Day 36 | Day 37 | Day 43 |
| 81 | LC-150 Evaluate RPN | Medium | Day 36 | Day 37 | Day 43 |
| 82 | LC-71 Simplify Path | Medium | Day 37 | Day 38 | Day 44 |
| 83 | LC-394 Decode String ⭐⭐ | Medium | Day 37 | Day 38 | Day 44 |
| 84 | LC-232 Queue using Stacks | Easy | Day 37 | Day 38 | Day 44 |
Monotonic Stack
Days 38–39
JS Template
const stack = []; // stores indices
for (let i = 0; i < arr.length; i++) {
while (stack.length && arr[stack[stack.length-1]] < arr[i]) {
const idx = stack.pop();
result[idx] = arr[i]; // next greater element
}
stack.push(i);
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 85 | LC-496 Next Greater Element I | Easy | Day 38 | Day 39 | Day 45 |
| 86 | LC-503 Next Greater Element II | Medium | Day 38 | Day 39 | Day 45 |
| 87 | LC-739 Daily Temperatures ⭐⭐⭐ | Medium | Day 38 | Day 39 | Day 45 |
| 88 | LC-84 Largest Rectangle ⭐⭐⭐ | Hard | Day 39 | Day 40 | Day 46 |
| 89 | LC-85 Maximal Rectangle | Hard | Day 39 | Day 40 | Day 46 |
| 90 | LC-42 Trapping Rain (Stack) ⭐⭐⭐ | Hard | Day 39 | Day 40 | Day 46 |
Two Heaps ✨ NEW — For Median
Day 40
JS Concept — Use a heap library or implement MinHeap/MaxHeap
// maxHeap = left half (negate values for max behavior)
// minHeap = right half
// Invariant: maxHeap.size >= minHeap.size, maxHeap.top <= minHeap.top
// Median = maxHeap.top (odd) or avg of both tops (even)
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 91 | LC-295 Find Median Stream ⭐⭐⭐ | Hard | Day 40 | Day 41 | Day 47 |
| 92 | LC-480 Sliding Window Median | Hard | Day 40 | Day 41 | Day 47 |
Heap / Priority Queue
Day 41
JS Note — No built-in heap. Use a MinHeap class or sort-based approach for LeetCode.
// Minimal MinHeap for LeetCode JS:
class MinHeap {
constructor(comparator = (a,b) => a - b) { this.h = []; this.cmp = comparator; }
push(v) { this.h.push(v); this._up(this.h.length-1); }
pop() { const top=this.h[0]; this.h[0]=this.h.pop(); this._down(0); return top; }
peek() { return this.h[0]; }
size() { return this.h.length; }
_up(i) { while(i>0){const p=(i-1)>>1;if(this.cmp(this.h[i],this.h[p])>=0)break;[this.h[i],this.h[p]]=[this.h[p],this.h[i]];i=p;} }
_down(i) { const n=this.h.length;while(true){let s=i,l=2*i+1,r=2*i+2;if(l<n&&this.cmp(this.h[l],this.h[s])<0)s=l;if(r<n&&this.cmp(this.h[r],this.h[s])<0)s=r;if(s===i)break;[this.h[i],this.h[s]]=[this.h[s],this.h[i]];i=s;} }
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 93 | LC-215 Kth Largest Element ⭐⭐⭐ | Medium | Day 41 | Day 42 | Day 48 |
| 94 | LC-347 Top K Frequent (heap) ⭐⭐ | Medium | Day 41 | Day 42 | Day 48 |
| 95 | LC-23 Merge K Sorted Lists ⭐⭐⭐ | Hard | Day 41 | Day 42 | Day 48 |
| 96 | LC-373 Find K Pairs Smallest Sums | Medium | Day 41 | Day 42 | Day 48 |
| 97 | LC-378 Kth Smallest in Matrix | Medium | Day 41 | Day 42 | Day 48 |
Review — Day 42
Review all Week 5–6 problems
Mock Interview + Month 2 Review — Day 43
4 problems + 15 random from Weeks 1–6
05
Weeks 7–8 — Trees & Backtracking
40 problemsWeek 7 · Days 44–50
Tree DFS
Days 44–45
JS Template
function dfs(node) {
if (!node) return baseCase;
const left = dfs(node.left);
const right = dfs(node.right);
return combine(node.val, left, right);
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 98 | LC-104 Max Depth ⭐⭐⭐ | Easy | Day 44 | Day 45 | Day 51 |
| 99 | LC-111 Min Depth | Easy | Day 44 | Day 45 | Day 51 |
| 100 | LC-100 Same Tree | Easy | Day 44 | Day 45 | Day 51 |
| 101 | LC-101 Symmetric Tree | Easy | Day 44 | Day 45 | Day 51 |
| 102 | LC-226 Invert Tree ⭐⭐ | Easy | Day 44 | Day 45 | Day 51 |
| 103 | LC-112 Path Sum ⭐⭐ | Easy | Day 45 | Day 46 | Day 52 |
| 104 | LC-113 Path Sum II | Medium | Day 45 | Day 46 | Day 52 |
| 105 | LC-257 Binary Tree Paths | Easy | Day 45 | Day 46 | Day 52 |
| 106 | LC-543 Diameter of Tree ⭐⭐⭐ | Easy | Day 45 | Day 46 | Day 52 |
| 107 | LC-124 Binary Tree Max Path ⭐⭐⭐ | Hard | Day 45 | Day 46 | Day 52 |
Tree BFS (Level Order)
Days 46–47
JS Template
const queue = [root];
while (queue.length) {
const levelSize = queue.length;
for (let i = 0; i < levelSize; i++) {
const node = queue.shift();
if (node.left) queue.push(node.left);
if (node.right) queue.push(node.right);
}
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 108 | LC-102 Level Order ⭐⭐⭐ | Medium | Day 46 | Day 47 | Day 53 |
| 109 | LC-107 Level Order Bottom | Medium | Day 46 | Day 47 | Day 53 |
| 110 | LC-103 Zigzag Level Order ⭐⭐ | Medium | Day 46 | Day 47 | Day 53 |
| 111 | LC-637 Average of Levels | Easy | Day 46 | Day 47 | Day 53 |
| 112 | LC-199 Right Side View ⭐⭐ | Medium | Day 47 | Day 48 | Day 54 |
| 113 | LC-515 Find Largest Value Row | Medium | Day 47 | Day 48 | Day 54 |
| 114 | LC-662 Max Width of Tree | Medium | Day 47 | Day 48 | Day 54 |
BST — Binary Search Tree
Day 48
JS Template
function validateBST(node, min = -Infinity, max = Infinity) {
if (!node) return true;
if (node.val <= min || node.val >= max) return false;
return validateBST(node.left, min, node.val) &&
validateBST(node.right, node.val, max);
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 115 | LC-98 Validate BST ⭐⭐⭐ | Medium | Day 48 | Day 49 | Day 55 |
| 116 | LC-700 Search in BST | Easy | Day 48 | Day 49 | Day 55 |
| 117 | LC-701 Insert into BST | Medium | Day 48 | Day 49 | Day 55 |
| 118 | LC-450 Delete Node BST | Medium | Day 48 | Day 49 | Day 55 |
| 119 | LC-230 Kth Smallest in BST ⭐⭐ | Medium | Day 48 | Day 49 | Day 55 |
| 120 | LC-235 LCA in BST ⭐⭐ | Easy | Day 48 | Day 49 | Day 55 |
Review — Day 49
Review Week 7 problems
Mock Interview — Day 50
3 tree problems in 75 minutes
Week 8 · Days 51–57
Backtracking — Subsets & Permutations
Days 51–54
JS Template
function backtrack(path, start) {
result.push([...path]);
for (let i = start; i < nums.length; i++) {
path.push(nums[i]);
backtrack(path, i + 1);
path.pop();
}
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 121 | LC-78 Subsets ⭐⭐⭐ | Medium | Day 51 | Day 52 | Day 58 |
| 122 | LC-90 Subsets II | Medium | Day 51 | Day 52 | Day 58 |
| 123 | LC-46 Permutations ⭐⭐⭐ | Medium | Day 51 | Day 52 | Day 58 |
| 124 | LC-47 Permutations II | Medium | Day 52 | Day 53 | Day 59 |
| 125 | LC-77 Combinations | Medium | Day 52 | Day 53 | Day 59 |
| 126 | LC-39 Combination Sum ⭐⭐ | Medium | Day 52 | Day 53 | Day 59 |
| 127 | LC-40 Combination Sum II | Medium | Day 52 | Day 53 | Day 59 |
| 128 | LC-22 Generate Parentheses ⭐⭐⭐ | Medium | Day 53 | Day 54 | Day 60 |
| 129 | LC-17 Letter Combinations ⭐⭐ | Medium | Day 53 | Day 54 | Day 60 |
| 130 | LC-131 Palindrome Partitioning | Medium | Day 54 | Day 55 | Day 61 |
| 131 | LC-79 Word Search ⭐⭐⭐ | Medium | Day 54 | Day 55 | Day 61 |
| 132 | LC-51 N-Queens ⭐⭐⭐ | Hard | Day 54 | Day 55 | Day 61 |
| 133 | LC-37 Sudoku Solver | Hard | Day 54 | Day 55 | Day 61 |
Trie
Day 55
JS Template
class TrieNode { constructor() { this.children = {}; this.isEnd = false; } }
class Trie {
constructor() { this.root = new TrieNode(); }
insert(word) {
let node = this.root;
for (const ch of word) {
if (!node.children[ch]) node.children[ch] = new TrieNode();
node = node.children[ch];
}
node.isEnd = true;
}
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 134 | LC-208 Implement Trie ⭐⭐⭐ | Medium | Day 55 | Day 56 | Day 62 |
| 135 | LC-211 Add/Search Words | Medium | Day 55 | Day 56 | Day 62 |
| 136 | LC-212 Word Search II ⭐⭐⭐ | Hard | Day 55 | Day 56 | Day 62 |
| 137 | LC-1268 Search Suggestions | Medium | Day 55 | Day 56 | Day 62 |
Review — Day 56
Review all Week 7–8 problems
Mock Interview + Month 3 Review — Day 57
4 problems + 20 random from Weeks 1–8
06
Weeks 9–10 — Graphs & Greedy
33 problemsWeek 9 · Days 58–64
Graph DFS / BFS
Days 58–59
JS Templates
// DFS
const visited = new Set();
function dfs(node) {
if (visited.has(node)) return;
visited.add(node);
for (const neighbor of graph[node]) dfs(neighbor);
}
// BFS
const queue = [start], visited = new Set([start]);
while (queue.length) {
const node = queue.shift();
for (const neighbor of graph[node]) {
if (!visited.has(neighbor)) { visited.add(neighbor); queue.push(neighbor); }
}
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 138 | LC-200 Number of Islands ⭐⭐⭐ | Medium | Day 58 | Day 59 | Day 65 |
| 139 | LC-133 Clone Graph ⭐⭐ | Medium | Day 58 | Day 59 | Day 65 |
| 140 | LC-695 Max Area of Island | Medium | Day 58 | Day 59 | Day 65 |
| 141 | LC-733 Flood Fill | Easy | Day 58 | Day 59 | Day 65 |
| 142 | LC-463 Island Perimeter | Easy | Day 58 | Day 59 | Day 65 |
| 143 | LC-130 Surrounded Regions ⭐⭐ | Medium | Day 59 | Day 60 | Day 66 |
| 144 | LC-417 Pacific Atlantic ⭐⭐ | Medium | Day 59 | Day 60 | Day 66 |
| 145 | LC-994 Rotting Oranges ⭐⭐⭐ | Medium | Day 59 | Day 60 | Day 66 |
Union Find (Disjoint Set)
Days 60–61
JS Template
class UnionFind {
constructor(n) { this.parent = Array.from({length:n},(_,i)=>i); this.rank = new Array(n).fill(1); }
find(x) { if (this.parent[x]!==x) this.parent[x]=this.find(this.parent[x]); return this.parent[x]; }
union(x, y) {
const [px, py] = [this.find(x), this.find(y)];
if (px===py) return false;
if (this.rank[px] < this.rank[py]) this.parent[px]=py;
else if (this.rank[px] > this.rank[py]) this.parent[py]=px;
else { this.parent[py]=px; this.rank[px]++; }
return true;
}
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 146 | LC-547 Number of Provinces ⭐⭐ | Medium | Day 60 | Day 61 | Day 67 |
| 147 | LC-684 Redundant Connection ⭐⭐ | Medium | Day 60 | Day 61 | Day 67 |
| 148 | LC-685 Redundant Connection II | Hard | Day 60 | Day 61 | Day 67 |
| 149 | LC-721 Accounts Merge ⭐⭐ | Medium | Day 61 | Day 62 | Day 68 |
| 150 | LC-323 Connected Components | Medium | Day 61 | Day 62 | Day 68 |
| 151 | LC-1584 Min Cost Connect Points ⭐⭐ | Medium | Day 61 | Day 62 | Day 68 |
Topological Sort (Kahn's Algorithm)
Day 62
JS Template
function topoSort(n, edges) {
const graph = Array.from({length:n}, ()=>[]);
const inDegree = new Array(n).fill(0);
for (const [u,v] of edges) { graph[u].push(v); inDegree[v]++; }
const queue = [];
for (let i=0;i<n;i++) if(inDegree[i]===0) queue.push(i);
const result = [];
while (queue.length) {
const node = queue.shift(); result.push(node);
for (const nb of graph[node]) if(--inDegree[nb]===0) queue.push(nb);
}
return result.length===n ? result : [];
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 152 | LC-207 Course Schedule ⭐⭐⭐ | Medium | Day 62 | Day 63 | Day 69 |
| 153 | LC-210 Course Schedule II ⭐⭐⭐ | Medium | Day 62 | Day 63 | Day 69 |
| 154 | LC-269 Alien Dictionary ⭐⭐⭐ | Hard | Day 62 | Day 63 | Day 69 |
| 155 | LC-310 Minimum Height Trees | Medium | Day 62 | Day 63 | Day 69 |
Review — Day 63
Review Week 9 problems
Mock Interview — Day 64
3 graph problems in 75 minutes
Week 10 · Days 65–71
Dijkstra's Algorithm — Shortest Path
Days 65–66
JS Template — use MinHeap from Week 6
function dijkstra(graph, start) {
const dist = {};
for (const node in graph) dist[node] = Infinity;
dist[start] = 0;
const pq = new MinHeap((a,b)=>a[0]-b[0]);
pq.push([0, start]);
while (pq.size()) {
const [d, node] = pq.pop();
if (d > dist[node]) continue;
for (const [nb, w] of graph[node]) {
if (dist[node]+w < dist[nb]) { dist[nb]=dist[node]+w; pq.push([dist[nb],nb]); }
}
}
return dist;
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 156 | LC-743 Network Delay Time ⭐⭐ | Medium | Day 65 | Day 66 | Day 72 |
| 157 | LC-787 Cheapest Flights K Stops ⭐⭐ | Medium | Day 65 | Day 66 | Day 72 |
| 158 | LC-1091 Shortest Path Binary | Medium | Day 65 | Day 66 | Day 72 |
| 159 | LC-1514 Path Max Probability | Medium | Day 66 | Day 67 | Day 73 |
| 160 | LC-1631 Path Min Effort ⭐⭐ | Medium | Day 66 | Day 67 | Day 73 |
Greedy Algorithms ✨ NEW
Days 67–68
JS Template — Sort then choose greedily
// Common pattern: sort by end time, pick greedily
items.sort((a, b) => a[1] - b[1]);
for (const item of items) {
if (canTake(item)) take(item);
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 161 | LC-455 Assign Cookies | Easy | Day 67 | Day 68 | Day 74 |
| 162 | LC-122 Best Time Buy/Sell II ⭐⭐ | Easy | Day 67 | Day 68 | Day 74 |
| 163 | LC-55 Jump Game ⭐⭐⭐ | Medium | Day 67 | Day 68 | Day 74 |
| 164 | LC-45 Jump Game II ⭐⭐ | Medium | Day 68 | Day 69 | Day 75 |
| 165 | LC-134 Gas Station ⭐⭐⭐ | Medium | Day 68 | Day 69 | Day 75 |
| 166 | LC-135 Candy | Hard | Day 68 | Day 69 | Day 75 |
| 167 | LC-763 Partition Labels ⭐⭐ | Medium | Day 68 | Day 69 | Day 75 |
Advanced Graph
Day 69
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 168 | LC-127 Word Ladder ⭐⭐⭐ | Hard | Day 69 | Day 70 | Day 76 |
| 169 | LC-126 Word Ladder II | Hard | Day 69 | Day 70 | Day 76 |
| 170 | LC-1192 Critical Connections ⭐⭐⭐ | Hard | Day 69 | Day 70 | Day 76 |
Review — Day 70
Review all Week 9–10 problems
Mock Interview + Month 4 Review — Day 71
5 problems + 25 random from all weeks
07
Weeks 11–12 — Dynamic Programming
28 problemsWeek 11 · Days 72–78
1D Dynamic Programming
Days 72–73
JS Template — Bottom-up
const dp = new Array(n + 1).fill(0);
dp[0] = baseCase;
for (let i = 1; i <= n; i++) {
dp[i] = recurrence(dp[i-1], dp[i-2]); // adjust as needed
}
return dp[n];
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 171 | LC-70 Climbing Stairs ⭐⭐⭐ | Easy | Day 72 | Day 73 | Day 79 |
| 172 | LC-509 Fibonacci Number | Easy | Day 72 | Day 73 | Day 79 |
| 173 | LC-746 Min Cost Climbing Stairs | Easy | Day 72 | Day 73 | Day 79 |
| 174 | LC-198 House Robber ⭐⭐⭐ | Medium | Day 72 | Day 73 | Day 79 |
| 175 | LC-213 House Robber II ⭐⭐ | Medium | Day 73 | Day 74 | Day 80 |
| 176 | LC-91 Decode Ways ⭐⭐ | Medium | Day 73 | Day 74 | Day 80 |
| 177 | LC-322 Coin Change ⭐⭐⭐ | Medium | Day 73 | Day 74 | Day 80 |
| 178 | LC-518 Coin Change II | Medium | Day 73 | Day 74 | Day 80 |
| 179 | LC-300 Longest Increasing Subseq ⭐⭐⭐ | Medium | Day 73 | Day 74 | Day 80 |
2D DP — Grid & Subsequences
Days 74–75
JS Template
const dp = Array.from({length: m+1}, ()=>new Array(n+1).fill(0));
for (let i = 1; i <= m; i++) {
for (let j = 1; j <= n; j++) {
dp[i][j] = recurrence(dp[i-1][j], dp[i][j-1], dp[i-1][j-1]);
}
}
return dp[m][n];
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 180 | LC-62 Unique Paths ⭐⭐⭐ | Medium | Day 74 | Day 75 | Day 81 |
| 181 | LC-63 Unique Paths II | Medium | Day 74 | Day 75 | Day 81 |
| 182 | LC-64 Minimum Path Sum ⭐⭐ | Medium | Day 74 | Day 75 | Day 81 |
| 183 | LC-1143 Longest Common Subseq ⭐⭐⭐ | Medium | Day 75 | Day 76 | Day 82 |
| 184 | LC-72 Edit Distance ⭐⭐⭐ | Hard | Day 75 | Day 76 | Day 82 |
| 185 | LC-115 Distinct Subsequences | Hard | Day 75 | Day 76 | Day 82 |
| 186 | LC-221 Maximal Square ⭐⭐ | Medium | Day 75 | Day 76 | Day 82 |
0/1 Knapsack DP
Day 76
JS Template
const dp = new Array(capacity + 1).fill(0);
for (const [weight, value] of items) {
for (let w = capacity; w >= weight; w--) {
dp[w] = Math.max(dp[w], dp[w - weight] + value);
}
}
return dp[capacity];
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 187 | LC-416 Partition Equal Subset ⭐⭐⭐ | Medium | Day 76 | Day 77 | Day 83 |
| 188 | LC-494 Target Sum ⭐⭐ | Medium | Day 76 | Day 77 | Day 83 |
| 189 | LC-1049 Last Stone Weight II | Medium | Day 76 | Day 77 | Day 83 |
Review — Day 77
Review all Week 11 problems
Mock Interview — Day 78
3 DP problems in 75 minutes
Week 12 · Days 79–84
Palindromic DP
Days 79–80
JS Template
const dp = Array.from({length:n}, ()=>new Array(n).fill(false));
for (let i = 0; i < n; i++) dp[i][i] = true;
for (let len = 2; len <= n; len++) {
for (let i = 0; i <= n - len; i++) {
const j = i + len - 1;
if (s[i]===s[j] && (len===2 || dp[i+1][j-1])) dp[i][j] = true;
}
}
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 190 | LC-5 Longest Palindromic Substring ⭐⭐⭐ | Medium | Day 79 | Day 80 | Review |
| 191 | LC-647 Palindromic Substrings ⭐⭐ | Medium | Day 79 | Day 80 | Review |
| 192 | LC-516 Longest Palindromic Subseq | Medium | Day 79 | Day 80 | Review |
| 193 | LC-131 Palindrome Partitioning ⭐⭐ | Medium | Day 80 | Day 81 | Review |
| 194 | LC-132 Palindrome Partitioning II | Hard | Day 80 | Day 81 | Review |
Advanced DP
Day 81
| # | Problem | Difficulty | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|---|
| 195 | LC-139 Word Break ⭐⭐⭐ | Medium | Day 81 | Day 82 | Review |
| 196 | LC-140 Word Break II | Hard | Day 81 | Day 82 | Review |
| 197 | LC-152 Max Product Subarray ⭐⭐ | Medium | Day 81 | Day 82 | Review |
| 198 | LC-312 Burst Balloons ⭐⭐⭐ | Hard | Day 81 | Day 82 | Review |
Massive Review — Day 82
30 random problems from all 198 — no hints, under 15 min each
Final Mock Interview — Day 83
Real interview simulation: 4 problems in 90 minutes — 1 Easy (15m) + 2 Medium (30m each) + 1 Hard (45m)
Day 84 — Reflection
Review pattern cheat sheet · Identify weak areas · Plan continued practice
You have covered 28 patterns and 198 problems. You are ready for 95% of junior and mid-level backend interviews.
08
All 28 patterns
Arrays & Strings (Weeks 1–2)
- Two Pointers — Opposite Direction
- Two Pointers — Same Direction (Fast/Slow)
- Prefix Sum
- Kadane's Algorithm
- Sliding Window — Fixed Size
- Sliding Window — Variable Size
Hashing & Sorting (Weeks 3–4)
- HashMap — Frequency Counting
- HashMap — Subarray Problems
- Merge Intervals ✨ new
- Cyclic Sort ✨ new
- Bitwise XOR ✨ new
- Modified Binary Search
Linked Lists, Stacks, Heaps (Weeks 5–6)
- Fast & Slow Pointers (Floyd's Cycle)
- Linked List Reversal
- Stack — LIFO
- Monotonic Stack
- Two Heaps — For Median ✨ new
- Heap / Priority Queue
Trees & Backtracking (Weeks 7–8)
- Tree DFS (Pre/In/Postorder)
- Tree BFS (Level Order)
- BST Operations
- Backtracking — Subsets & Permutations
- Trie
Graphs (Weeks 9–10)
- Graph DFS / BFS
- Union Find (Disjoint Set)
- Topological Sort (Kahn's)
- Dijkstra's Shortest Path
- Greedy Algorithms ✨ new
Dynamic Programming (Weeks 11–12)
- 1D DP — Linear Recurrence
- 2D DP — Grid Problems
- DP on Subsequences (LCS)
- 0/1 Knapsack
- Palindromic Subsequence DP
09
Spaced repetition tracker format
Copy this format to a spreadsheet. One row per problem. Update after each phase.
| Problem | LC # | Pattern | Day 0 | Day 1 | Day 7 | Day 14 | Status |
|---|---|---|---|---|---|---|---|
| Two Sum II | 167 | Two Pointers | ✅ | ✓✓ | ✓✓✓ | — | Mastered |
| 3Sum | 15 | Two Pointers | ⚠️ | ⚠️ | ✓✓ | ✓✓✓ | Mastered |
| Trapping Rain Water | 42 | Two Pointers | ⚠️ | ⚠️ | ⚠️ | ✓✓ | Review again |
| ... continue for all 198 problems | |||||||
✅ Solved independently
⚠️ Needed help
✓✓ Solved quickly on review
✓✓✓ Pattern mastered