Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Appendix L: 30-Day Crash Course

An intensive crash course focusing on the highest-impact topics only. For those with very limited time.


Overview

  • Duration: 4 weeks (28 days + 2 rest days)
  • Daily commitment: 5-6 hours
  • Weekly pattern: 6 days learning + 1 day review
  • Total problems: ~120-150
  • Goal: Cover the most frequently asked topics at a functional level

Who This Plan Is For

  • You have an interview in 3-4 weeks
  • You have some programming background
  • You can dedicate 5-6 hours daily
  • You need to prioritize the highest-impact topics

Warning: This plan is intense. You won’t master every topic, but you’ll be functional in the most important ones.


Priority Topics (Highest Interview Frequency)

  1. Arrays & Strings — 20% of interview questions
  2. Trees & BST — 15% of interview questions
  3. Dynamic Programming — 15% of interview questions
  4. Graphs — 12% of interview questions
  5. Hash Tables — 10% of interview questions
  6. Sorting & Searching — 10% of interview questions
  7. Stacks & Queues — 8% of interview questions
  8. Linked Lists — 5% of interview questions
  9. Trie & Advanced — 5% of interview questions

Week 1: Core Fundamentals (Days 1-7)

Day 1: Arrays & Hash Maps

  • Two Sum (hash map approach)
  • Contains Duplicate
  • Best Time to Buy/Sell Stock
  • Group Anagrams
  • Practice: 4-5 problems

Day 2: Strings & Two Pointers

  • Valid Anagram
  • Longest Substring Without Repeating Characters
  • Container With Most Water
  • 3Sum
  • Practice: 4-5 problems

Day 3: Sliding Window & Prefix Sums

  • Maximum Subarray (Kadane’s)
  • Minimum Window Substring
  • Product of Array Except Self
  • Subarray Sum Equals K
  • Practice: 4-5 problems

Day 4: Linked Lists

  • Reverse Linked List
  • Merge Two Sorted Lists
  • Linked List Cycle (Floyd’s)
  • Remove Nth Node From End
  • Practice: 4-5 problems

Day 5: Stacks & Queues

  • Valid Parentheses
  • Min Stack
  • Daily Temperatures
  • Implement Queue using Stacks
  • Practice: 4-5 problems

Day 6: Heaps

  • Kth Largest Element
  • Top K Frequent Elements
  • Find Median from Data Stream
  • Merge K Sorted Lists
  • Practice: 4-5 problems

Day 7: Review Day

  • Review all concepts from week 1
  • Redo any problems you couldn’t solve
  • Update cheat sheets

Week 2: Trees & Graphs (Days 8-14)

Day 8: Binary Tree Basics

  • Inorder/Preorder/Postorder traversals
  • Maximum Depth of Binary Tree
  • Level Order Traversal
  • Same Tree / Symmetric Tree
  • Practice: 4-5 problems

Day 9: BST & LCA

  • Validate BST
  • Kth Smallest Element in BST
  • Lowest Common Ancestor
  • Insert/Delete in BST
  • Practice: 4-5 problems

Day 10: Tree Construction & Serialization

  • Construct from Preorder/Inorder
  • Serialize/Deserialize Binary Tree
  • Binary Tree Maximum Path Sum
  • Practice: 3-4 problems

Day 11: Graph Basics & BFS

  • Number of Islands
  • Rotting Oranges
  • Clone Graph
  • Word Ladder
  • Practice: 4-5 problems

Day 12: Graph DFS & Topological Sort

  • Course Schedule
  • Course Schedule II
  • Number of Connected Components
  • Graph Valid Tree
  • Practice: 4-5 problems

Day 13: Shortest Path & Union-Find

  • Dijkstra (Network Delay Time)
  • Union-Find (Redundant Connection)
  • Cheapest Flights Within K Stops
  • Practice: 3-4 problems

Day 14: Review Day

  • Review trees and graphs
  • Redo challenging problems
  • Update cheat sheets

Week 3: Dynamic Programming (Days 15-21)

Day 15: REST DAY

Day 16: 1D DP

  • Climbing Stairs
  • House Robber
  • Maximum Product Subarray
  • Decode Ways
  • Practice: 4-5 problems

Day 17: Knapsack & Subset

  • Coin Change
  • Partition Equal Subset Sum
  • Target Sum
  • Unbounded Knapsack pattern
  • Practice: 4-5 problems

Day 18: String DP

  • Longest Common Subsequence
  • Edit Distance
  • Longest Palindromic Substring
  • Word Break
  • Practice: 4-5 problems

Day 19: Grid DP

  • Unique Paths
  • Minimum Path Sum
  • Dungeon Game
  • Maximal Square
  • Practice: 4-5 problems

Day 20: LIS & Interval DP

  • Longest Increasing Subsequence
  • Russian Doll Envelopes
  • Burst Balloons
  • Practice: 3-4 problems

Day 21: Review Day

  • Review all DP patterns
  • Redo challenging problems
  • Update cheat sheets

Week 4: Binary Search, Sorting, & Final Prep (Days 22-28)

  • Binary Search (standard)
  • Search in Rotated Sorted Array
  • Find Minimum in Rotated Sorted Array
  • Binary Search on Answer (Koko Eating Bananas)
  • Practice: 4-5 problems

Day 23: Sorting & Quickselect

  • Merge Sort
  • Kth Largest Element (Quickselect)
  • Merge Intervals
  • Largest Number
  • Practice: 4-5 problems

Day 24: Backtracking

  • Subsets
  • Permutations
  • Combination Sum
  • N-Queens
  • Practice: 4-5 problems

Day 25: Trie & String Matching

  • Implement Trie
  • Word Search II
  • KMP Algorithm (basic understanding)
  • Practice: 3-4 problems

Day 26: REST DAY

Day 27: Mock Interview & Review

  • Full mock interview (45-60 minutes)
  • Review weak areas
  • Redo 3-4 challenging problems

Day 28: Final Review

  • Review all cheat sheets
  • Practice problem identification
  • Prepare for interviews

Daily Schedule

TimeActivity
0:00-0:15Review yesterday’s material
0:15-1:30Learn new concept (videos, reading, examples)
1:30-3:30Solve problems (4-5 problems)
3:30-3:45Break
3:45-5:00Solve additional problems or review
5:00-5:30Update notes and cheat sheets
5:30-6:00Review patterns and approaches

Problem Count by Topic

TopicProblemsKey Patterns
Arrays & Strings20-25Two pointers, sliding window, hash map
Linked Lists10-12Fast/slow pointers, reversal
Stacks & Queues10-12Monotonic stack, parentheses
Heaps8-10Top K, median, merge
Trees & BST15-18Traversals, BST, LCA
Graphs15-18BFS, DFS, topo sort, DSU
Dynamic Programming20-251D, 2D, knapsack, string
Binary Search10-12Standard, rotated, on answer
Sorting8-10Merge sort, quickselect, intervals
Backtracking8-10Subsets, permutations, combinations
Trie4-5Prefix queries
Total~120-150

Essential Patterns to Master

1. Two Pointers

When: Sorted arrays, pair finding
Pattern: Start at both ends, move based on condition

2. Sliding Window

When: Contiguous subarray/substring
Pattern: Expand right, shrink left when needed

3. Hash Map

When: Frequency counting, lookup
Pattern: Store as you iterate, check as you go

4. BFS

When: Shortest path, level-order
Pattern: Queue, visited array, process level by level

5. DFS

When: Path finding, tree traversal
Pattern: Recursion or stack, mark visited
When: Sorted array, monotonic function
Pattern: lo/hi pointers, eliminate half each step

7. DP

When: Overlapping subproblems, optimal substructure
Pattern: Define state, find recurrence, fill table

8. Backtracking

When: Generate all solutions
Pattern: Choose, explore, undo

Cheat Sheet: When to Use What

Problem TypeTechniqueTime Complexity
Find pair with sumHash mapO(n)
Sorted array, find pairTwo pointersO(n)
Contiguous subarraySliding windowO(n)
Shortest path (unweighted)BFSO(V+E)
All paths / permutationsDFS / BacktrackingVaries
Sorted array searchBinary searchO(log n)
Overlapping subproblemsDPVaries
Top K elementsHeapO(n log k)
Frequency countingHash mapO(n)
Parentheses matchingStackO(n)
Tree traversalDFS / BFSO(n)
Connected componentsDFS / DSUO(V+E)

Last-Minute Tips

  1. Don’t try to learn everything — focus on the patterns listed above
  2. Practice explaining — being able to explain your approach is half the battle
  3. Test with examples — always trace through your code with the given examples
  4. Handle edge cases — empty input, single element, all same elements
  5. State complexity — always know the time and space complexity of your solution
  6. Stay calm — if you get stuck, take a breath and think about simpler versions of the problem

Problem List (Must-Do)

Arrays & Strings (Top 10)

  1. Two Sum
  2. Best Time to Buy/Sell Stock
  3. Maximum Subarray
  4. Product of Array Except Self
  5. Contains Duplicate
  6. Longest Substring Without Repeating Characters
  7. 3Sum
  8. Container With Most Water
  9. Group Anagrams
  10. Minimum Window Substring

Trees (Top 8)

  1. Maximum Depth
  2. Level Order Traversal
  3. Validate BST
  4. Lowest Common Ancestor
  5. Construct from Preorder/Inorder
  6. Binary Tree Maximum Path Sum
  7. Serialize/Deserialize
  8. Kth Smallest in BST

Graphs (Top 6)

  1. Number of Islands
  2. Course Schedule
  3. Clone Graph
  4. Number of Connected Components
  5. Word Ladder
  6. Network Delay Time

DP (Top 10)

  1. Climbing Stairs
  2. Coin Change
  3. Longest Common Subsequence
  4. Edit Distance
  5. Unique Paths
  6. House Robber
  7. Word Break
  8. Longest Increasing Subsequence
  9. Partition Equal Subset Sum
  10. Maximum Product Subarray

Other (Top 6)

  1. Valid Parentheses
  2. Merge Two Sorted Lists
  3. Reverse Linked List
  4. Kth Largest Element
  5. Implement Trie
  6. Subsets

Total: ~40 must-do problems + additional practice = ~120-150 problems


This crash course covers the highest-impact topics. You won’t master everything, but you’ll be functional in the most important areas. Good luck!


Frequently Asked Questions

Is 30 days really enough?

It depends on your starting point. If you already have a computer science degree and have done some programming, 30 days of focused preparation can get you interview-ready for most companies. If you’re starting from zero, you’ll need more time. Be honest with yourself about where you stand.

The goal of this crash course isn’t mastery — it’s functionality. You’ll be able to recognize and solve the most common interview problems. You won’t be ready for the hardest problems at top-tier companies, but you’ll be competitive for most roles.

What if I can’t solve a problem after 30 minutes?

Look at the solution, but don’t just copy it. Read the approach, close the solution, and try to implement it yourself. Then compare your implementation with the reference. Finally, add the problem to your review list and redo it in 3-4 days.

How do I handle problems I’ve never seen before?

This is the whole point of learning patterns. When you see a new problem, don’t think about the specific problem — think about which pattern it matches. Is it a sliding window problem? A graph BFS? A DP problem? Once you identify the pattern, the template gives you the skeleton of the solution.

Should I skip easy problems?

No. Easy problems build speed and confidence. They also often contain the same patterns as medium problems, just with simpler implementation. If you can solve an easy problem in 5 minutes, you have more time for the hard ones.

What about system design interviews?

This crash course focuses on coding interviews only. System design is a separate skill that requires different preparation. If you have system design interviews, dedicate the last week to it instead of coding practice.


Time-Saving Tips

Learn to Recognize Patterns Instantly

The fastest way to solve interview problems is pattern recognition. Instead of thinking about each problem from scratch, train yourself to see the pattern:

  • “Need to find a pair with a target sum?” → Hash map
  • “Sorted array with a condition?” → Binary search or two pointers
  • “Contiguous subarray with a property?” → Sliding window or prefix sum
  • “Shortest path in an unweighted graph?” → BFS
  • “All possible combinations?” → Backtracking
  • “Optimal solution with overlapping subproblems?” → DP

Use Templates

Don’t reinvent the wheel for common patterns. Have a template for:

  • Binary search (with both left and right boundary variants)
  • BFS and DFS (graph and tree)
  • Sliding window (fixed and variable size)
  • DP (1D and 2D)
  • Backtracking (with pruning)

Optimize Your Coding Speed

In a 45-minute interview, you have about 20 minutes for coding. Practice typing your templates without looking at the keyboard. Know your language’s standard library well — especially vector, unordered_map, priority_queue, and sort.


Common Failure Modes and How to Avoid Them

Failure Mode 1: Panic

You see a problem and your mind goes blank. Solution: Take a deep breath and start with what you know. Restate the problem. Draw an example. Think about the brute force. The act of doing something breaks the panic cycle.

Failure Mode 2: Tunnel Vision

You get fixated on one approach that isn’t working and refuse to consider alternatives. Solution: Set a mental timer. If you haven’t made progress in 5 minutes, explicitly state: “This approach isn’t working because X. Let me try Y instead.”

Failure Mode 3: Off-by-One Errors

Your logic is correct but your indices are wrong. Solution: Always trace through your code with a small example (3-5 elements) before declaring you’re done. Pay special attention to loop boundaries, empty inputs, and single elements.

Failure Mode 4: Forgetting Edge Cases

You solve the general case but miss empty inputs, negative numbers, or overflow. Solution: Before coding, list 3 edge cases. After coding, verify each one.

Failure Mode 5: Poor Communication

You solve the problem but the interviewer has no idea how you got there. Solution: Practice the think-aloud protocol. Narrate your thought process as if you’re explaining to a friend.


What to Do After the 30 Days

If Your Interviews Went Well

  • Continue practicing to maintain your skills
  • Start learning system design if needed
  • Explore advanced topics (segment trees, network flow, etc.)

If Your Interviews Didn’t Go Well

  • Analyze what went wrong (specific topics? communication? time management?)
  • Extend your preparation with the 60-day or 90-day plan
  • Focus on your weakest areas with targeted practice
  • Do more mock interviews to build confidence

Regardless of Outcome

  • Keep a problem journal documenting patterns and insights
  • Stay connected with the DSA community (LeetCode discuss, Reddit)
  • Consider contributing to open source to maintain coding skills
  • Remember: every interview is practice for the next one