DSA Quick Notes 2026
Arrays, Strings, Trees, Graphs, DP, Blind-75 & Common Interview Patterns
Master the patterns that solve 80% of coding interview problems
Arrays
Random Access, Fixed/Resizable
Key Operations
- Access: O(1) – Direct indexing
- Search: O(n) – Linear scan
- Insertion: O(n) – Shifting elements
- Deletion: O(n) – Shifting elements
Common Patterns
Blind-75 Problems
- Two Sum
- Best Time to Buy/Sell Stock
- Contains Duplicate
- Product of Array Except Self
- Maximum Subarray
Strings
Immutable sequences
Key Concepts
- Strings are immutable in many languages
- Character encoding matters (ASCII, Unicode)
- StringBuilder for efficient concatenation
- Palindrome, Anagram, Substring problems
Common Patterns
Blind-75 Problems
- Valid Palindrome
- Longest Substring Without Repeating
- String to Integer (atoi)
- Longest Palindromic Substring
- Group Anagrams
Trees
Hierarchical Data Structures
Tree Types
- Binary Tree: 0-2 children per node
- BST: Left < Root < Right property
- AVL/Red-Black: Self-balancing trees
- Heap: Complete binary tree, heap property
- Trie: Prefix tree for strings
Traversal Patterns
Blind-75 Problems
- Maximum Depth of Binary Tree
- Validate Binary Search Tree
- Binary Tree Level Order Traversal
- Serialize and Deserialize Binary Tree
- Implement Trie (Prefix Tree)
Graphs
Nodes & Edges, V & E
Representations
- Adjacency List: O(V+E) space, good for sparse
- Adjacency Matrix: O(V²) space, good for dense
- Edge List: Simple but slower queries
Algorithm Guide
| Algorithm | Use Case | Time |
|---|---|---|
| BFS | Shortest path (unweighted) | O(V+E) |
| DFS | Connectivity, cycles | O(V+E) |
| Dijkstra | SSSP (non-negative) | O(E log V) |
| Topological Sort | DAG ordering | O(V+E) |
Blind-75 Problems
- Clone Graph
- Course Schedule
- Number of Islands
- Alien Dictionary
- Graph Valid Tree
Dynamic Programming
Memoization & Tabulation
When to Use DP
- Optimal substructure
- Overlapping subproblems
- Count, minimize, maximize problems
- “How many ways” questions
DP Patterns
Framework
- Define state dp[i] or dp[i][j]
- Define recurrence relation
- Base cases initialization
- Fill table in correct order
- Return answer
Blind-75 Problems
- Climbing Stairs
- Coin Change
- Longest Increasing Subsequence
- Word Break
- House Robber
Common Patterns
Solve 80% of interview problems
Top 6 Patterns
- Sliding Window: Fixed/variable window, subarray problems
- Two Pointers: Sorted arrays, pair searching
- Fast & Slow: Cycle detection, middle element
- BFS/DFS: Tree/Graph traversal, shortest path
- Backtracking: Permutations, combinations, subsets
- Divide & Conquer: Merge sort, binary search, matrix ops
Pattern Identification Guide
| Problem Type | Likely Pattern |
|---|---|
| “Subarray with sum/condition” | Sliding Window |
| “Sorted array”, “pair sum” | Two Pointers |
| “All permutations/combinations” | Backtracking |
| “Shortest path”, “minimum steps” | BFS |
| “Count ways”, “minimum/maximum” | Dynamic Programming |
Interview Strategy & Tips (2026)
Communication First
Think out loud. Interviewers care more about your thought process than the final answer. Ask clarifying questions before jumping to solutions.
Time Management
Spend 5-10 minutes understanding, 15-20 minutes solving, 5-10 minutes testing. If stuck after 10 minutes, ask for a hint.
Code Quality
Write clean, readable code with meaningful variable names. Include comments for complex logic. Check edge cases explicitly.
Optimize Progressively
Start with brute force, then optimize. Explain time/space complexity at each step. “Make it work, make it right, make it fast.”
Blind-75 Priority Checklist
Master these 15 problems first (covers all patterns)
Complete these 15, then expand to full Blind-75. Quality > Quantity.
