Heap & Priority Queue
A complete binary tree where the parent is always <= (min-heap) or >= (max-heap) its children -- gives O(1) access to the min or max element.
A complete binary tree where the parent is always <= (min-heap) or >= (max-heap) its children -- gives O(1) access to the min or max element.
Protect services from overload and abuse by controlling request rates -- token bucket is the industry standard, sliding window counter provides accuracy at scale.
Distribute incoming traffic across multiple servers to maximize throughput, minimize latency, and prevent overload -- least connections for general workloads, consistent hashing for stateful services, Maglev hashing for massive scale.
DP solves optimization problems by caching subproblem results -- reducing exponential time complexity to polynomial. Essential for system design: resource allocation, query optimization, cost modeling, and capacity planning.
Map arbitrary data to fixed-size digests -- used for integrity, identity, distribution, and authentication across every layer of a system.
Choosing the right sort determines latency, memory usage, and scalability in distributed systems -- O(n log n) on small datasets vs. O(n + k) for structured data vs. external merge sort for big data.