DSA practice list
NeetCode 250, by pattern
The NeetCode 250 list, practised on thita. Every problem is grouped under the 99 DSA patterns it teaches, with NeetCode's topic kept as a tag, so you can see which technique each problem is drilling instead of only which data structure it uses.
Each problem opens in an editor in the browser, where you run your code against the problem's test cases. Every problem on this list that is live on thita runs in all 6 of Python, C++, Java, JavaScript, Go and C#. When a pattern feels solid, take it into an AI mock interview: you solve a problem out loud, the interviewer runs your code and asks the follow-up questions a real one would.
All 250 problems are on thita.
Last updated
The 250 problems on thita, grouped by pattern
Families and patterns follow the DSA patterns sheet. The tag on each problem is its NeetCode topic.
Array/Matrix Manipulation Patterns
Merge Sorted Array (In-place from End)
- Merge Sorted ArrayEasyTwo Pointers
Spiral Traversal
- Spiral MatrixMediumMath & Geometry
Set Matrix Zeroes (In-place Marking)
- Set Matrix ZeroesMediumMath & Geometry
Hashing - Frequency Map / Counting
- Valid AnagramEasyArrays & Hashing
- Two SumEasyArrays & Hashing
- Group AnagramsMediumArrays & HashingEditorial
- Majority ElementEasyArrays & Hashing
- Majority Element IIMediumArrays & Hashing
- Subarray Sum Equals KMediumArrays & Hashing
- Verifying An Alien DictionaryEasyGraphs
- Find the Town JudgeEasyGraphs
Prefix Sum - Subarray Sum / Range Query
- Range Sum Query 2D ImmutableMediumArrays & Hashing
Product Except Self (Prefix/Suffix Products)
- Product of Array Except SelfMediumArrays & Hashing
Plus One (Handling Carry)
- Plus OneEasyMath & Geometry
- Multiply StringsMediumMath & Geometry
- Add BinaryEasyBit ManipulationEditorial
Array - Cyclic Sort
- First Missing PositiveHardArrays & HashingEditorial
Hashing - Previously Seen / Existence Check
- Contains DuplicateEasyArrays & HashingEditorial
- Design HashSetEasyArrays & Hashing
- Valid SudokuMediumArrays & HashingEditorial
- Longest Consecutive SequenceMediumArrays & HashingEditorial
In-place Rotation
- Concatenation of ArrayEasyArrays & Hashing
- Rotate ArrayMediumTwo Pointers
- Transpose MatrixEasyMath & Geometry
- Rotate ImageMediumMath & Geometry
Linked List Manipulation Patterns
Reordering / Partitioning
- Reorder ListMediumLinked List
- Insert Greatest Common Divisors in Linked ListMediumMath & Geometry
In-place Reversal
- Reverse Linked ListEasyLinked ListEditorial
- Reverse Linked List IIMediumLinked List
- Reverse Nodes In K GroupHardLinked List
Merging Two Sorted Lists
- Merge Two Sorted ListsEasyLinked List
Addition of Numbers
- Add Two NumbersMediumLinked ListEditorial
Two Pointers
Fast & Slow (Cycle Detection)
- Linked List CycleEasyLinked ListEditorial
- Find The Duplicate NumberMediumLinked ListEditorial
- Happy NumberEasyMath & GeometryEditorial
Converging (Sorted Array Target Sum)
- Two Sum II Input Array Is SortedMediumTwo PointersEditorial
- 3SumMediumTwo PointersEditorial
- 4SumMediumTwo PointersEditorial
- Container With Most WaterMediumTwo PointersEditorial
- Boats to Save PeopleMediumTwo PointersEditorial
Expanding From Center (Palindromes)
- Longest Palindromic SubstringMedium1-D Dynamic ProgrammingEditorial
- Palindromic SubstringsMedium1-D Dynamic ProgrammingEditorial
String Reversal
- Reverse StringEasyTwo PointersEditorial
- Reverse IntegerMediumBit ManipulationEditorial
In-place Array Modification
- Remove ElementEasyArrays & HashingEditorial
- Sort ColorsMediumArrays & HashingEditorial
- Merge Strings AlternatelyEasyTwo Pointers
- Remove Duplicates From Sorted ArrayEasyTwo PointersEditorial
- Trapping Rain WaterHardTwo PointersEditorial
Sliding Window
Monotonic Queue for Max/Min
- Sliding Window MaximumHardSliding Window
Variable Size (Condition-Based)
- Contains Duplicate IIEasySliding WindowEditorial
- Longest Substring Without Repeating CharactersMediumSliding Window
- Longest Repeating Character ReplacementMediumSliding Window
- Minimum Size Subarray SumMediumSliding Window
- Minimum Window SubstringHardSliding Window
- Longest Turbulent SubarrayMediumGreedy
- Jump Game VIIMediumGreedy
Character Frequency Matching
- Permutation In StringMediumSliding Window
Binary Search Patterns
On Sorted Array/List
- Binary SearchEasyBinary SearchEditorial
- Search Insert PositionEasyBinary Search
- Guess Number Higher Or LowerEasyBinary SearchEditorial
- Sqrt(x)EasyBinary Search
- Search a 2D MatrixMediumBinary Search
Find First/Last Occurrence
- Find K Closest ElementsMediumSliding WindowEditorial
Find Min/Max in Rotated Sorted Array
- Find Minimum In Rotated Sorted ArrayMediumBinary SearchEditorial
- Search In Rotated Sorted ArrayMediumBinary Search
- Search In Rotated Sorted Array IIMediumBinary Search
- Find in Mountain ArrayHardBinary SearchEditorial
Median and Kth of Two Sorted Arrays
- Median of Two Sorted ArraysHardBinary Search
On Answer / Condition Function
- Koko Eating BananasMediumBinary SearchEditorial
- Capacity to Ship Packages Within D DaysMediumBinary SearchEditorial
- Split Array Largest SumHardBinary Search
Stack Patterns
Valid Parentheses Matching
- Valid ParenthesesEasyStack
- Valid Parenthesis StringMediumGreedyEditorial
Monotonic Stack
- Daily TemperaturesMediumStackEditorial
- Online Stock SpanMediumStack
- Car FleetMediumStackEditorial
Stack - Min Stack Design
- Min StackMediumStack
- Maximum Frequency StackHardStack
Simulation / Backtracking Helper
- Baseball GameEasyStack
- Asteroid CollisionMediumStackEditorial
- Simplify PathMediumStack
- Decode StringMediumStackEditorial
- Reconstruct ItineraryHardAdvanced GraphsEditorial
String Manipulation Patterns
Repeated Substring Pattern Detection
- Greatest Common Divisor of StringsEasyMath & Geometry
Naive / KMP / Rabin-Karp
- Longest Common PrefixEasyArrays & Hashing
Palindrome Check (Two Pointers / Reverse)
- Valid PalindromeEasyTwo Pointers
- Valid Palindrome IIEasyTwo Pointers
Integer and Roman Conversion
- Excel Sheet Column TitleEasyMath & Geometry
- Roman to IntegerEasyMath & Geometry
Heap (Priority Queue) Patterns
K-way Merge
- Merge K Sorted ListsHardLinked List
- Design TwitterMediumHeap / Priority QueueEditorial
Top K Elements (Selection/Frequency)
- Top K Frequent ElementsMediumArrays & Hashing
- Kth Largest Element In a StreamEasyHeap / Priority QueueEditorial
- Last Stone WeightEasyHeap / Priority QueueEditorial
- K Closest Points to OriginMediumHeap / Priority QueueEditorial
- Kth Largest Element In An ArrayMediumHeap / Priority QueueEditorial
Scheduling / Minimum Cost (Greedy with Priority Queue)
- Single Threaded CPUMediumHeap / Priority Queue
- Reorganize StringMediumHeap / Priority Queue
- Longest Happy StringMediumHeap / Priority Queue
- IPOHardHeap / Priority Queue
- Meeting Rooms IIMediumIntervals
- Meeting Rooms IIIHardIntervals
- Minimum Interval to Include Each QueryHardIntervalsEditorial
Two Heaps for Median Finding
- Find Median From Data StreamHardHeap / Priority QueueEditorial
Tree Traversal Patterns (DFS & BFS)
Recursive Preorder Traversal
- Binary Tree Preorder TraversalEasyTrees
- Invert Binary TreeEasyTreesEditorial
- Same TreeEasyTrees
- Insert into a Binary Search TreeMediumTrees
- Construct Quad TreeMediumTrees
- Count Good Nodes In Binary TreeMediumTreesEditorial
- Construct Binary Tree From Preorder And Inorder TraversalMediumTreesEditorial
Recursive Inorder Traversal
- Binary Tree Inorder TraversalEasyTrees
- Delete Node in a BSTMediumTrees
- Validate Binary Search TreeMediumTrees
- Kth Smallest Element In a BstMediumTreesEditorial
Level Order Traversal
- Binary Tree Level Order TraversalMediumTreesEditorial
- Binary Tree Right Side ViewMediumTreesEditorial
Recursive Postorder Traversal
- Binary Tree Postorder TraversalEasyTreesEditorial
- Maximum Depth of Binary TreeEasyTrees
- Diameter of Binary TreeEasyTreesEditorial
- Balanced Binary TreeEasyTreesEditorial
- House Robber IIIMediumTreesEditorial
- Delete Leaves With a Given ValueMediumTrees
- Binary Tree Maximum Path SumHardTreesEditorial
Graph Traversal Patterns (DFS & BFS)
Graph DFS - Connected Components / Island Counting
- Island PerimeterEasyGraphs
- Number of IslandsMediumGraphs
- Max Area of IslandMediumGraphs
- Pacific Atlantic Water FlowMediumGraphs
- Surrounded RegionsMediumGraphs
- Evaluate DivisionMediumGraphs
Graph BFS - Connected Components / Island Counting
- Walls And GatesMediumGraphsEditorial
- Rotting OrangesMediumGraphs
- Word LadderHardGraphs
Graph BFS - Topological Sort (Kahn's Algorithm)
- Course Schedule IVMediumGraphs
- Minimum Height TreesMediumGraphs
- Alien DictionaryHardAdvanced GraphsEditorial
- Build a Matrix With ConditionsHardAdvanced GraphsEditorial
Graph DFS - Cycle Detection (Directed Graph)
- Course ScheduleMediumGraphsEditorial
- Course Schedule IIMediumGraphsEditorial
Shortest Path (Bellman-Ford / BFS+K)
- Cheapest Flights Within K StopsMediumAdvanced GraphsEditorial
Shortest Path (Dijkstra's Algorithm)
- Path with Minimum EffortMediumAdvanced Graphs
- Network Delay TimeMediumAdvanced Graphs
- Swim In Rising WaterHardAdvanced Graphs
Deep Copy / Cloning
- Copy List With Random PointerMediumLinked ListEditorial
- Clone GraphMediumGraphsEditorial
Bridges & Articulation Points (Tarjan low-link)
- Find Critical and Pseudo Critical Edges in Minimum Spanning TreeHardAdvanced GraphsEditorial
Union-Find (Disjoint Set Union - DSU)
- Graph Valid TreeMediumGraphsEditorial
- Number of Connected Components In An Undirected GraphMediumGraphs
- Redundant ConnectionMediumGraphs
- Accounts MergeMediumGraphsEditorial
- Greatest Common Divisor TraversalHardAdvanced Graphs
Minimum Spanning Tree (Kruskal / Prim / DSU + heap)
- Min Cost to Connect All PointsMediumAdvanced Graphs
Greedy Patterns
Jump Game Reachability/Minimization
- Jump GameMediumGreedyEditorial
- Jump Game IIMediumGreedyEditorial
Sorting Based
- Sort an ArrayMediumArrays & Hashing
- Lemonade ChangeEasyGreedy
- Hand of StraightsMediumGreedyEditorial
- Merge Triplets to Form Target TripletMediumGreedyEditorial
- CandyHardGreedyEditorial
Task Scheduling (Frequency Based)
- Task SchedulerMediumHeap / Priority Queue
- Dota2 SenateMediumGreedy
Interval Merging/Scheduling
- Insert IntervalMediumIntervalsEditorial
- Merge IntervalsMediumIntervals
- Non Overlapping IntervalsMediumIntervalsEditorial
- Meeting RoomsEasyIntervalsEditorial
Line Sweep
- Car PoolingMediumHeap / Priority Queue
- Partition LabelsMediumGreedyEditorial
Gas Station Circuit
- Gas StationMediumGreedyEditorial
Backtracking Patterns
Word Search / Path Finding in Grid
- Word SearchMediumBacktracking
- Word Search IIHardTries
N-Queens / Constraint Satisfaction
- Matchsticks to SquareMediumBacktracking
- N QueensHardBacktracking
- N Queens IIHardBacktracking
Permutations
- PermutationsMediumBacktracking
- Permutations IIMediumBacktracking
Palindrome Partitioning
- Palindrome PartitioningMediumBacktracking
Combination Sum
- Combination SumMediumBacktrackingEditorial
- Combination Sum IIMediumBacktrackingEditorial
- Partition to K Equal Sum SubsetsMediumBacktracking
Subsets (Include/Exclude)
- Sum of All Subsets XOR TotalEasyBacktracking
- SubsetsMediumBacktracking
- CombinationsMediumBacktrackingEditorial
- Subsets IIMediumBacktracking
- Letter Combinations of a Phone NumberMediumBacktrackingEditorial
Dynamic Programming (DP) Patterns
2D Array (Edit Distance / Levenshtein Distance)
- Edit DistanceMedium2-D Dynamic ProgrammingEditorial
- Regular Expression MatchingHard2-D Dynamic ProgrammingEditorial
1D Array (Kadane's Algorithm for Max/Min Subarray)
- Maximum Product SubarrayMedium1-D Dynamic Programming
- Maximum SubarrayMediumGreedy
- Maximum Sum Circular SubarrayMediumGreedy
Interval DP
- Stone GameMedium2-D Dynamic Programming
- Stone Game IIMedium2-D Dynamic Programming
- Burst BalloonsHard2-D Dynamic ProgrammingEditorial
2D Array (Unique Paths on Grid)
- Unique PathsMedium2-D Dynamic Programming
- Unique Paths IIMedium2-D Dynamic Programming
- Minimum Path SumMedium2-D Dynamic Programming
- Interleaving StringMedium2-D Dynamic ProgrammingEditorial
- Longest Increasing Path In a MatrixHard2-D Dynamic ProgrammingEditorial
1D Array (Fibonacci Style)
- Climbing StairsEasy1-D Dynamic ProgrammingEditorial
- Min Cost Climbing StairsEasy1-D Dynamic Programming
- N-th Tribonacci NumberEasy1-D Dynamic Programming
- House RobberMedium1-D Dynamic ProgrammingEditorial
- House Robber IIMedium1-D Dynamic ProgrammingEditorial
- Decode WaysMedium1-D Dynamic ProgrammingEditorial
- Integer BreakMedium1-D Dynamic Programming
- Stone Game IIIHard1-D Dynamic Programming
1D Array (0/1 Knapsack Subset Sum Style)
- Partition Equal Subset SumMedium1-D Dynamic Programming
- Last Stone Weight IIMedium2-D Dynamic Programming
- Target SumMedium2-D Dynamic Programming
2D Array (Longest Common Subsequence - LCS)
- Longest Common SubsequenceMedium2-D Dynamic Programming
- Distinct SubsequencesHard2-D Dynamic ProgrammingEditorial
1D Array (Word Break Style)
- Word Break IIHardBacktracking
- Word BreakMedium1-D Dynamic Programming
Stock problems
- Best Time to Buy And Sell Stock IIMediumArrays & HashingEditorial
- Best Time to Buy And Sell StockEasySliding WindowEditorial
- Best Time to Buy And Sell Stock With CooldownMedium2-D Dynamic ProgrammingEditorial
1D Array (Coin Change / Unbounded Knapsack Style)
- Coin ChangeMedium1-D Dynamic ProgrammingEditorial
- Combination Sum IVMedium1-D Dynamic ProgrammingEditorial
- Perfect SquaresMedium1-D Dynamic Programming
- Coin Change IIMedium2-D Dynamic ProgrammingEditorial
Longest Increasing Subsequence (LIS)
- Longest Increasing SubsequenceMedium1-D Dynamic Programming
Bit Manipulation Patterns
Bitwise Operations - Power of Two/Four Check
- Pow(x, n)MediumMath & GeometryEditorial
- Bitwise AND of Numbers RangeMediumBit Manipulation
- Minimum Array EndMediumBit Manipulation
Bitwise XOR - Finding Single/Missing Number
- Single NumberEasyBit Manipulation
- Missing NumberEasyBit Manipulation
- Sum of Two IntegersMediumBit ManipulationEditorial
Bitwise DP - Counting Bits Optimization
- Counting BitsEasyBit ManipulationEditorial
Bitwise AND - Counting Set Bits (Hamming Weight)
- Number of 1 BitsEasyBit Manipulation
- Reverse BitsEasyBit ManipulationEditorial
Design Patterns
Tries
- Implement Trie Prefix TreeMediumTriesEditorial
- Design Add And Search Words Data StructureMediumTriesEditorial
- Extra Characters in a StringMediumTries
Design (General/Specific)
- Design HashMapEasyArrays & HashingEditorial
- Encode and Decode StringsMediumArrays & HashingEditorial
- Implement Stack Using QueuesEasyStackEditorial
- Implement Queue using StacksEasyStackEditorial
- Time Based Key Value StoreMediumBinary Search
- Design Circular QueueMediumLinked ListEditorial
- LRU CacheMediumLinked List
- LFU CacheHardLinked ListEditorial
- Detect SquaresMediumMath & GeometryEditorial
A study plan for the NeetCode 250
Six blocks in NeetCode's topic order. Solve each problem, then write down the pattern in one line. On the last day of each week, re-solve two problems from memory before starting the next block.
Weeks 1-3: Arrays, two pointers, sliding window and stacks (59 problems)
Hash maps for lookups, the two pointer moves, when a window grows and shrinks, and the monotonic stack.
Weeks 4-5: Binary search and linked lists (28 problems)
Searching on the answer, not just the array, and pointer surgery on lists without losing a node.
Weeks 6-7: Trees, tries and heaps (39 problems)
Recursive DFS that returns something useful, level-order BFS, prefix trees, and top-k with a heap.
Weeks 8-9: Backtracking and graphs (47 problems)
Choose, explore, un-choose; grid BFS and DFS; union-find; topological sort; Dijkstra and minimum spanning trees.
Weeks 10-11: Dynamic programming (33 problems)
State, transition and base case, written out loud before any code; then the 2-D grid and string tables.
Week 12: Greedy, intervals, math and bits (44 problems)
Proving a greedy choice, sorting intervals by start, matrix walks, and XOR tricks.
Questions, answered
- What is the NeetCode 250?
- The NeetCode 250 is a list of 250 LeetCode problems put together by NeetCode (neetcode.io) to cover the topics coding interviews draw on, from arrays and hashing to graphs and dynamic programming. This page is the NeetCode 250 list, practised on thita. Thita is not affiliated with NeetCode; the list name is used only to say which problems are here.
- What is the difference between the NeetCode 150 and the NeetCode 250?
- The NeetCode 250 contains all 150 problems of the NeetCode 150 plus 100 more: 54 Medium, 32 Easy and 14 Hard. They add more practice per topic, including easier warm-ups that help if a topic is new to you. If you have under two months, the 150 is the better fit; if you have three months or want more repetition per pattern, take the 250. All 75 problems of the Blind 75 are in the NeetCode 150.
- Why are the problems grouped by pattern instead of by NeetCode's topics?
- A topic says which data structure a problem uses; a pattern says which move solves it. "Trees" covers both a level-order BFS and a postorder DFS that returns heights, and interviewers test whether you can tell those apart. Grouping by thita's 99 patterns puts problems that are solved the same way next to each other. NeetCode's topic is still shown on every problem.
- Which languages can I practise the NeetCode 250 in?
- Every problem on the NeetCode 250 that is live on thita runs in all 6 of Python, C++, Java, JavaScript, Go and C#. Your code runs against the problem's test cases in the browser, with no setup or local compiler.
- Are all 250 problems available on thita?
- All 250 problems are on thita.
- Is it free?
- Browsing the list and running your code against the test cases is free on the Starter plan, which also includes unlimited AI coach sessions, 5 AI credits a month for Code Coach reviews and the free AI mock interview allowance. Editorials marked on this page are free to read. Pro adds 100 AI credits a month, more mock interviews and the remaining editorials.
- How long does the NeetCode 250 take?
- The plan on this page spreads it over twelve weeks at about three problems a day, with a review day each week. Going faster works if you already know most patterns; the risk is solving each problem once and not being able to rebuild the approach a month later.
- Is the NeetCode 250 enough to pass coding interviews?
- It covers the core patterns most coding rounds draw on, but solving a list is not the same as solving a new problem under time pressure while explaining yourself. Use the list to learn the patterns, then practise unseen problems from the same patterns and rehearse out loud. The NeetCode 150 is the natural shorter alternative.
Keep going
- Blind 75 sheet
- NeetCode 150 sheet
- Practise these problems in an AI coding interview
- NeetCode 150 vs NeetCode 250 vs Blind 75: which to do
- A NeetCode 150 study plan for 4, 8 or 12 weeks
- Is the NeetCode 150 enough for FAANG?
- The NeetCode 250, the complete list by topic
- The NeetCode 150 in Java
- The NeetCode 150 in C++
- The NeetCode 150 in Go
- The NeetCode 150 in C#
- Blind 75 vs NeetCode vs pattern-based preparation
NeetCode is a trademark of its owner; thita is not affiliated with or endorsed by NeetCode.