Browse concepts
the sliding window technique
The sliding window technique solves array and string problems by maintaining a moving range instead of recomputing from scratch.
the two pointers technique
The two pointers technique uses two indices moving through a structure to solve pair, partition, and in-place problems efficiently.
binary search
Binary search finds a target in sorted data in O(log n) by repeatedly halving the search range.
dynamic programming
Dynamic programming solves problems by breaking them into overlapping subproblems and reusing stored results.
recursion and backtracking
Recursion solves problems by self-reference; backtracking explores choices and undoes them when they fail.
breadth-first search (BFS)
Breadth-first search explores a graph level by level using a queue, finding shortest paths in unweighted graphs.
depth-first search (DFS)
Depth-first search explores a graph as deep as possible before backtracking, using recursion or a stack.
a hash map
A hash map stores key-value pairs with average O(1) lookup by hashing keys into buckets.
heaps and priority queues
A heap is a tree-based structure that gives fast access to the min or max; a priority queue is often built on one.
a graph in interviews
A graph models entities and relationships as nodes and edges, underlying traversal, shortest-path, and connectivity problems.
trees and binary search trees
Trees are hierarchical structures; a binary search tree keeps sorted order for O(log n) search when balanced.
Big O notation
Big O notation describes how an algorithm scales in time or space as input size grows.
consistent hashing
Consistent hashing distributes keys across servers so that adding or removing a node moves few keys.
the CAP theorem
The CAP theorem says a distributed system can guarantee only two of consistency, availability, and partition tolerance during a partition.
load balancing
Load balancing spreads traffic across multiple servers to improve throughput, availability, and reliability.
caching
Caching stores frequently used data close to consumers to reduce latency and load on the source.
database sharding
Sharding splits a database horizontally across servers so each holds a subset of the data.
a message queue
A message queue decouples producers and consumers by buffering messages for asynchronous processing.
rate limiting
Rate limiting caps how many requests a client can make in a time window to protect a service.
database indexing
A database index is a data structure that speeds up reads at the cost of extra storage and slower writes.