76 Coding Interview Terms to Know Cold

TermDefinition
SubarrayA contiguous run of elements taken from an array
SubsequenceElements picked from a sequence in their original order, not necessarily next to each other
SubstringA contiguous run of characters taken from a string
SubsetAny selection of elements from a collection, where order does not matter
PermutationOne possible ordering of every element in a collection
CombinationA selection of k elements where order does not matter
MonotonicAlways moving in one direction: never decreasing or never increasing
Circular ArrayAn array whose last element is treated as next to its first
In-PlaceChanging the input directly instead of building a new copy
PartitionSplitting a collection into groups by a rule, such as around a pivot
PivotThe element a partition is built around, as in quicksort
Two PointersTwo indices that move through the data to avoid nested loops
Sliding WindowA range of the input that grows and shrinks as it moves forward
Prefix SumAn array where each entry is the total of all elements up to that point
Kadane's AlgorithmA linear scan for the largest sum of any subarray
Hash MapA structure mapping keys to values with average O(1) lookups
Hash SetA collection of unique keys with average O(1) membership checks
CollisionTwo different keys hashing to the same bucket
StackA last in, first out collection
QueueA first in, first out collection
DequeA queue that allows adding and removing at both ends
Monotonic StackA stack kept in sorted order by popping values that break the order
Linked ListNodes where each one points to the next
Doubly Linked ListA linked list whose nodes point both forward and backward
Dummy NodeA placeholder node at the head of a list that simplifies edge cases
Fast and Slow PointersTwo pointers moving at different speeds, used to find cycles or midpoints
Binary TreeA tree where each node has at most two children
Binary Search TreeA binary tree whose left subtree holds smaller values and right subtree larger values
Balanced TreeA tree whose subtree heights differ by at most one at every node
Complete TreeA tree filled level by level, with the last level filled from the left
LeafA tree node with no children
RootThe topmost node of a tree
HeightThe number of edges on the longest path from a node down to a leaf
DepthThe number of edges from the root down to a node
Lowest Common AncestorThe deepest node that has both given nodes in its subtree
TrieA tree of characters used for fast prefix lookups
HeapA complete tree where each parent is ordered before its children
Priority QueueA queue that always hands out the highest priority item next
GraphA set of vertices connected by edges
VertexA single point or node in a graph
EdgeA connection between two vertices
Directed GraphA graph whose edges point one way
Weighted GraphA graph whose edges carry a cost or distance
Adjacency ListA map from each vertex to the vertices it connects to
Adjacency MatrixAn n by n grid marking which vertices are connected
IndegreeThe number of edges pointing into a vertex
OutdegreeThe number of edges leaving a vertex
CycleA path that starts and ends at the same vertex
DAGA directed acyclic graph: directed edges and no cycles
Connected ComponentA group of vertices that can all reach one another
Depth First SearchExploring one path as deeply as possible before backing up
Breadth First SearchExploring a graph level by level with a queue
Multi-Source BFSA BFS that starts from several sources at the same time
Topological SortAn ordering of a DAG where every edge points forward
Union FindA structure that tracks which elements belong to the same group
Dijkstra's AlgorithmFinds shortest paths in a graph with non-negative weights
Minimum Spanning TreeThe cheapest set of edges that connects every vertex
RecursionA function solving a problem by calling itself on smaller inputs
Base CaseThe input a recursive function answers without calling itself
Call StackThe stack of function calls waiting for their results
BacktrackingBuilding candidates step by step and undoing choices that fail
PruningSkipping branches of a search that cannot lead to an answer
Dynamic ProgrammingSolving a problem by combining saved answers to overlapping subproblems
MemoizationCaching the results of recursive calls
TabulationFilling a table of answers from the base cases upward
Overlapping SubproblemsThe same smaller problem being solved more than once
Optimal SubstructureAn optimal answer built from optimal answers to smaller problems
Greedy AlgorithmMaking the best local choice at each step
Divide and ConquerSplitting a problem into parts, solving each, and combining the results
Binary SearchHalving a sorted search space on every step
Stable SortA sort that keeps equal elements in their original order
Time ComplexityHow running time grows as the input grows
Space ComplexityHow extra memory grows as the input grows
AmortizedThe average cost per operation over a long sequence of operations
Brute ForceTrying every possibility, usually the first solution to improve on
Edge CaseAn unusual input such as an empty array or a single element