CodingNodes System design

223 interview problems,
step by step.

Every problem from NeetCode 150 and LeetCode's Top Interview 150, grouped by pattern. Each one is solved up to two ways in Python, Java and C++, with an animated walkthrough of the example input that shows how every variable changes, plus the time and space complexity.

Arrays & Hashing

31 animated solutions
Contains Duplicate
#hash set #sorting #arrays
EasyNeetCode 150 ▶ Watch
Contains Duplicate II
#hash map #arrays #hashing
EasyTop Interview 150 ▶ Watch
Find the Index of the First Occurrence in a String
#arrays #hashing
EasyTop Interview 150 ▶ Watch
Isomorphic Strings
#arrays #hashing
EasyTop Interview 150 ▶ Watch
Length of Last Word
#arrays #hashing
EasyTop Interview 150 ▶ Watch
Longest Common Prefix
#arrays #hashing
EasyTop Interview 150 ▶ Watch
Majority Element
#boyer-moore voting #hash map #arrays
EasyTop Interview 150 ▶ Watch
Merge Sorted Array
#arrays #hashing
EasyTop Interview 150 ▶ Watch
Ransom Note
#arrays #hashing
EasyTop Interview 150 ▶ Watch
Remove Duplicates from Sorted Array
#two pointers #sorting #arrays
EasyTop Interview 150 ▶ Watch
Remove Element
#two pointers #arrays #hashing
EasyTop Interview 150 ▶ Watch
Roman to Integer
#arrays #hashing
EasyTop Interview 150 ▶ Watch
Two Sum
#hash map #arrays #hashing
EasyNeetCode 150Top Interview 150 ▶ Watch
Valid Anagram
#arrays #hashing
EasyNeetCode 150Top Interview 150 ▶ Watch
Word Pattern
#arrays #hashing
EasyTop Interview 150 ▶ Watch
Best Time to Buy and Sell Stock II
#arrays #hashing
MediumTop Interview 150 ▶ Watch
Encode and Decode Strings
#arrays #hashing
MediumNeetCode 150 ▶ Watch
Group Anagrams
#sorting #arrays #hashing
MediumNeetCode 150Top Interview 150 ▶ Watch
H-Index
#sorting #arrays #hashing
MediumTop Interview 150 ▶ Watch
Insert Delete GetRandom O(1)
#arrays #hashing
MediumTop Interview 150 ▶ Watch
Integer to Roman
#greedy #arrays #hashing
MediumTop Interview 150 ▶ Watch
Longest Consecutive Sequence
#hash set #sorting #arrays
MediumNeetCode 150Top Interview 150 ▶ Watch
Product of Array Except Self
#prefix product #arrays #hashing
MediumNeetCode 150Top Interview 150 ▶ Watch
Remove Duplicates from Sorted Array II
#two pointers #sorting #arrays
MediumTop Interview 150 ▶ Watch
Reverse Words in a String
#arrays #hashing
MediumTop Interview 150 ▶ Watch
Rotate Array
#arrays #hashing
MediumTop Interview 150 ▶ Watch
Top K Frequent Elements
#bucket sort #top k #hash map
MediumNeetCode 150 ▶ Watch
Valid Sudoku
#arrays #hashing
MediumNeetCode 150Top Interview 150 ▶ Watch
Zigzag Conversion
#arrays #hashing
MediumTop Interview 150 ▶ Watch
Candy
#arrays #hashing
HardTop Interview 150 ▶ Watch
Text Justification
#greedy #arrays #hashing
HardTop Interview 150 ▶ Watch

Two Pointers

6 animated solutions

Sliding Window

8 animated solutions

Stack

9 animated solutions

Linked List

16 animated solutions

Trees

29 animated solutions
Average of Levels in Binary Tree
#queue #bfs #binary tree
EasyTop Interview 150 ▶ Watch
Balanced Binary Tree
#binary tree
EasyNeetCode 150 ▶ Watch
Convert Sorted Array to Binary Search Tree
#sorting #binary tree
EasyTop Interview 150 ▶ Watch
Diameter of Binary Tree
#binary tree
EasyNeetCode 150 ▶ Watch
Invert Binary Tree
#binary tree
EasyNeetCode 150Top Interview 150 ▶ Watch
Maximum Depth of Binary Tree
#queue #bfs #recursion
EasyNeetCode 150Top Interview 150 ▶ Watch
Minimum Absolute Difference in BST
#binary tree
EasyTop Interview 150 ▶ Watch
Path Sum
#dfs #binary tree
EasyTop Interview 150 ▶ Watch
Same Tree
#binary tree
EasyNeetCode 150Top Interview 150 ▶ Watch
Subtree of Another Tree
#binary tree
EasyNeetCode 150 ▶ Watch
Symmetric Tree
#binary tree
EasyTop Interview 150 ▶ Watch
Binary Search Tree Iterator
#stack #binary tree
MediumTop Interview 150 ▶ Watch
Binary Tree Level Order Traversal
#bfs #level order #queue
MediumNeetCode 150Top Interview 150 ▶ Watch
Binary Tree Right Side View
#queue #bfs #binary tree
MediumNeetCode 150Top Interview 150 ▶ Watch
Binary Tree Zigzag Level Order Traversal
#bfs #binary tree
MediumTop Interview 150 ▶ Watch
Construct Binary Tree From Preorder And Inorder Traversal
#binary tree
MediumNeetCode 150Top Interview 150 ▶ Watch
Construct Binary Tree from Inorder and Postorder Traversal
#binary tree
MediumTop Interview 150 ▶ Watch
Construct Quad Tree
#recursion #binary tree
MediumTop Interview 150 ▶ Watch
Count Complete Tree Nodes
#recursion #binary tree
MediumTop Interview 150 ▶ Watch
Count Good Nodes In Binary Tree
#dfs #binary tree
MediumNeetCode 150 ▶ Watch
Flatten Binary Tree to Linked List
#binary tree
MediumTop Interview 150 ▶ Watch
Kth Smallest Element In a Bst
#stack #binary tree
MediumNeetCode 150Top Interview 150 ▶ Watch
Lowest Common Ancestor of a Binary Search Tree
#lca #bst #binary tree
MediumNeetCode 150 ▶ Watch
Lowest Common Ancestor of a Binary Tree
#dfs #binary tree
MediumTop Interview 150 ▶ Watch
Populating Next Right Pointers in Each Node II
#queue #binary tree
MediumTop Interview 150 ▶ Watch
Sum Root to Leaf Numbers
#dfs #binary tree
MediumTop Interview 150 ▶ Watch
Validate Binary Search Tree
#bst #inorder traversal #binary tree
MediumNeetCode 150Top Interview 150 ▶ Watch
Binary Tree Maximum Path Sum
#binary tree
HardNeetCode 150Top Interview 150 ▶ Watch
Serialize And Deserialize Binary Tree
#preorder traversal #tree serialization #binary tree
HardNeetCode 150 ▶ Watch

Tries

3 animated solutions

Heap / Priority Queue

9 animated solutions

Backtracking

11 animated solutions

Graphs

16 animated solutions

Advanced Graphs

6 animated solutions

1-D Dynamic Programming

12 animated solutions

2-D Dynamic Programming

17 animated solutions

Greedy

9 animated solutions

Intervals

8 animated solutions

Math & Geometry

13 animated solutions

Bit Manipulation

10 animated solutions