DSA
The 90 DSA Patterns That Cover 99% of Coding Interviews
Crack coding interviews by mastering the 90 DSA patterns that cover 99% of problems. Learn structured patterns with AI-powered practice on Thita.ai.

Why Random LeetCode Grinding Doesn't Work
You've solved 200+ LeetCode problems… but still blank out when a new question appears during your actual interview.
Sound familiar?
Here's the truth: Most coding interview questions are built on repeating logic templates. Companies like Google, Meta, Amazon, and Microsoft don't create entirely new problems from scratch. They reuse and remix proven patterns that test fundamental problem-solving skills.
What if you could decode these patterns once — and recognize them instantly in 90% of interview problems?
That's exactly what we're going to show you.
What You'll Learn
This comprehensive guide breaks down the 90 DSA Patterns (organized into 15 fundamental categories) that form the backbone of coding interviews at top tech companies.
By the end, you'll not only understand these patterns but also know how to practice them interactively with AI coaching on Thita.ai — where you get real-time hints, explanations, and feedback as you solve problems.
What Are DSA Patterns?
Think of patterns as reusable blueprints for solving problems.
Once you recognize a pattern — like Two Pointers or Sliding Window — you can instantly map new problems to a known solution framework. Instead of memorizing 500 individual solutions, you master 90 reusable templates that unlock hundreds of problems.
Example: See a sorted array with a target sum? → Two Pointers (Converging) Example: Finding longest substring without repeats? → Sliding Window (Variable Size) Example: Detect a cycle in a linked list? → Fast & Slow Pointers
This pattern-based approach is exactly how top performers at Google, Meta, and Amazon prepare. They don't memorize — they recognize and apply.
The 15 Core DSA Pattern Families
Each pattern family represents a cluster of related problems you'll encounter repeatedly in technical interviews. Below, we break down all 15 categories with their key patterns.
1. Two Pointer Patterns (7 Patterns)
Use Case: Efficient array/string traversal using two pointers
Key Patterns:
- Converging (Sorted Array Target Sum): Classic pair-sum problems like Two Sum, 3Sum, Container With Most Water
- Fast & Slow (Cycle Detection): Floyd's algorithm for detecting cycles in linked lists
- Fixed Separation (Nth Node from End): Find middle node, remove nth from end
- In-place Array Modification: Remove duplicates, sort colors, move zeros
- Expanding From Center (Palindromes): Longest palindromic substring
- String Reversal: Reverse words, reverse vowels
- String Comparison with Backspaces: Compare strings with backspace operations
💡 Pro Tip: Always identify if your array is sorted or if you need to find relationships between two positions.
⚠️ Common Mistake: Off-by-one errors when pointers meet or cross.
Practice on Thita.ai: Start with Two Pointer Problems →
2. Sliding Window Patterns (4 Patterns)
Use Case: Optimize subarray/substring problems dynamically
Key Patterns:
- Fixed Size Window: Maximum average subarray, moving average
- Variable Size (Condition-Based): Longest substring without repeating chars, minimum window substring
- Monotonic Queue for Max/Min: Sliding window maximum, shortest subarray with sum ≥ K
- Character Frequency Matching: Find all anagrams, permutation in string
💡 Pro Tip: Learn when to expand vs. when to shrink the window.
⚠️ Common Mistake: Not resetting frequency maps or counters properly.
Practice on Thita.ai: Master Sliding Window →
3. Tree Traversal Patterns (7 Patterns)
Use Case: Binary tree and N-ary tree problems
Key Patterns:
- BFS - Level Order Traversal: Right side view, zigzag traversal
- DFS - Preorder: Same tree, flatten tree to linked list
- DFS - Inorder: Validate BST, kth smallest element
- DFS - Postorder: Maximum path sum, tree diameter
- Lowest Common Ancestor (LCA): Find LCA in binary tree/BST
- Serialization/Deserialization: Serialize tree, find duplicate subtrees
💡 Pro Tip: Visualize recursion depth and think about what information needs to flow up vs. down.
Practice on Thita.ai: Explore Tree Problems →
4. Graph Traversal Patterns (8 Patterns)
Use Case: Connectivity, pathfinding, and topology problems
Key Patterns:
- DFS - Connected Components/Islands: Count islands, surrounded regions
- BFS - Shortest Path: Rotting oranges, shortest path in binary matrix
- DFS - Cycle Detection (Directed): Course schedule, detect cycles
- BFS - Topological Sort (Kahn's Algorithm): Course schedule II, build order
- Graph Cloning/Deep Copy: Clone graph
- Dijkstra's Algorithm: Network delay time, path with minimum effort
- Bellman-Ford/BFS+K: Cheapest flights within K stops
- Union-Find (DSU): Connected components, redundant connection
💡 Pro Tip: Always use a visited set to avoid infinite loops in DFS/BFS.
Practice on Thita.ai: Practice Graph Problems →
5. Dynamic Programming Patterns (11 Patterns)
Use Case: Optimization with overlapping subproblems
Key Patterns:
- 1D DP (Fibonacci Style): Climbing stairs, house robber, decode ways
- 1D DP (Kadane's Algorithm): Maximum subarray sum
- 1D DP (Coin Change/Unbounded Knapsack): Coin change, combination sum IV
- 1D DP (0/1 Knapsack): Partition equal subset sum, target sum
- 1D DP (Word Break): Word break I & II
- 2D DP (LCS): Longest common subsequence, delete operation
- 2D DP (Edit Distance): Levenshtein distance
- 2D DP (Unique Paths on Grid): Unique paths, minimum path sum, maximal square
- Interval DP: Burst balloons, remove boxes
- Catalan Numbers: Unique BSTs, different ways to add parentheses
- Longest Increasing Subsequence (LIS): LIS, Russian doll envelopes
💡 Pro Tip: Start with recursion + memoization, then convert to bottom-up DP.
Thita.ai Advantage: Get AI explanations on how your recursion converts to DP table. Master DP Patterns →
6. Heap (Priority Queue) Patterns (4 Patterns)
Use Case: Top K elements, median finding, scheduling
Key Patterns:
- Top K Elements: Kth largest element, top K frequent elements, K closest points
- Two Heaps for Median: Find median from data stream
- K-way Merge: Merge K sorted lists, smallest range covering K lists
- Scheduling/Min Cost (Greedy + PQ): Meeting rooms II, task scheduler, reorganize string
Pro Tip: Know when to use min-heap vs max-heap.
Practice on Thita.ai: Solve Heap Problems →
7. Backtracking Patterns (7 Patterns)
Use Case: Exhaustive search with pruning
Key Patterns:
- Subsets (Include/Exclude): Subsets, combinations, letter combinations
- Permutations: Generate permutations, next permutation
- Combination Sum: Combination sum I & II
- Parentheses Generation: Generate valid parentheses
- Word Search/Path Finding: Word search I & II
- N-Queens/Constraint Satisfaction: N-Queens, Sudoku solver
- Palindrome Partitioning: Partition string into palindromes
Pro Tip: Always remember to backtrack (revert state) after recursive calls.
Practice on Thita.ai: Master Backtracking →
8. Greedy Patterns (6 Patterns)
Use Case: Local optimum choices leading to global solution
Key Patterns:
- Interval Merging/Scheduling: Merge intervals, meeting rooms
- Jump Game: Jump game I & II
- Buy/Sell Stock: Best time to buy and sell stock
- Gas Station Circuit: Gas station
- Task Scheduling (Frequency Based): Task scheduler
Pro Tip: Prove the greedy choice property before coding.
Practice on Thita.ai: Try Greedy Problems →
9. Binary Search Patterns (5 Patterns)
Use Case: Efficient searching in sorted spaces
Key Patterns:
- On Sorted Array/List: Binary search, search insert position, sqrt(x)
- Rotated Sorted Array: Search in rotated array, find minimum
- On Answer/Condition Function: Koko eating bananas, capacity to ship packages
- Find First/Last Occurrence: Find first and last position in sorted array
- Median of Two Sorted Arrays: Classic hard problem
Pro Tip: Use binary search on answer space, not just array indices.
Practice on Thita.ai: Master Binary Search →
10. Stack Patterns (6 Patterns)
Use Case: LIFO-based problem solving
Key Patterns:
- Valid Parentheses Matching: Valid parentheses, longest valid parentheses
- Monotonic Stack: Next greater element, daily temperatures, largest rectangle
- Expression Evaluation (RPN/Infix): Evaluate reverse Polish notation, basic calculator
- Simulation/Backtracking Helper: Simplify path, decode string, asteroid collision
- Min Stack Design: Design stack with O(1) min operation
- Largest Rectangle in Histogram: Histogram area, maximal rectangle
Pro Tip: Monotonic stacks are incredibly powerful for next greater/smaller element problems.
Practice on Thita.ai: Solve Stack Problems →
11. Bit Manipulation Patterns (5 Patterns)
Use Case: Binary operations and bit-level optimizations
Key Patterns:
- XOR - Finding Single/Missing Number: Single number, missing number
- Counting Set Bits (Hamming Weight): Number of 1 bits
- Power of Two/Four Check: Power of two, power of four
- Bitwise DP: Counting bits optimization
Pro Tip: Remember x & (x - 1) removes the rightmost set bit.
Practice on Thita.ai: Master Bit Manipulation →
12. Linked List Manipulation Patterns (5 Patterns)
Use Case: Pointer manipulation and list operations
Key Patterns:
- In-place Reversal: Reverse linked list, reverse nodes in k-group
- Merging Two Sorted Lists: Merge two sorted lists
- Addition of Numbers: Add two numbers as linked lists
- Intersection Detection: Find intersection of two linked lists
- Reordering/Partitioning: Reorder list, partition list, odd-even linked list
Pro Tip: Draw the pointer connections on paper before coding.
Practice on Thita.ai: Solve Linked List Problems →
13. Array/Matrix Manipulation Patterns (8 Patterns)
Use Case: Array transformations and matrix operations
Key Patterns:
- In-place Rotation: Rotate image, rotate array
- Spiral Traversal: Spiral matrix I, II, III
- Set Matrix Zeroes: In-place marking without extra space
- Product Except Self: Prefix/suffix products
- Plus One (Handling Carry): Plus one
- Merge Sorted Array: In-place merge from end
- Cyclic Sort: Find missing positive, find duplicates
- Kadane's Variant (Max Product): Maximum product subarray
Pro Tip: For in-place operations, work backwards to avoid overwriting data.
Practice on Thita.ai: Master Array Problems →
14. String Manipulation Patterns (7 Patterns)
Use Case: String processing and pattern matching
Key Patterns:
- Palindrome Check: Valid palindrome, palindrome number
- Anagram Check (Frequency/Sort): Group anagrams, valid anagram
- Roman to Integer Conversion: Roman to integer
- String to Integer (atoi): Implement atoi
- Multiply Strings: Manual multiplication simulation
- String Matching (KMP/Rabin-Karp): Find first occurrence, shortest palindrome
- Repeated Substring Pattern: Detect repeated patterns
Pro Tip: Use frequency maps for O(n) anagram checking.
Practice on Thita.ai: Solve String Problems →
15. Design Patterns (1 Meta-Pattern)
Use Case: System design and data structure implementation
Key Patterns:
- Design (General/Specific): LRU Cache, LFU Cache, Min Stack, Trie, Time-based Key-Value Store, Design Twitter, Design Hit Counter, and 30+ more design problems
Pro Tip: Focus on time-space tradeoffs and API design clarity.
Practice on Thita.ai: Practice Design Problems →
How to Practice Effectively on Thita.ai
Knowing the patterns is just the start. Deliberate practice with real-time feedback is what converts knowledge into interview success.
Here's how Thita.ai's AI-powered platform accelerates your learning:
1. Open the DSA 90 Pattern Sheet
Visit Thita.ai's DSA Pattern Sheet to see all 15 pattern categories with 88-91 subpatterns, organized exactly as outlined above.
2. Choose a Pattern
Click on any pattern (e.g., "Sliding Window - Variable Size") to see curated problems from LeetCode that follow that exact template.
3. Solve with AI Coaching
- Get real-time hints when you're stuck
- Receive instant code analysis and optimization suggestions
- Understand time/space complexity with AI explanations
- See alternative approaches and learn multiple solution strategies
4. Track Your Progress
- View your pattern mastery dashboard
- Identify weak spots and focus practice
- Build momentum with problem-solving streaks
- Get personalized recommendations
Pro Tip: Enable AI Coaching Mode on Thita.ai to get step-by-step guidance as you solve problems. It's like having a senior engineer pair-programming with you.
Your Action Plan
Don't just read — take action today:
Step 1: Start with the Fundamentals
Begin with Two Pointers and Sliding Window patterns. These are the most frequently asked in FAANG interviews and build intuition for pointer-based thinking.
Step 2: Practice One Pattern at a Time
Pick one pattern, solve 5-10 problems in that category, and move to the next only when you can recognize the pattern instantly.
Step 3: Mock Interview with AI
Once you've covered 5-6 pattern families, try a mock interview on Thita.ai where the AI interviewer evaluates your approach, not just your code.
Step 4: Review and Iterate
Use Thita.ai's analytics to see which patterns you struggle with and focus your practice there.
Conclusion & Next Steps
Stop memorizing — start recognizing patterns.
These 90 DSA Patterns (organized into 15 core families) are your ultimate roadmap to mastering technical interviews. Every problem you solve on Thita.ai strengthens your pattern recognition, tracked with AI-driven progress analytics.
The reality: Most candidates waste months grinding random LeetCode problems. The top 1% use pattern-based preparation and ace their interviews in weeks.
Which group will you join?
Start practicing today: Open Thita.ai's DSA 90 Pattern Sheet →
Your next interview question will feel like déjà vu.
Ready to Transform Your Interview Prep?
Join thousands of engineers who've landed offers at Google, Meta, Amazon, and more using Thita.ai's structured, AI-powered approach.
Last Updated: September 4, 2026
Related Articles
- Best AI Interview Prep Tools of 2026: Compare Top Platforms (New)
- AI Interview Practice: Free Mock Interview Simulator
- Free ATS Resume Checker: AI-Powered Resume Analyzer
- Master Two Pointer Patterns: Complete Guide (Coming Soon)
- Dynamic Programming Patterns Demystified (Coming Soon)
External Resources
Questions? Join our Discord community and connect with thousands of engineers preparing for technical interviews.