THN Interview Prep

Master Problem Index (~250 curated)

Curated to cover ~90% of MAANG / big-MNC SDE3+ DSA rounds.

Source blend:

  • N = NeetCode 150
  • B = Blind 75
  • G = Grind 169
  • S = Striver SDE / A2Z picks
  • P = Sean Prashad pattern fills
  • H = SDE3-tier Hard (company-tagged)

Difficulty: E = Easy, M = Medium, H = Hard.

Filename convention: topics/<topic>/problems/NNN-kebab-name.md where NNN is the LeetCode number.


arrays-hashing (22)

#TitlePatternDiffSources
001Two SumHash Map LookupEN,B,G
049Group AnagramsHash Map BucketingMN,B,G
217Contains DuplicateHash SetEN,B
242Valid AnagramHash Map CountingEN,B
347Top K Frequent ElementsBucket Sort / HeapMN,B,G
271Encode and Decode StringsString EncodingMN,B
238Product of Array Except SelfPrefix SuffixMN,B,G
36Valid SudokuHash Set per Row/Col/BoxMN
128Longest Consecutive SequenceHash Set SequenceMN,B,G
1Two Sum II — sortedTwo PointersEG
167Two Sum II — Input SortedTwo PointersMN,G
88Merge Sorted ArrayTwo Pointers (in-place)EG,S
26Remove Duplicates from Sorted ArrayTwo PointersEG,S
27Remove ElementTwo PointersES
169Majority ElementBoyer-MooreEG,S
53Maximum SubarrayKadaneMN,B,G,S
152Maximum Product SubarrayDP track min/maxMN,B
121Best Time to Buy/Sell StockOne Pass MinEN,B,G
122Best Time to Buy/Sell Stock IIGreedyMG
189Rotate ArrayReverse TrickMG,S
48Rotate ImageTranspose + ReverseMN,B
54Spiral MatrixLayered TraversalMN,B

two-pointers (10)

#TitlePatternDiffSources
125Valid PalindromeTwo PointersEN,B,G
11Container With Most WaterTwo Pointers (max area)MN,B,G
153SumSort + Two PointersMN,B,G
163Sum ClosestSort + Two PointersMS
184SumSort + Nested Two PointersMS
42Trapping Rain WaterTwo Pointers / DPHN,B,G,H
75Sort ColorsDutch National FlagMG,S
283Move ZeroesTwo PointersEG
392Is SubsequenceTwo PointersEP
680Valid Palindrome IITwo Pointers + SkipEP

sliding-window (12)

#TitlePatternDiffSources
3Longest Substring Without RepeatingVariable Window + SetMN,B,G
121Best Time to Buy/Sell StockMin-windowEN,B
424Longest Repeating Character ReplacementWindow + countsMN,B
567Permutation in StringFixed Window + countsMN
76Minimum Window SubstringVariable Window + need-haveHN,B,G,H
239Sliding Window MaximumMonotonic DequeHN,B,G,H
209Minimum Size Subarray SumVariable WindowMG,P
904Fruit Into BasketsWindow with k=2 distinctMP
1004Max Consecutive Ones IIIWindow with k flipsMP
438Find All Anagrams in a StringFixed Window + countsMP
30Substring with Concatenation of All WordsFixed Window + mapHP,H
992Subarrays with K Different IntegersWindow AtMost(K) - AtMost(K-1)HH

stack (10)

#TitlePatternDiffSources
20Valid ParenthesesStack MatchEN,B,G
155Min StackStack + MinMN,B,G
150Evaluate Reverse Polish NotationStackMN,B
22Generate ParenthesesBacktracking + StackMN,B,G
739Daily TemperaturesMonotonic StackMN,B,G
853Car FleetSort + StackMN
84Largest Rectangle in HistogramMonotonic StackHN,B,G,H
71Simplify PathStackMP
232Implement Queue using StacksTwo StacksEP
394Decode StringStackMP

binary-search (12)

#TitlePatternDiffSources
704Binary SearchVanillaEN,G
74Search a 2D MatrixBS on flattenedMN,B
875Koko Eating BananasBS on AnswerMN,B
153Find Min in Rotated Sorted ArrayBS on rotationMN,B,G
33Search in Rotated Sorted ArrayBS modifiedMN,B,G
981Time Based Key-Value StoreBS on timestampsMN,B
4Median of Two Sorted ArraysBS partitionHN,B,G,H
35Search Insert PositionBS lower-boundEG
162Find Peak ElementBS on slopeMP
410Split Array Largest SumBS on AnswerHH,P
1011Capacity to Ship Packages in D DaysBS on AnswerMP
540Single Element in Sorted ArrayBS pair invariantMP

linked-list (14)

#TitlePatternDiffSources
206Reverse Linked ListIn-place reversalEN,B,G
21Merge Two Sorted ListsMergeEN,B,G
143Reorder ListFind mid + reverse + mergeMN,B
19Remove Nth From EndTwo pointersMN,B,G
138Copy List with Random PointerHash map / interleaveMN,B
2Add Two NumbersLinked-list arithmeticMN,B,G
141Linked List CycleFloyd'sEN,B,G
142Linked List Cycle IIFloyd's + entryMN,G
287Find the Duplicate NumberFloyd on indicesMN,B
146LRU CacheHash + DLLMN,B,G
23Merge K Sorted ListsHeap / DivideHN,B,G,H
25Reverse Nodes in K-GroupIn-place reversalHN,B,H
92Reverse Linked List IIIn-place sublist reversalMP
234Palindrome Linked ListMid + reverseEP

trees (22)

#TitlePatternDiffSources
226Invert Binary TreeDFSEN,B,G
104Maximum Depth of Binary TreeDFSEN,B,G
543Diameter of Binary TreeDP-on-treeEN,B
110Balanced Binary TreePost-orderEN,B
100Same TreeDFSEN,B
572Subtree of Another TreeDFS + isSameEN,B
235LCA of BSTBST propertyMN,B
102Binary Tree Level Order TraversalBFSMN,B,G
199Binary Tree Right Side ViewBFSMN,B
1448Count Good Nodes in Binary TreeDFS + max-on-pathMN
98Validate BSTDFS w/ boundsMN,B,G
230Kth Smallest in BSTInorderMN,B
105Build Tree from Preorder + InorderDFSMN,B,G
124Binary Tree Maximum Path SumDP-on-treeHN,B,G,H
297Serialize/Deserialize Binary TreeDFS stringHN,B,G,H
116Populating Next Right PointersBFS / O(1) spaceMP
437Path Sum IIIPrefix sum on treeMP
113Path Sum IIBacktrackingMS
236LCA of Binary TreeDFSMG,S
257Binary Tree PathsBacktrackingES
222Count Complete Tree NodesBS + heightsEP
173Binary Search Tree IteratorStack inorderMP

tries (5)

#TitlePatternDiffSources
208Implement TrieTrie basicMN,B,G
211Design Add and Search WordsTrie + DFS wildcardsMN,B
212Word Search IITrie + BacktrackingHN,B,G,H
648Replace WordsTrieMP
1268Search Suggestions SystemTrie / Sort+BSMP

heap-priority-queue (10)

#TitlePatternDiffSources
703Kth Largest in StreamMin-heap of size kEN
1046Last Stone WeightMax-heapEN,G
973K Closest Points to OriginMin-heap by distanceMN,G
215Kth Largest Element in ArrayHeap / QuickselectMN,B,G
621Task SchedulerHeap + cooldownMN,B
355Design TwitterHeap + mapMN
295Find Median from Data StreamTwo heapsHN,B,G,H
502IPOTwo heaps (min on cost, max on profit)HH
632Smallest Range Covering K ListsHeap + slidingHH
1834Single-Threaded CPUHeap by processing timeMP

backtracking (10)

#TitlePatternDiffSources
78SubsetsBacktrackingMN,B,G
39Combination SumBacktracking + reuseMN,B,G
40Combination Sum IIBacktracking + dedupeMN
46PermutationsBacktrackingMN,B,G
90Subsets IIBacktracking + dedupeMN
79Word SearchDFS + backtrackingMN,B,G
131Palindrome PartitioningBacktrackingMN,B
17Letter Combinations of a Phone NumberBacktrackingMN,G
51N-QueensBacktrackingHN,B,G,H
698Partition to K Equal Sum SubsetsBacktracking + bitmaskMP

graphs (22)

#TitlePatternDiffSources
200Number of IslandsDFS / BFS / Union-FindMN,B,G
695Max Area of IslandDFSMG
133Clone GraphDFS + mapMN,B
207Course ScheduleTopo SortMN,B,G
210Course Schedule IITopo SortMN,G
417Pacific Atlantic Water FlowMulti-source DFSMN
130Surrounded RegionsDFS from boundaryMN,B
994Rotting OrangesMulti-source BFSMN,B
286Walls and GatesMulti-source BFSMN
127Word LadderBFS on transformationsHN,B,G,H
261Graph Valid TreeUnion-Find / DFSMN
323Number of Connected ComponentsUnion-FindMN
547Number of ProvincesUnion-Find / DFSMG,S
684Redundant ConnectionUnion-FindMP
743Network Delay TimeDijkstraMN
787Cheapest Flights Within K StopsBellman-Ford / BFSMN
1584Min Cost to Connect All PointsPrim/Kruskal MSTMN
778Swim in Rising WaterDijkstra / Union-FindHN,H
332Reconstruct ItineraryHierholzer (Eulerian)HN,H
269Alien DictionaryTopo SortHN,B,G,H
305Number of Islands IIUnion-Find dynamicHH
1976Number of Ways to Arrive at DestinationDijkstra + DPMP

advanced-graphs (8)

#TitlePatternDiffSources
1192Critical ConnectionsTarjan bridgesHH
685Redundant Connection IIUnion-Find directedHH
802Find Eventual Safe StatesReverse topo / DFS colorMP
815Bus RoutesBFS on routesHH
1334Find the City With Smallest Number of Reachable NeighborsFloyd-WarshallMP
847Shortest Path Visiting All NodesBFS + bitmaskHH
1631Path With Minimum EffortDijkstra / BS+BFSMP
924Minimize Malware SpreadUnion-Find + countingHH

dp-1d (14)

#TitlePatternDiffSources
70Climbing StairsDP basicEN,B,G
198House RobberDP take-or-skipMN,B,G
213House Robber IIDP circularMN
5Longest Palindromic SubstringDP / expandMN,B,G
647Palindromic SubstringsDP / expandMN
91Decode WaysDPMN,B
322Coin ChangeUnbounded Knapsack DPMN,B,G
152Maximum Product SubarrayDP min/maxMN,B
139Word BreakDP + TrieMN,B,G
300Longest Increasing SubsequenceDP / patience BSMN,B,G
416Partition Equal Subset Sum0/1 KnapsackMN
746Min Cost Climbing StairsDP basicEG
32Longest Valid ParenthesesDP / StackHH,P
132Palindrome Partitioning IIDP min cutsHH

dp-2d (14)

#TitlePatternDiffSources
62Unique PathsGrid DPMN,B,G
63Unique Paths IIGrid DP w/ obstaclesMG
1143Longest Common SubsequenceDP tableMN,B,G
309Best Time to Buy/Sell Stock with CooldownDP statesMN,B
518Coin Change 2Unbounded knapsack countMN
494Target SumDP / KnapsackMN
97Interleaving StringDP tableMN
329Longest Increasing Path in a MatrixDP + DFS memoHN,H
115Distinct SubsequencesDP tableHN,H
72Edit DistanceDP tableHN,B,G,H
312Burst BalloonsInterval DPHN,H
10Regular Expression MatchingDP tableHN,H
174Dungeon GameDP back-propHH
887Super Egg DropDP + BSHH

greedy (10)

#TitlePatternDiffSources
53Maximum SubarrayKadaneMN,B
55Jump GameGreedy farthestMN,B,G
45Jump Game IIGreedy BFS-likeMN
134Gas StationGreedyMN
846Hand of StraightsGreedy + mapMN
1899Merge Triplets to Form TargetGreedy filterMN
763Partition LabelsGreedy + last-occurrenceMN,G
678Valid Parenthesis StringGreedy / two stacksMN
56Merge IntervalsSort + mergeMN,B,G
435Non-overlapping IntervalsGreedy by endMN,B

intervals (6)

#TitlePatternDiffSources
57Insert IntervalMergeMN,B,G
252Meeting RoomsSort by startEN
253Meeting Rooms IIHeap of end-timesMN,B,G
1851Min Interval to Include Each QueryHeap + sortHN,H
986Interval List IntersectionsTwo PointersMP
218The Skyline ProblemHeap + sweepHH

math-geometry (10)

#TitlePatternDiffSources
202Happy NumberCycle detectionEP
50Pow(x, n)Fast exponentiationMN,B,G
66Plus OneMath simEN
9Palindrome NumberReverse halfEG
7Reverse IntegerMath + overflowMG
8String to Integer (atoi)ParsingMG
43Multiply StringsString mathMP
149Max Points on a LineHash slopeHH
233Number of Digit OneDigit DP / mathHH
372Super PowModular exponentiationMP

bit-manipulation (8)

#TitlePatternDiffSources
136Single NumberXOREN,B,G
137Single Number IIBit count mod 3MP
191Number of 1 BitsBrian KernighanEN
338Counting BitsDP + bitEN,B
190Reverse BitsBit opsEN,B
268Missing NumberXOR / sumEN
371Sum of Two IntegersBit addMN
7Reverse IntegerOverflow checkMN

system-design-coding (15)

These are "design X" coding problems — they bridge DSA and LLD.

#TitlePatternDiffSources
146LRU CacheHash + DLLMN,B,G
460LFU CacheTwo-level hash + DLLHH
380Insert Delete GetRandom O(1)Hash + Array swap-removeMN,P
381Insert Delete GetRandom O(1) Allow DuplicatesHash + ArrayHH
432All O`one Data StructureDLL of buckets + hashHH
295Find Median from Data StreamTwo heapsHN
355Design TwitterHeap + mapMN
1166Design File SystemTrieMP
1396Design Underground SystemHash mapsMP
706Design HashMapBucket arrayEP
707Design Linked ListLinked list opsMP
622Design Circular QueueArray + ptrsMP
641Design Circular DequeArray + ptrsMP
588Design In-Memory File SystemTrie + mapHH
642Design Search Autocomplete SystemTrie + heapHH

Totals

19 topics, 254 problems. Adjust ±5 during execution if duplicates collapse.

Note: a few problems appear in two topics (e.g. 53 in arrays-hashing and greedy, 121 in arrays-hashing and sliding-window, 7 in math and bit). The canonical file lives in the topic listed first; other appearances are aliases via Similar Problems cross-link only — no duplicate file.

Canonical assignment when duplicated:

  • 53 -> arrays-hashing (Kadane is the headline)
  • 121 -> arrays-hashing (one-pass min, not classical window)
  • 152 -> dp-1d (DP track min/max is the headline)
  • 7 -> math-geometry
  • 295 -> heap-priority-queue (system-design-coding row references it)
  • 146 -> linked-list (system-design-coding row references it)
  • 355 -> heap-priority-queue (system-design-coding row references it)

Final canonical count: 226 unique problem files in topics/**/problems/*.md (one file per LeetCode number; deduped: 152 only under dp-1d/, 121 / 7 / 53 / 146 / 295 / 355 each appear once per canonical topic assignment).

Last updated on

Spotted something unclear or wrong on this page?

On this page