| Find a pair / complement, seen-before, count, group by key | Hash map, set, Counter, defaultdict | Built-ins, Arrays |
| Sorted array, pair that sums to X, palindrome, in-place | Two pointers | Arrays |
| Contiguous subarray / substring, “longest / shortest with condition”, “size k” | Sliding window (the condition must move one way as the window grows; with negative numbers use prefix sums) | Arrays |
| “Subarray sum equals k”, range sums | Prefix sum + hash map | Arrays |
| Sorted input, or “minimum X such that condition holds” | Binary search (on index or on the answer) | Arrays |
| “Maximum of every window of size k” | Monotonic deque | Arrays |
| Matching brackets, undo, “most recent” | Stack | Arrays |
| Next greater / smaller element, histogram, temperatures | Monotonic stack | Arrays |
| Overlapping ranges, meetings, merge / insert intervals | Sort by start, then scan (heap of end times for rooms) | Arrays |
| Linked list: cycle, middle, kth from end | Fast & slow pointers, dummy head | Linked lists |
| Tree: depth, path, validate, “return info up from children” | Recursive DFS | Trees |
| Tree “by level”, right side view, min depth | BFS with deque, loop len(q) per level | Trees |
| Grid / graph, islands, connected components, flood fill | DFS or BFS + visited set | Graphs |
| Shortest path, unweighted / “minimum steps” | BFS (multi-source if many starts) | Graphs |
| Shortest path with non-negative weights | Dijkstra (heap); negative weights need Bellman-Ford | Graphs |
| Prerequisites, dependencies, ordering, cycle in directed graph | Topological sort (Kahn’s BFS) | Graphs |
| Merge groups, redundant edge, cycle in undirected graph | Union-Find | Graphs |
| Top K, Kth largest, K closest, merge K sorted, running median | Heap (heapq), size-k heap, two heaps | Heaps |
| “Design a class that supports get / put / …” | Hash map + the right second structure | Classes & OOP |
| LRU cache, O(1) move-to-front or eviction | Dict + doubly linked list | LRU Cache |
| “Support begin / commit / rollback” | Dict + a stack of undo logs | Key-value store |
| Prefix matching, autocomplete, word dictionary | Trie | Trie |
| All subsets / permutations / combinations | Backtracking | Backtracking & DP |
| “Number of ways”, min cost, overlapping subproblems | DP (memoized recursion first) | Backtracking & DP |
| Shared counter / dict / cache touched by several threads | threading.Lock around every read-modify-write | Concurrency |
| Many network or DB calls at once | ThreadPoolExecutor, or asyncio + semaphore | Concurrency |
| CPU-heavy work in parallel | ProcessPoolExecutor (sidesteps the GIL) | Concurrency |
| Several workers pulling jobs from one Postgres table | FOR UPDATE SKIP LOCKED | Postgres |