O
1 3 4
The Coding Interview
73 Must
Know
Terms For
Coding ∞
∞
$4 15 k
g $2
∞
2 kg
∞
Interviews $3 1 kg
∞
$10 4 kg
$10 1 kg
Begin coding interview prep -> neetcode.io
Arrays & Strings
Term Definition
Subarray A contiguous portion of an array
A sequence derived by deleting elements
Subsequence without changing their order
Elements are entirely non-decreasing or
Monotonic non-increasing
Array where the end connects to the
Circular Array beginning
Dividing array into parts based on
Partition specific criteria
Kadane's
Algorithm
Technique to find maximum sum subarray
Two Pointers Using two index pointers to solve array
problems
Sliding Window Technique of maintaining a window that
slides through an array
Prefix Sum Array where each element is sum of all
previous elements
Suffix Sum Array where each element is sum of all
elements after it
Rotation Shifting array elements by a certain offset
In-place Algorithm that transforms input without
creating another data structure
A word created by rearranging the letters of
Anagram another word or phrase, using all the original
letters exactly once
Lexicographic
Order Dictionary ordering of strings
Begin coding interview prep -> neetcode.io
Trees
Term D e ini i n
f t o
Binary Tree Tree where each node has at most two children
B T Binary ear
S ( S ch
Binary tree where left child < parent < right child
Tree )
Co m e e Binary pl t
Every level filled except possibly last, which is
Tree filled left to right
er e Binary Tree All internal nodes have exactly two children and
all leaf nodes are at same level
P f ct
Ba an e Tree Height difference between left and right
subtrees is limited (often ≤1)
l c d
Se Ba an in
lf- l c g
Automatically maintains balance after
Tree insertions/deletions (e.g., AVL, Red-Black)
Tra ersa Methods to visit all nodes (preorder, inorder,
postorder, level-order)
v l
Low es mm t Co on
Deepest node that is an ancestor of two given
A n es r
c to (LCA) nodes
S eria i a i n l z t o /
Converting a tree to/from a string
D eseria i a i n l z t o representation
D iame er t Longest path between any two nodes in a tree
e e
L v l O d r er Processing tree nodes level by level
S e men Tree
g t Data structure for range ueries
q
B FS Traversing the tree level by level
DFS Traversing the tree in a depth-first manner
Begin coding interview prep -> neetcode.io
Graphs
Term Definition
Directed / Undirected Edges with/without direction
Weighted/Unweighted Edges with/without values - known as weights
Connected
Subset of vertices where any two vertices are
Component connected by a path
Strongly Connected
In a directed graph, subset where every vertex is
Component (SCC) reachable from every other
Can be divided into two sets with no edges within
Bipartite Graph
each set
DAG (Directed Acyclic
Directed graph with no cycles
Graph)
Linear ordering of vertices where for every edge
Topological Sort
(u,v), u comes before v. Works with DAGs
Graph representation where vertices store a list
Adjacency List
of their neighbouring vertices
Traversal strategies. Short for Breadth-First Search
BFS/DFS
and Depth-First Search
MST (Minimum
Tree connecting all vertices with minimum total
Spanning Tree) edge weight. Prim’s and Kruskal’s
Bellman-Ford/Dijkstra
Shortest path algorithms
/Floyd-Warshall
Union-Find Data structure for disjoint sets operations
Cycle Detection Algorithms to find cycles in graphs
A* Algorithm Best-first search algorithm for path finding
Begin coding interview prep -> neetcode.io
Dynamic Programming
Term Definition
Memoization Cache technique to avoid redundant
calculations
Bottom-up approach using arrays to store
Tabulation
subproblem results
Snapshot of the progress you’ve made in
State
solving the larger problem
Overlapping
When the same subproblems are solved
Subproblems multiple times
The result for the current state only depends on
1 Dimensional
one previous state or a linear history, e.g. Fib
The problem depends on two varying factors,
2 Dimensional
often two strings, two sequences, or two indices
Longest Common
Finding the longest subsequence common to
Subsequence (LCS) two sequences
LIS (Longest Increasing
Finding the longest subsequence where elements
Subsequence) are in ascending order
0 / 1 Knapsack Pick the items such that profit can be maximized.
Each item can be picked at most once
Unbounded Knapsack Same as 0 / 1 Knapsack but each item can be
k unlimited times
pic ed
Begin coding interview prep -> neetcode.io
Heap & Priority Queue
Term Definition
Min Heap / Max Heap Tree-based data structure where parent is
smaller/larger than children
Heap Sort Sorting algorithm using a heap
Priority Queue Abstract data type providing efficient access to
the minimum/maximum element
Heapify Process of creating a heap from an array
K-Way Merge Merging k sorted arrays/lists (often using heaps)
Build Heap The process of running heapify() on the entire
heap to create a valid heap
Two Heaps A technique / pattern used to find the median of a
data stream using a max and a min heap
Begin coding interview prep -> neetcode.io
Backtracking
Term Definition
Subsets Set A is a subset to Set B if all of its elements are
found in Set B
Combinations Number of ways of selection and arrangement
of items where order does not matter
Permutations Number of ways of selection and arrangement
of items where order matters
Pruning Used to eliminate branches early on that can
never lead to valid solutions
A condition that must be satisfied to reach a valid
Constraint solution.
Base Case Determines when a valid solution has been found
Unique Combination Two combinations are unique if the frequency
of chosen numbers is not the same
Begin coding interview prep -> neetcode.io
Miscellaneous
Term Definition
Analyzing average performance over a sequence
Amortized Analysis
of operations
Randomized
Algorithm that uses random numbers to decide
Algorithm next step
Skip List Probabilistic data structure for efficient search
The raw time taken in seconds to execute an
Execution Time
algorithm
Stable Sorting
A sorting algorithm that maintains the
Algorithm relative order of elements after sorting
Unstable Sorting
A sorting algorithm that does not maintain the
Algorithm relative order of elements after sorting
Begin coding interview prep -> neetcode.io
Any term we missed?
let us know below!
neetcode.io