Chapter 1: How to Use This Book
- Who This Book Is For
- How Coding Interviews Actually Work
- The Pattern-First Approach Explained
- Swift vs Kotlin: A Quick Syntax Comparison
- How to Practice Effectively
- Common Data Structures: Quick Reference
- Setting Up Your Practice Environment
- A Note on Problem Selection
- What’s Next
Chapter 2: Complexity Analysis Essentials
- Why Complexity Analysis Matters
- Big O Notation: The Basics
- Common Complexity Classes
- Complexity Comparison Table
- Space Complexity
- Analyzing Your Own Code
- Common Patterns and Their Complexities
- Talking About Complexity in Interviews
- Quick Reference Card
- Practice Problems
- What’s Next
Chapter 3: Two Pointers
- The Pattern Explained
- Pattern Recognition Signals
- The Two Main Variations
- Template: Opposite Direction
- Template: Same Direction
- Problem 1: Two Sum II — Input Array Is Sorted ★
- Problem 2: 3Sum ★
- Problem 3: Container With Most Water ★
- Problem 4: Trapping Rain Water ★
- Bonus Problem: Remove Duplicates from Sorted Array
- Chapter Summary
- What’s Next
Chapter 4: Fast & Slow Pointers
- The Pattern Explained
- Pattern Recognition Signals
- The Core Technique
- Linked List Node Definition
- Problem 1: Linked List Cycle ★
- Problem 2: Linked List Cycle II ★
- Problem 3: Happy Number ★
- Problem 4: Find the Duplicate Number ★
- Problem 5: Middle of the Linked List ★
- Bonus Problem: Palindrome Linked List
- Chapter Summary
- What’s Next
Chapter 5: Sliding Window
- The Pattern Explained
- Pattern Recognition Signals
- The Two Variations
- Template: Fixed-Size Window
- Template: Dynamic-Size Window
- Problem 1: Best Time to Buy and Sell Stock ★
- Problem 2: Longest Substring Without Repeating Characters ★
- Problem 3: Longest Repeating Character Replacement ★
- Problem 4: Minimum Window Substring ★
- Problem 5: Maximum Sum Subarray of Size K
- Problem 6: Permutation in String
- Chapter Summary
- What’s Next
Chapter 6: Merge Intervals
- The Pattern Explained
- Pattern Recognition Signals
- Key Concepts
- Template: Merge Overlapping Intervals
- Problem 1: Merge Intervals ★
- Problem 2: Insert Interval ★
- Problem 3: Non-overlapping Intervals ★
- Problem 4: Meeting Rooms ★
- Problem 5: Meeting Rooms II ★
- Chapter Summary
- What’s Next
Chapter 7: Binary Search
- The Pattern Explained
- Pattern Recognition Signals
- The Classic Template
- Common Pitfalls
- Problem 1: Binary Search ★
- Problem 2: Search in Rotated Sorted Array ★
- Problem 3: Find Minimum in Rotated Sorted Array ★
- Problem 4: Search a 2D Matrix ★
- Problem 5: Koko Eating Bananas ★
- Problem 6: Median of Two Sorted Arrays ★
- Chapter Summary
- What’s Next
Chapter 8: Linked List Manipulation
- The Pattern Explained
- Pattern Recognition Signals
- Node Definition Reminder
- Essential Technique: In-Place Reversal
- Essential Technique: Dummy Nodes
- Problem 1: Reverse Linked List ★
- Problem 2: Reverse Linked List II ★
- Problem 3: Merge Two Sorted Lists ★
- Problem 4: Merge K Sorted Lists ★
- Problem 5: Remove Nth Node From End ★
- Problem 6: Reorder List ★
- Chapter Summary
- What’s Next
Chapter 9: Stack & Monotonic Stack
- The Pattern Explained
- Pattern Recognition Signals
- Stack Basics in Swift and Kotlin
- Problem 1: Valid Parentheses ★
- Problem 2: Min Stack ★
- Problem 3: Daily Temperatures ★
- Problem 4: Car Fleet ★
- Problem 5: Largest Rectangle in Histogram ★
- Monotonic Stack Summary
- Chapter Summary
- What’s Next
Chapter 10: Heap / Priority Queue (Top K Elements)
- The Pattern Explained
- Pattern Recognition Signals
- Heap in Swift and Kotlin
- Problem 1: Kth Largest Element in an Array ★
- Problem 2: Top K Frequent Elements ★
- Problem 3: Find Median from Data Stream ★
- Problem 4: Task Scheduler ★
- Chapter Summary
- What’s Next
Chapter 11: Binary Tree Traversal
- The Pattern Explained
- Pattern Recognition Signals
- Tree Node Definition
- The Four Traversals
- Problem 1: Invert Binary Tree ★
- Problem 2: Maximum Depth of Binary Tree ★
- Problem 3: Same Tree ★
- Problem 4: Subtree of Another Tree ★
- Problem 5: Binary Tree Level Order Traversal ★
- Problem 6: Diameter of Binary Tree ★
- Problem 7: Balanced Binary Tree ★
- Chapter Summary
- What’s Next
Chapter 12: Binary Search Tree (BST)
- The Pattern Explained
- Pattern Recognition Signals
- BST Properties to Remember
- Problem 1: Lowest Common Ancestor of BST ★
- Problem 2: Validate Binary Search Tree ★
- Problem 3: Kth Smallest Element in BST ★
- Problem 4: Convert Sorted Array to BST ★
- Problem 5: Insert into a BST ★
- Problem 6: Delete Node in BST ★
- Chapter Summary
- What’s Next
Chapter 13: Tries (Prefix Trees)
- The Pattern Explained
- Pattern Recognition Signals
- Trie Node Structure
- Alternative: Array-based Children (for lowercase letters only)
- Problem 1: Implement Trie ★
- Problem 2: Design Add and Search Words ★
- Problem 3: Word Search II ★
- Problem 4: Longest Word in Dictionary
- Chapter Summary
- What’s Next
Chapter 14: Backtracking
- The Pattern Explained
- Pattern Recognition Signals
- The Backtracking Template
- Problem 1: Subsets ★
- Problem 2: Combination Sum ★
- Problem 3: Permutations ★
- Problem 4: Word Search ★
- Problem 5: N-Queens ★
- Chapter Summary
Chapter 15: Graph Traversal (BFS & DFS)
- The Pattern Explained
- Pattern Recognition Signals
- Graph Representations
- DFS Template
- BFS Template
- Problem 1: Number of Islands ★
- Problem 2: Clone Graph ★
- Problem 3: Pacific Atlantic Water Flow ★
- Problem 4: Rotting Oranges ★
- Problem 5: Course Schedule ★
- Chapter Summary
Chapter 16: Advanced Graph Algorithms
- Part 1: Topological Sort
- Part 2: Union-Find (Disjoint Set Union)
- Chapter Summary
Chapter 17: Dynamic Programming - 1D
- The Pattern Explained
- Pattern Recognition Signals
- The 1D DP Template
- Problem 1: Climbing Stairs ★
- Problem 2: House Robber ★
- Problem 3: Coin Change ★
- Problem 4: Longest Increasing Subsequence ★
- Problem 5: Word Break ★
- Problem 6: Decode Ways ★
- Chapter Summary
Chapter 18: Dynamic Programming - 2D
- The Pattern Explained
- Pattern Recognition Signals
- Problem 1: Unique Paths ★
- Problem 2: Longest Common Subsequence ★
- Problem 3: Edit Distance ★
- Problem 4: 0/1 Knapsack Pattern
- Problem 5: Target Sum ★
- Problem 6: Longest Palindromic Substring ★
- Chapter Summary
Chapter 19: Bit Manipulation
- The Pattern Explained
- Pattern Recognition Signals
- Essential Bit Tricks
- Problem 1: Single Number ★
- Problem 2: Number of 1 Bits ★
- Problem 3: Counting Bits ★
- Problem 4: Reverse Bits ★
- Problem 5: Missing Number ★
- Problem 6: Sum of Two Integers ★
- Bitmask for Subsets
- Chapter Summary
Chapter 20: Math & Geometry
- Common Mathematical Patterns
- Problem 1: Rotate Image ★
- Problem 2: Spiral Matrix ★
- Problem 3: Set Matrix Zeroes ★
- Problem 4: Happy Number ★
- Problem 5: Plus One ★
- Problem 6: Pow(x, n) ★
- Problem 7: Detect Squares ★
- Chapter Summary
Chapter 21: Problem-Solving Strategies
- The 4-Step Framework
- Pattern Recognition Guide
- Common Mistakes to Avoid
- Time Management
- Communication Templates
- Chapter Summary
Chapter 22: Pattern Quick Reference
- Two Pointers
- Fast & Slow Pointers
- Sliding Window
- Binary Search
- Merge Intervals
- Linked List Techniques
- Stack / Monotonic Stack
- Heap / Priority Queue
- Tree Traversal
- Graph Traversal
- Topological Sort
- Union-Find
- Backtracking
- Dynamic Programming - 1D
- Dynamic Programming - 2D
- Bit Manipulation
- Complexity Quick Reference
Chapter 24: Final Review & Next Steps
- The Complete Pattern Map
- The 88 Problems Checklist
- Study Plans
- Interview Day Tips
- Beyond the Interview
- Final Words
- Quick Reference Card
- About This Book