Coding Interview Prep Guide
Learn the patterns, then drill them on runnable challenges.
Grinding hundreds of random problems is the slow path. Coding interviews reuse a small set of patterns - two pointers, sliding window, binary search, graph traversal, dynamic programming - and the fast way through is to learn each pattern once, then recognize it under interview pressure. Pattern recognition is the skill being tested far more than raw problem count.
Start with the core-concept primers to build the mental model for each pattern, then drill them on the practical challenges - every one runs in the in-browser compiler with real test cases, so you practice the way the interview feels rather than reading solutions. Mark what you finish and let active recall do the rest.
- Recursion
A function that calls itself on a smaller input - the call stack handles bookkeeping so you only need to define the base case and the recursive step, trusting that smaller subproblems are already solved.
Coding Prep10m2mo - Arrays
The most fundamental data structure - contiguous memory, O(1) access, and the three patterns (two pointers, sliding window, prefix sums) that unlock most array interview problems.
Coding Prep12m2mo - Binary Search
Halving the search space - how binary search achieves O(log n), how to get the boundary conditions right, and how to apply the same idea beyond sorted arrays to any problem with a monotonic feasibility check.
Coding Prep10m2mo - Climbing Stairs
Count distinct ways to reach the top of n stairs climbing 1 or 2 steps at a time - a Fibonacci recurrence solvable in O(1) space with two rolling variables.
Coding Prepeasy8m2mo - Contains Duplicate
Seen-before check with a set: O(1) membership test replaces an O(n) scan per element.
Coding Prepeasy8m2mo - Fibonacci Number
Compute the nth Fibonacci number recursively - the naive O(2^n) call tree collapses to O(n) once overlapping subproblems are cached with memoization.
Coding Prepeasy8m2mo - Implement Trie (Prefix Tree)
Build insert, search (exact match), and starts_with (prefix check) on a trie - the foundation for autocomplete and prefix-based lookups.
Coding Prepmedium15m2mo - Jump Game
Greedy reachability frontier: determine if you can reach the last index by tracking the farthest reachable position at each step.
Coding Prepmedium15m2mo - Kth Largest Element in an Array
Min-heap of size K: maintain only the K largest elements seen so far; the root is always the Kth largest.
Coding Prepmedium15m2mo - Maximum Average Subarray I
Fixed sliding window: find the contiguous subarray of length k with the highest average in O(n) by sliding a running sum.
Coding Prepeasy8m2mo - Maximum Depth of Binary Tree
Postorder recursion: depth = 1 + max(left_depth, right_depth) - children are resolved before the parent.
Coding Prepeasy8m2mo - Minimum Depth of Binary Tree
BFS stop-on-first-leaf: the first leaf BFS reaches is guaranteed to be at minimum depth - no full traversal needed.
Coding Prepeasy8m2mo - Number of Islands
Count connected land regions in a 2D grid using DFS with in-place mutation to mark visited cells
Coding Prepmedium15m2mo - Number of Provinces
Count connected components in an adjacency matrix using Union-Find with path compression and union by rank.
Coding Prepmedium15m2mo - Number of Recent Calls
Queue as a sliding time window: enqueue each ping timestamp and popleft all timestamps outside the 3000ms window before returning the count.
Coding Prepeasy8m2mo - Path Sum
Tree DFS carrying remaining sum: recurse with remaining_sum minus node value; return true when a leaf is reached with remaining_sum equal to zero.
Coding Prepeasy8m2mo - Run a Coding Interview
A concise protocol for clarifying, planning, building, testing, and explaining a coding solution under interview pressure.
Coding Prep8m2mo - Single Number
XOR cancellation practice: every element in the array appears twice except one. Find the unique element in O(n) time with O(1) space.
Coding Prepeasy10m2mo - Subsets
Generate the power set of a distinct-element array using backtracking: record path at every node, not just leaves.
Coding Prepmedium15m2mo - Two Sum II - Input Array Is Sorted
Opposite-ends two-pointer on a sorted array: converge left and right based on whether the current sum is too small or too large.
Coding Prepeasy8m2mo - Clone Graph
Deep copy a connected undirected graph using DFS with a hash map to track original-to-clone node mapping
Coding Prepmedium15m2mo - Combination Sum
Find all unique combinations summing to target where candidates can be reused: backtrack with start index and break pruning after sorting.
Coding Prepmedium15m2mo - Design Circular Queue
Fixed-capacity array with head/tail pointers and modular arithmetic - enqueue advances tail, dequeue advances head, both wrap around with % capacity.
Coding Prepmedium15m2mo - House Robber
Maximize loot from an array of houses without robbing two adjacent houses - at each house decide rob or skip, using two rolling variables for O(1) space.
Coding Prepmedium15m2mo - Invert Binary Tree
Preorder DFS: swap left and right children at the current node before recursing - produces a mirror image of the original tree.
Coding Prepeasy8m2mo - Linked Lists
Nodes connected by pointers - the three patterns that cover 90% of linked list interviews: reversal, fast/slow pointers, and two-pointer with offset.
Coding Prep14m2mo - Max Area of Island
Grid DFS accumulating area: DFS from each unvisited 1-cell, mark visited by setting to 0, return the count of cells reached - track the maximum across all islands.
Coding Prepmedium15m2mo - Merge Intervals
Interval merging pattern: sort by start time, then extend or append as you scan - produces a minimal non-overlapping set.
Coding Prepmedium15m2mo - Min Stack
Augment a stack with O(1) minimum retrieval using a parallel auxiliary stack that tracks the running minimum.
Coding Prepmedium15m2mo - Number of 1 Bits
Count the 1-bits in a non-negative integer using the Kernighan trick - n &= n-1 clears the lowest set bit, so the loop runs exactly popcount(n) times.
Coding Prepeasy8m2mo - Permutation in String
Fixed window frequency match: slide a window of len(s1) over s2 comparing character counts to detect any permutation of s1.
Coding Prepmedium15m2mo - Pow(x, n)
Implement x raised to the power n using divide-and-conquer - halve the exponent each call for O(log n) multiplications instead of O(n).
Coding Prepmedium15m2mo - Redundant Connection
Cycle detection in undirected graphs: the first edge whose endpoints share a root is the redundant edge creating the cycle.
Coding Prepmedium15m2mo - Replace Words
Replace each word in a sentence with its shortest dictionary root using a trie - walk until is_end=True and return the root prefix found.
Coding Prepmedium15m2mo - Rotting Oranges
Multi-source BFS: enqueue all rotten oranges simultaneously and let BFS compute each fresh orange's minimum time-to-rot in a single pass.
Coding Prepmedium15m2mo - Search Insert Position
Leftmost binary search: given a sorted array and a target, return its index or the index where it would be inserted to keep the array sorted.
Coding Prepeasy8m2mo - Solution Shape Atlas
A compact map of five practical coding shapes, their first state choices, failure modes, and speed drills.
Coding Prep10m2mo - Sort Colors
Dutch national flag algorithm: three pointers partition 0s, 1s, and 2s in one pass without counting or using library sort.
Coding Prepmedium15m2mo - Top K Frequent Elements
Frequency count plus min-heap of size K: keep only the K highest-frequency (count, element) pairs seen so far.
Coding Prepmedium15m2mo - Two Pointers
Two index variables that eliminate the inner loop - the opposite-ends pattern for sorted-array pair problems and the same-direction pattern for partitioning and in-place removal.
Coding Prep10m2mo - Valid Anagram
Character frequency counting: two strings are anagrams when their character frequency dicts are equal.
Coding Prepeasy8m2mo - Valid Palindrome
Opposite-ends two-pointer with character normalization: skip non-alphanumeric characters and compare the remaining characters case-insensitively.
Coding Prepeasy8m2mo - Accounts Merge
Union all emails within an account, then group emails by root representative to reconstruct merged accounts with sorted emails.
Coding Prepmedium15m2mo - Course Schedule
Detect a cycle in a directed prerequisite graph using Kahn's topological sort to check if all courses can finish
Coding Prepmedium15m2mo - Daily Temperatures
Canonical monotonic stack problem: find the next warmer day for each index in O(n) using a decreasing stack of indices.
Coding Prepmedium15m2mo - Find Minimum in Rotated Sorted Array
Binary search on a rotated array: find the minimum by detecting which half is sorted and whether the inflection point lies left or right of mid.
Coding Prepmedium15m2mo - Flatten Nested List
Recursively flatten a list of integers and sublists to any depth - if an element is a list, recurse into it; if it is a value, collect it.
Coding Prepmedium15m2mo - Group Anagrams
Grouping by derived key: sorted characters form a canonical key that routes every anagram to the same bucket.
Coding Prepmedium15m2mo - K Closest Points to Origin
Max-heap of size K keyed on negated squared distance: keep only the K nearest points; pop the farthest when the heap exceeds K.
Coding Prepmedium15m2mo - Longest Substring Without Repeating Characters
Variable window with a character set: expand right until a duplicate appears, shrink left until it is gone, track the longest valid window.
Coding Prepmedium15m2mo - Non-overlapping Intervals
Minimum removals to make intervals non-overlapping: sort by end time and greedily keep the interval finishing earliest.
Coding Prepmedium15m2mo - Permutations
Generate all orderings of distinct integers using backtracking: track used elements with a boolean array, loop from index 0 every call.
Coding Prepmedium15m2mo - Power of Two
Determine if n is an exact power of two - a power of two has exactly one bit set, so clearing the lowest set bit with n & (n-1) produces 0.
Coding Prepeasy6m2mo - Remove Duplicates from Sorted Array
Same-direction slow/fast pointers: slow tracks the next write position, fast scans for new values and writes them at slow's position.
Coding Prepeasy8m2mo - Same Tree
Simultaneous DFS on two trees: both null means equal, one null means not equal, then compare values and recurse on both sides.
Coding Prepeasy8m2mo - Search Suggestions System
Return up to 3 lexicographic suggestions after each keystroke using a trie - navigate to the prefix node, then DFS to collect sorted completions.
Coding Prepmedium15m2mo - Shortest Path in Binary Matrix
Grid BFS with 8-directional movement: BFS guarantees the first path to reach the destination is the shortest - count steps from (0,0) to (n-1,n-1) through 0-cells.
Coding Prepmedium15m2mo - Sliding Window
A contiguous subarray maintained by advancing start and end pointers - fixed-size windows for k-element aggregates and variable-size windows for constraint-satisfying substrings.
Coding Prep11m2mo - Sort List
Merge sort on a linked list: find the middle with slow/fast pointers, split, sort each half recursively, then merge - O(n log n) time O(1) space.
Coding Prepmedium15m2mo - Stacks
LIFO storage built on a Python list - the two patterns that cover most stack interviews: monotonic stack for next-greater problems and an explicit stack for DFS and bracket matching.
Coding Prep11m2mo - Unique Paths
Count distinct paths for a robot moving only right or down in an m x n grid - 2D DP where each cell sums the paths from above and from the left.
Coding Prepmedium15m2mo - 3Sum
Sort first, fix one element with an outer loop, then apply opposite-ends two pointers on the rest - skip duplicates at all three positions.
Coding Prepmedium15m2mo - BFS
Level-by-level graph traversal using a queue - guarantees the shortest path in unweighted graphs and naturally groups nodes by their distance from the source.
Coding Prep12m2mo - Binary Tree Level Order Traversal
BFS with level-size snapshotting: capture len(queue) before the inner loop to group nodes by depth into separate lists.
Coding Prepmedium15m2mo - Coin Change
Find the minimum coins to make an amount - 1D unbounded knapsack where dp[amount] = min(dp[amount - coin] + 1) for each coin; initialize unreachable states to infinity.
Coding Prepmedium15m2mo - Counting Bits
Return the popcount for every integer from 0 to n in O(n) time - popcount(i) = popcount(i >> 1) + (i & 1) reuses already-computed results by linking each number to its right-shifted half.
Coding Prepmedium12m2mo - Design Add and Search Words Data Structure
Extend a trie with '.' wildcard matching - handle exact characters normally and recurse into all children when a dot is encountered.
Coding Prepmedium15m2mo - Evaluate Reverse Polish Notation
Operand stack evaluation: push numbers, pop two operands on each operator, push the result.
Coding Prepmedium15m2mo - Koko Eating Bananas
Answer-space binary search: find the minimum eating speed that lets Koko finish all piles within H hours by binary searching over feasible speeds.
Coding Prepmedium15m2mo - Largest Number
Custom sort comparator: compare string concatenations in both orders to determine which arrangement of two numbers produces the larger value.
Coding Prepmedium15m2mo - Longest Repeating Character Replacement
Variable window with a max-frequency trick: the window is valid when window_size - max_freq <= k, letting you grow as long as replacements stay within budget.
Coding Prepmedium15m2mo - Meeting Rooms II
Minimum conference rooms via greedy heap: sort by start time, reuse the room whose meeting ends soonest when it frees up.
Coding Prepmedium15m2mo - Merge K Sorted Lists
K-way merge with a min-heap: always extract the global minimum in O(log K) by seeding the heap with the head of each list.
Coding Prephard25m2mo - Number of Connected Components in an Undirected Graph
Count connected components in an undirected graph by launching DFS from each unvisited node
Coding Prepmedium15m2mo - Queues
FIFO storage built on collections.deque - the two patterns that appear in nearly every queue interview: BFS level traversal and the monotonic deque for sliding window extremes.
Coding Prep10m2mo - Satisfiability of Equality Equations
Two-pass Union-Find: union all == pairs first, then verify no != pair shares a root - order of passes matters.
Coding Prepmedium15m2mo - Subsets II
Generate the power set of an array that may contain duplicates: sort first, then skip duplicate elements at the same recursion depth.
Coding Prepmedium15m2mo - Word Ladder
BFS on an implicit graph: each word is a node, edges connect words differing by one character - BFS finds the shortest transformation sequence in O(n * L^2) time.
Coding Prephard25m2mo - DFS
Depth-first graph traversal that explores one path completely before backtracking - recursive DFS for connected components and tree problems, backtracking DFS for generating all valid combinations.
Coding Prep13m2mo - Find Median from Data Stream
Two-heap split: a max-heap for the lower half and a min-heap for the upper half give O(1) median access with O(log n) insertions.
Coding Prephard25m2mo - Hash Maps
O(1) average key-value lookup built on a hash function - the three patterns that cover most hash map interviews: complement lookup, frequency counting, and grouping by derived key.
Coding Prep11m2mo - Jump Game II
Minimum jumps via level-by-level greedy: track the farthest reach within the current level, increment jumps when exhausting each level.
Coding Prepmedium15m2mo - Largest Rectangle in Histogram
Monotonic increasing stack tracks candidate bars; each pop triggers an area calculation using the popped bar as the limiting height.
Coding Prephard25m2mo - Longest Increasing Subsequence
Find the length of the longest strictly increasing subsequence - O(n^2) DP where dp[i] = max(dp[j]+1) for all j < i with nums[j] < nums[i].
Coding Prepmedium15m2mo - Minimum Window Substring
Variable minimum window: expand until all target characters are covered, then shrink from the left while still valid to find the smallest covering window.
Coding Prephard25m2mo - Pacific Atlantic Water Flow
Find cells reachable by both oceans using reverse multi-source BFS from each ocean's border, then intersect the two reachable sets
Coding Prepmedium15m2mo - Search in Rotated Sorted Array
Binary search in a rotated array: determine which half is sorted, then decide which half must contain the target based on its value range.
Coding Prepmedium15m2mo - Single Number II
Every element appears exactly 3 times except one - XOR alone fails here; count set bits at each position modulo 3 and reconstruct the answer from positions where the count is not divisible by 3.
Coding Prepmedium14m2mo - Trapping Rain Water
Two pointers tracking the running max from each side: the shorter side's running max determines water at the current position; advance that pointer inward.
Coding Prephard25m2mo - Validate Binary Search Tree
Min/max bounds propagation: pass allowed range down the recursion - going left tightens max, going right tightens min.
Coding Prepmedium15m2mo - Word Search
Find a word in a 2D character grid using DFS backtracking: mark cells visited in-place with a sentinel and restore them on return.
Coding Prepmedium15m2mo - Word Search II
Find all target words on a character board by combining trie pruning with backtracking DFS - one pass checks all words simultaneously.
Coding Prephard25m2mo - Dynamic Programming
Breaking problems into overlapping subproblems and caching results - top-down memoization for natural recursion and bottom-up tabulation for space-efficient iteration.
Coding Prep16m2mo - Find K Pairs with Smallest Sums
Min-heap seeded with (nums1[i]+nums2[0], i, 0): expand by incrementing the second index to explore sorted pairs without generating all n*m candidates.
Coding Prephard25m2mo - Gas Station
Circular route feasibility: if total gas >= total cost a solution exists, and the start is where the running tank sum hits its minimum.
Coding Prepmedium15m2mo - Letter Combinations of a Phone Number
Map digits to phone keypad letters and backtrack over all character choices per digit to enumerate every possible combination.
Coding Prepmedium15m2mo - Longest Common Subsequence
Find the length of the longest common subsequence of two strings - 2D DP where matching characters extend the diagonal, non-matching cells take the max of left and above.
Coding Prepmedium15m2mo - Lowest Common Ancestor of a Binary Search Tree
BST property navigation: if both targets are less than root go left, if both are greater go right, otherwise root is the split point and is the LCA.
Coding Prepmedium15m2mo - Reverse Bits
Reverse the 32 bits of an unsigned integer - extract the current LSB with n & 1, append it to the result by shifting result left and ORing, then shift n right; repeat 32 times.
Coding Prepmedium10m2mo - Sliding Window Maximum
Monotonic deque: maintain a decreasing-order deque of indices so the front is always the current window maximum in O(1) per step.
Coding Prephard25m2mo - Trees
Hierarchical nodes with left/right children - the two traversal families (recursive DFS and level-order BFS) that unlock most binary tree interviews, plus the BST property for ordered queries.
Coding Prep14m2mo - Greedy
Making the locally optimal choice at each step to reach a global optimum - interval scheduling by earliest deadline, activity selection, and the exchange argument that proves greedy correctness.
Coding Prep12m2mo - Heaps
A complete binary tree with the heap property - O(log n) insert and extract, O(1) peek of the min or max, and the two patterns that cover most heap interviews: top-K elements and the two-heap split for running median.
Coding Prep12m2mo - N-Queens
Place n queens on an n x n board with no conflicts: backtrack row by row, pruning via column and diagonal sets.
Coding Prephard25m2mo - Two Sum
Hash map complement lookup: for each element, check if its complement (target minus current) is already seen - O(n) time and space vs the O(n²) nested loop.
Coding Prepeasy8m2mo - Word Break
Determine if a string can be segmented into dictionary words - 1D DP where dp[i] is True if any dp[j] is True and s[j:i] is in the dictionary set.
Coding Prepmedium15m2mo - Graphs
Nodes connected by arbitrary edges - BFS for shortest path, DFS for connected components and cycle detection, and topological sort for dependency ordering.
Coding Prep15m2mo - Maximum Subarray
Kadane's algorithm: at each element, decide whether to extend the running subarray or restart fresh - O(n) time with O(1) space by maintaining only two variables.
Coding Prepmedium10m2mo - Sorting
Arranging elements in order - merge sort for stable O(n log n), quicksort for in-place average O(n log n), and how to use Python's sort with custom keys to solve comparison problems without implementing a sort from scratch.
Coding Prep13m2mo - Backtracking
Systematic search that builds candidates incrementally and abandons a path the moment it cannot lead to a valid solution - choose, explore, unchoose is the three-step template for all backtracking problems.
Coding Prep14m2mo - Best Time to Buy and Sell Stock
Running minimum scan: track the cheapest price seen so far and the maximum profit achievable if you sold today - one pass, O(n) time and O(1) space.
Coding Prepeasy8m2mo - Tries
A prefix tree where each path from root to a marked node spells a word - O(m) insert and search by word length, enabling prefix lookups and autocomplete that a hash set cannot do efficiently.
Coding Prep12m2mo - Bit Manipulation
Operating directly on binary representations - XOR for cancellation, AND for masking, and the handful of tricks (power-of-2 check, lowest set bit, popcount) that cover most bit manipulation interview problems.
Coding Prep11m2mo - Product of Array Except Self
Prefix and suffix product passes: build left products left-to-right, then multiply in right products right-to-left - O(n) time and O(1) extra space without division.
Coding Prepmedium12m2mo - Union-Find
A disjoint set data structure that tracks connected components in near-O(1) per operation - path compression and union by rank combine to give O(alpha(n)) amortized, faster than BFS/DFS for dynamic connectivity.
Coding Prep11m2mo - Container With Most Water
Opposite-ends two pointers: always move the shorter side inward - advancing the taller side can only decrease area, so the shorter side is the only move that could improve.
Coding Prepmedium10m2mo - Reverse Linked List
Three-pointer in-place reversal: save next_node before redirecting curr.next - that one save line is what keeps the rest of the list reachable throughout the traversal.
Coding Prepeasy8m2mo - Merge Two Sorted Lists
Dummy head pattern: a sentinel node gives curr a valid starting point so the first real node needs no special case - return dummy.next to skip the sentinel.
Coding Prepeasy8m2mo - Linked List Cycle
Floyd's cycle detection: slow moves one step, fast moves two - inside a cycle fast must eventually lap slow, so they collide; if fast reaches None, no cycle exists.
Coding Prepeasy8m2mo - Remove Nth Node From End of List
n-step head start: advance fast by n nodes first, then move both until fast reaches the tail - slow lands at the node just before the target, enabling O(1) deletion.
Coding Prepmedium10m2mo - Palindrome Linked List
Fast/slow to find the midpoint, reverse the second half, compare both halves from their respective heads - O(n) time and O(1) space without extra storage.
Coding Prepmedium12m2mo - LRU Cache
Doubly linked list + hash map: the map gives O(1) lookup, the list gives O(1) eviction and promotion - always evict from the tail, always insert/promote to the head.
Coding Prephard20m2mo - Valid Parentheses
Stack-walk a bracket string to validate it, then localize the first error, then find the longest valid substring (LC 32).
Practicalmedium35m2mo+12
- Stack Samples → Trace Events
A sampling profiler captures call stacks at fixed intervals. Convert those snapshots into start/end span events. Three phases - basic diff, recursion, then a min-consecutive-count debounce.
Practicalhard60m2mo - In-Memory Key-Value Store(premium)
Build a key-value store as a single class. Layer on prefix-scan, TTL, then gzip persistence - each phase is its own surface area on top of the previous one.
Practicalmedium60m2mo - Sampling Profiler → Trace Events (Sample/Event types)(premium)
A typed variant of the stack-samples problem - Sample and Event are dataclasses, comparisons are by value, and the contract is exposed via the imports the test file requires.
Practicalhard60m2mo - Find Duplicate Files(premium)
Group identical files by content. Stream-hash to keep memory bounded, then add size pre-filtering and an opt-in symlink/min-size policy.
Practicalmedium45m2mo+4
- Find Duplicate Files - Extended(premium)
Same starting point as the basic duplicate-finder, then six layers: streaming hash, size + symlink filters, recursive directory walking, two-pass hashing, per-file error handling, and a persistent hash cache.
Practicalhard90m2mo - Encode and Decode Strings(premium)
Serialize a list of arbitrary strings into a single string and parse it back. Any character is allowed in the strings, including the delimiters - length-prefix framing is the only safe answer.
Practicaleasy25m2mo+3
- KV Store - Serialize and Deserialize(premium)
The most-reported OpenAI coding problem. An in-memory key-value store where both keys and values are arbitrary strings - delimiters, newlines, unicode, anything. The on-the-wire format must round-trip them all.
Practicalmedium45m2mo - Time-Based Key-Value Store(premium)
A key-value store with timestamped writes. Read at time t returns the latest value written at or before t; later phases add arbitrary-order inserts and range queries.
Practicalmedium35m2mo+9
- Authentication Manager - TTL(premium)
LeetCode 1797. Tokens issued with a fixed TTL; renew before expiry to extend; count live tokens at time t. Later phases push the count to amortized O(1) and add thread safety.
Practicalmedium30m2mo - Meeting Rooms(premium)
Given a list of half-open meeting intervals, find the minimum number of conference rooms; later phases assign specific room IDs and add capped capacity with priority eviction.
Practicalmedium35m2mo+9
- Monster Team Battle(premium)
Auto-simulate a turn-based team fight enforcing round order, dying-strike counterattacks, draw detection, and a full time-ordered event log.
Practicalmedium35m2mo - Disease Spread in a Grid(premium)
A cell becomes infected on step t+1 only if it has at least K infected neighbors right now. Looks like rotting oranges but the K threshold turns it into a wave simulation with stall detection.
Practicalmedium40m2mo - Semantic Version Comparison and Constraints(premium)
Parse and compare semver-style version strings, then layer on range constraints (>=, <, ^, ~, x-wildcards). The lexicographic-vs-numeric comparison trap is the centerpiece.
Practicalmedium35m2mo - IPv4 Address Iterator and CIDR(premium)
Convert dotted-quad to 32-bit integers and back, iterate forward and reverse over a range, parse CIDR notation, and decompose an arbitrary range into the minimum CIDR cover.
Practicalmedium40m2mo - Async N-ary Cluster Count(premium)
Count nodes in an n-ary tree using async fan-out. The recursion is trivial; the real test is fanning out child queries concurrently so wall-clock time scales with tree depth, not node count.
Practicalmedium30m2mo - Resumable Iterator(premium)
An iterator whose state can be captured and replayed - stop iterating, save the state, hand it to a fresh iterator, and continue from exactly where you left off. Layer composition over flat and nested data.
Practicalmedium40m2mo - Spreadsheet with Formulas(premium)
Cells hold literals or formulas that reference other cells. set_cell evaluates and caches each cell so get_cell is O(1); later levels propagate changes to dependents and reject updates that would form a cycle.
Practicalhard50m2mo - Unix cd with Symlink Resolution(premium)
A stateful shell that supports POSIX cd semantics - absolute and relative paths, `.`/`..`, symlink resolution, and cycle detection. Looks simple, hides a stack-and-recursion problem.
Practicalmedium45m2mo - GPU Credit Tracker: Variant 1(premium)
Two shapes that often combine in the same interview. Historical-balance lookup (add/deduct stamped at a time, query balance as of t) and FIFO consumption with per-batch expiration.
Practicalmedium45m2mo - GPU Credit Tracker: Variant 2(premium)
Single-account GPU credit grants with time windows; FIFO partial spending and windowed balance queries.
Practicalmedium40m2mo - Follow Graph with Snapshots(premium)
A mutable social graph that has to do three hard things at once - answer point-in-time history without copying the world on every snapshot, and rank friends-of-friends recommendations both live and as-of a past snapshot.
Practicalhard60m1mo - In-Memory Database with SQL-like Operations(premium)
A single-table in-memory database supporting INSERT and SELECT with WHERE (AND-only equality) and multi-column ORDER BY. The stable-sort trick is the trade tool.
Practicalmedium40m2mo - Authentication Manager - Sessions(premium)
Session-based auth with register, login, logout, session TTL, and salted password hashing. Paired with the TTL token variant in OpenAI loops.
Practicalmedium35m2mo - KV Store - Chunked Persistence(premium)
The chunked-persistence follow-up to KV Store Serialize/Deserialize. Serialize a key-value store with a fixed-width binary (TLV) format, then split the blob into 1 KB chunks and checkpoint it to an S3-style object store - with the chunk count carried in a chunk header, no separate metadata object.
Practicalhard50m2mo - KV Store - Thread-Safe(premium)
The concurrency follow-up to the in-memory key-value store. Many threads call put / get / erase on one shared store at once; make it correct under contention, then refine from a single global lock to a reader-writer lock and finally to atomic compound operations (get_and_set, compare_and_swap).
Practicalmedium40m1mo - Web Crawler(premium)
Build a web crawler on top of an injected get_links helper - breadth-first crawl with deduplication, then same-domain and fragment handling, then a concurrent version with a thread pool and a shared visited set, and finally depth and global rate limits. A concurrency problem disguised as a graph traversal.
Practicalhard50m1mo - Image Processing Pipeline(premium)
Apply ordered image operations (resize, rotate, crop, blur, grayscale) with Pillow - one image, then every image-by-pipeline combination, then a thread pool, then partial-failure isolation, then directory discovery. A throughput and fault-tolerance problem dressed as image manipulation.
Practicalmedium45m1mo - Image Pipeline - Recursive Batch(premium)
The directory-scale follow-up to Image Processing Pipeline. Walk a tree of images (Large/ and Small/ subfolders), load transform lists from a folder of JSON files, and apply every transform to every image in parallel - preserving the source subdirectory layout in the output and isolating per-combination failures. The fan-out the interview actually scales to millions of combinations.
Practicalmedium45m1mo - KV Store - Persistent(premium)
The durability follow-up to the in-memory key-value store. Snapshot the store to disk and restore it, then make the write crash-safe with an atomic temp-file rename, then add an append-only write-ahead log so writes made since the last snapshot survive a crash. Length-prefix encoding keeps arbitrary key/value bytes intact across disk.
Practicalmedium40m1mo