Decks
154 decks, 1127 questions.
- Arrays and strings: checkpoint Trace a two-pointer edit on a new input. Each item combines reading indices and tracing a scan, and one also reads a slice.
- Arrays and strings: review Fresh inputs for the Arrays and strings skills, for recall on later days. No worked examples this time.
- Arrays and strings Read an index, scan a list, move two pointers, and read a slice. Each card asks for one decision, with a worked example on hand.
- Binary search, including on the answer Halve a sorted range, or a range of possible answers, and know which loop, test, and cost go with it.
- Bit manipulation: checkpoint Trace bit operations on new inputs, and pick a bit method that meets a stated limit. Each item combines the Bit manipulation skills.
- Bit manipulation: review Fresh inputs for the Bit manipulation skills, for recall on later days. No worked examples this time.
- Bit manipulation Apply the bit operators to Python ints, clear the lowest set bit, and use an int as a set of flags. Each card has a worked example on hand.
- Boundary search: checkpoint Repair a boundary update, pick the call that breaks a suggested solution, and search a rotated list, on new values. Most items combine the two skills that lead into its checkpoint.
- Boundary search: review Fresh inputs for the Boundary search skills, for recall on later days. No worked examples this time.
- Boundary search Find an insertion point, decide which side keeps an equal value, and search a rotated list. Each card asks for one decision, with a worked example on hand.
- Bounded heaps: checkpoint Keep the top K of a stream or merge sorted runs lazily, on new inputs, within a memory limit.
- Bounded heaps: review Fresh inputs for evicting from a capped heap, keeping its size, and merging sorted runs one front at a time.
- Bounded heaps Keep the k best items with a capped heap, and merge sorted runs with one entry per run. Each card asks for one decision, with a worked example on hand.
- BST order: checkpoint Validate a fresh tree against inherited bounds and find the lowest common ancestor of two values.
- BST order: review Fresh trees for choosing a subtree, carrying an ancestor's bound down, and finding where two targets split.
- BST order Use the ordering of a binary search tree to pick a subtree, carry an ancestor's bound down, and find where two targets split.
- Complexity analysis Read the running time or memory use off a short piece of code, then show why the nearby answers are off.
- Connectivity: checkpoint Count static components and answer a stream of link events on fresh graphs.
- Connectivity: review Recall adjacency lists, component counts, and union-find roots on fresh graphs.
- Connectivity Read an adjacency list, count components, and follow union-find roots as links arrive.
- Cost accounting in Python Predict what everyday Python operations really cost and how lists, references, and sorting behave, so a short line of code does not hide a slow loop or a surprise.
- Dependency order: checkpoint Explain a partial Kahn result, separating cycle members from the tasks they block.
- Dependency order: review Recall prerequisite direction, incoming counts, and unlocking on fresh dependency lists.
- Dependency order Read which task waits for which, count prerequisites, and release a task when its last one finishes.
- DP storage: checkpoint Choose between memoization, a table and rolling variables, and repair a one-row update. Each item combines the DP storage skills.
- DP storage: review Fresh inputs for the DP storage skills, for recall on later days. No worked examples this time.
- DP storage Keep only the past entries a table still reads, update old and new values in a safe order, and count states times work. Each card has a worked example on hand.
- Drag the pointers Move each pointer to the cell it reaches after one step of a scan.
- Enumerating choices: checkpoint Keep every valid output of a search you have not seen, and count what the output costs. Each item combines listing leaves, telling repeated siblings apart, and justifying a prune.
- Enumerating choices: review Fresh searches for the Enumerating choices skills, for recall on later days. No worked examples this time.
- Enumerating choices List what a search records, tell a repeated value from a repeated sibling, and say which assumption makes a prune safe. Each card asks for one decision, with a worked example on hand.
- Event sweeps: checkpoint Determine how many rooms a schedule needs, on new inputs, and find the call a suggested sweep gets wrong. The items combine turning meetings into events, ordering ties, and tracking the peak count.
- Event sweeps: review Fresh inputs for the Event sweeps skills, for recall on later days. No worked examples this time.
- Event sweeps Turn meetings into start and end events, order the events that share a time, and track the active and peak counts. Each card asks for one decision, with a worked example on hand.
- Exact search: checkpoint Pick a loop that works on every input, diagnose one that stalls, and find the wrong line in a suggested solution. Most items combine discarding a half, dropping the probe and the one-cell range.
- Exact search: review Fresh inputs for the Exact search skills, for recall on later days. No worked examples this time.
- Exact search Discard the half a probe rules out, drop the probed index, and tell one candidate from none. Each card asks for one decision, with a worked example on hand.
- Feasible limits: checkpoint Find the smallest feasible limit, choose a search for a new task, find a pass that miscounts, and count what the search reads. Most items combine the Feasible limits skills.
- Feasible limits: review The Feasible limits decisions again, on fresh inputs and with no worked example. Use these for spaced review.
- Feasible limits Test one limit, find where the answers turn from no to yes, shrink the range of limits, and count what the search reads. Each card asks for one decision, with a worked example on hand.
- Graph algorithms Pick the right tool for ordering, connectivity, and shortest paths on graphs given as edge lists or adjacency lists.
- BFS and DFS on grids Scan every cell, start a traversal from each unvisited one, and learn which choices (BFS or DFS, when to mark, how deep to recurse) decide whether it is right and fast.
- Greedy choices: checkpoint Change one constraint and decide whether a greedy rule survives, with a counterexample or the fact that keeps it safe. Each item combines the Greedy choices skills.
- Greedy choices: review Fresh inputs for the Greedy choices skills, for recall on later days. No worked examples this time.
- Greedy choices Name the local rule a greedy loop applies, find a small input that breaks it, and state the fact that makes it safe. Each card has a worked example on hand.
- Greedy scheduling: checkpoint Find the schedule that earliest finish keeps on new inputs, and explain why no schedule keeps more. Each item combines the Greedy scheduling skills.
- Greedy scheduling: review Fresh inputs for the Greedy scheduling skills, for recall on later days. No worked examples this time.
- Greedy scheduling Keep the most intervals that never overlap. Pick a compatible interval, compare the room each choice leaves, and apply earliest finish. Each card has a worked example on hand.
- Grid tables: checkpoint Count paths on new blocked grids, from the cells each entry reads to the edges and blocks. Each item combines the Grid tables skills.
- Grid tables: review Fresh grids for the Grid tables skills, for recall on later days. No worked examples this time.
- Grid tables Find the cells a grid entry reads, set up edges and blocked cells, and fill one interior cell. Each card has a worked example on hand.
- Growth rates: checkpoint Trace a small input, predict the steps or memory when the input doubles, and name the growth. Each item combines the Growth rates skills on code used nowhere else.
- Growth rates: review Fresh inputs for the Growth rates skills, for recall on later days. No worked examples this time.
- Growth rates Count a loop's steps, compare how counts grow, name the growth in Big-O, and account for memory. Each card asks for one decision, with a worked example on hand.
- Hash lookups: checkpoint Find where runs of consecutive numbers start, explain why each value needs only one visit, and choose the lookups for a pair search, on new inputs.
- Hash lookups: review Fresh inputs for the Hash lookups skills, for recall on later days. No worked examples this time.
- Hash lookups Read a set or dictionary, choose the key to look up, and keep track of what has been seen. Each card asks for one decision, with a worked example on hand.
- Hash maps and prefix sums Spot when a dictionary, a set, or a running sum replaces a nested loop, and what each one costs.
- Heap operations: checkpoint Compare ways to build a heap or repair tied entries, on new inputs. Each item combines tracing a sift, the cost of a build, and ordering ties.
- Heap operations: review Fresh inputs for the Heap operations skills, for recall on later days. No worked examples this time.
- Heap operations Trace one sift, compare ways to build a heap, and order tied entries. Each card asks for one decision, with a worked example on hand.
- Heaps and top-K Keep the current best few items in a priority queue, and know what a heap costs and where Python's heapq surprises you.
- Hidden work: checkpoint Find the line that dominates, or remove repeated work without changing the output. Each item combines the Hidden work skills on code used nowhere else.
- Hidden work: review Fresh inputs for the Hidden work skills. Spot the hidden scan or copy, count how often it runs, and add up its cost, with no worked example.
- Hidden work Spot the scan or copy that one short line hides, count how often it runs, and add up what it costs. Each card asks for one decision, with a worked example on hand.
- Interval merging: checkpoint Insert an interval that overlaps several in a sorted list, and find the call that breaks a suggested merge, on new inputs. Each item combines endpoints, the touching rule and the running end.
- Interval merging: review Fresh inputs for the Interval merging skills, for recall on later days. No worked examples this time.
- Interval merging Draw two intervals, apply the rule for intervals that only touch, and extend the running end of a sorted scan. Each card asks for one decision, with a worked example on hand.
- Link rewrites: checkpoint Reverse the links of a list without losing the rest, on new inputs. Each item combines following a link, saving one before redirecting it, and the first node.
- Link rewrites: review Fresh inputs for following a next link, saving a link before redirecting it, and handling the first node. No worked examples.
- Link rewrites Follow a node's next link, save a link before redirecting it, and handle the first node. Each card asks for one decision, with a worked example on hand.
- Linked lists Rewire the pointers of a singly linked list in place, with fast and slow pointers, a dummy head, and a clear cost model.
- Method selection: checkpoint Choose a method, trace it on a fresh input, and name an input that rules out its closest alternative. Each item combines the Method selection skills.
- Method selection: review Fresh tasks for the Method selection skills, for recall on later days. No worked examples this time.
- Method selection Name the fact that decides the method, contrast two methods that could work, and back one with a trace or a counterexample. Each card has a worked example on hand.
- Monotonic stack: checkpoint Solve next-greater on new inputs and justify the cost of a whole run. Each item combines waiting positions, popping smaller tops, and reading what is left.
- Monotonic stack drills Keep the positions still waiting for a larger value, pop the smaller tops when one arrives, and count the work of a whole run. Each card asks for one decision, with a worked example on hand.
- Monotonic stack: review Fresh inputs for the Monotonic stack skills, for recall on later days. No worked examples this time.
- Monotonic stack Keep a stack of candidates in sorted order to find the next greater or smaller element for every position in one pass.
- Names and objects: checkpoint Predict which of the caller's objects change, on new inputs. Each item combines following references, telling rebinding from changing an object, and shared state.
- Names and objects: review Fresh inputs for following a reference, telling rebinding from changing an object, and predicting shared state. No worked examples.
- Names and objects Follow which object a name refers to, tell rebinding a name from changing an object, and predict what a caller sees. Each card asks for one decision, with a worked example on hand.
- One-dimensional dynamic programming Define a state, write the recurrence that builds each value from earlier ones, and fill a table without redoing work.
- One-dimensional tables: checkpoint Build a table for a fresh counting or optimization task. Each item combines the One-dimensional tables skills.
- One-dimensional tables: review Fresh tables for the One-dimensional tables skills, for recall on later days. No worked examples this time.
- One-dimensional tables Say what a table entry means, start the empty and impossible entries right, and pick the entries each one is built from. Each card has a worked example on hand.
- Operation costs: checkpoint Compare two duplicate checks under a time or memory limit. Each item combines the Operation costs skills on code used nowhere else.
- Operation costs: review Fresh inputs for the Operation costs skills, for recall on later days. No worked examples this time.
- Operation costs Price one list, set, or queue operation, add the costs of steps that run one after another, and multiply a cost that repeats. Each card asks for one decision, with a worked example on hand.
- Palindromes: checkpoint Check a phrase, allow one deletion, grow from the right center, and find the call that breaks a suggested solution, on new inputs.
- Palindromes: review Fresh inputs for the Palindromes skills, for recall on later days. No worked examples this time.
- Palindromes Compare mirrored characters, allow one deletion, and grow a palindrome from its center. Each card asks for one decision, with a worked example on hand.
- Pattern identification Name the technique or the cost that fits each problem, then show why the tempting alternatives do not.
- Pointer scans: checkpoint Return unique pairs or triples, trace an in-place compaction, or find the call that breaks a suggested scan, on new inputs. Most items combine two or more of the path's skills.
- Pointer scans: review Fresh inputs for the Pointer scans skills, for recall on later days. No worked examples this time.
- Pointer scans Choose which end moves, keep two indices apart, step over repeats, and compact in place. Each card asks for one decision, with a worked example on hand.
- Pointer walks: checkpoint Unlink the n-th node from the end, or tell a cycle from repeated values, on new inputs. Each item combines safe hops, a gap or a speed, and where the walk stops.
- Pointer walks: review Fresh inputs for the Pointer walks skills, for recall on later days. No worked examples this time.
- Pointer walks Move a pointer one or two nodes safely, keep a gap or a speed difference, and stop at the right node. Each card asks for one decision, with a worked example on hand.
- Prefix counts: checkpoint Count the subarrays with a given sum on new inputs where prefix sums repeat or return to 0. Most items combine the Prefix counts skills.
- Prefix counts: review Fresh inputs for the Prefix counts skills, for recall on later days. No worked examples this time.
- Prefix counts Build a prefix sum list from the empty prefix, subtract two entries to sum a subarray, and count earlier matches. Each card asks for one decision, with a worked example on hand.
- Priority order: checkpoint Choose a queue for an arriving stream of jobs, on new inputs. Each item combines FIFO versus priority order, the heap root, and predicting pushes and pops.
- Priority order: review Fresh inputs for the Priority order skills, for recall on later days. No worked examples this time.
- Priority order Tell a FIFO queue from a priority queue, find the heap root, and predict one push or pop. Each card asks for one decision, with a worked example on hand.
- Problem-solving routine: checkpoint Choose a test that separates two plausible procedures, or the input that breaks one, on new problems. Each item combines restating the output, picking a test, and tracing the code on it.
- Problem-solving routine: review Fresh inputs for the Problem-solving routine skills, for recall on later days. No worked examples this time.
- Problem-solving routine Say exactly what a function must return, pick a test that exposes a wrong procedure, and trace a brute force. Each card asks for one decision, with a worked example on hand.
- Reachability: checkpoint Combine neighbor rules, discovery marks, and completed flood fills to count islands.
- Reachability: review Practice the same three reachability skills on fresh grids and frontiers.
- Reachability Find legal neighbors, mark each discovery, and explore a region of land.
- Recursion and backtracking Explore choices depth-first, undo each one on the way back, and cut off branches that cannot succeed.
- Recursive calls: checkpoint Predict whether the calls stop and how many are live at once, on new inputs. Each item combines the stopping case, the smaller call, and the return.
- Recursive calls: review Fresh inputs for the Recursive calls skills, for recall on later days. No worked examples this time.
- Recursive calls Name the call that stops, trace the smaller call each one makes, and follow each value back up. Each card asks for one decision, with a worked example on hand.
- Repeated states: checkpoint Tell calls that meet the same state again from calls that split the work into disjoint parts, on recursions you have not seen.
- Repeated states: review Fresh recursions for the Repeated states skills, for recall on later days. No worked examples this time.
- Repeated states Say what a recursive call solves, spot the calls that repeat it, and answer a repeat from a cache. Each card asks for one decision, with a worked example on hand.
- Search state: checkpoint Diagnose a sibling-state leak in a search you have not seen. Each item combines making a choice, undoing it, and saving a finished path.
- Search state: review Fresh searches for the Search state skills, for recall on later days. No worked examples this time.
- Search state Follow one shared list through a search. Make a choice before the call, undo it before the next sibling, and copy a finished path. Each card asks for one decision, with a worked example on hand.
- Sort order: checkpoint Predict a sort's order and which lists it changes, and find the call that breaks a suggested solution, on new inputs. Each item combines the key, ties, and in place versus returned.
- Sort order: review Fresh inputs for the Sort order skills, for recall on later days. No worked examples this time.
- Sort order Read what a sort key compares, decide how ties come out, and tell a sort in place from a returned copy. Each card asks for one decision, with a worked example on hand.
- Sorting and interval sweeps Sort the intervals first, then sweep once while tracking a single current interval, kept end, or running count.
- Stack matching: checkpoint Decide whether mixed bracket strings are balanced, on new inputs. Each item combines pushing and popping, matching a closer to the top, and reading the stack that is left.
- Stack matching: review Fresh inputs for the Stack matching skills, for recall on later days. No worked examples this time.
- Stack matching Push and pop the latest item, match each closer to the top of the stack, and read what is left. Each card asks for one decision, with a worked example on hand.
- Subsequence tables: checkpoint Fill and walk back fresh LCS tables, find an unbroken shared run, and separate fill, storage and walk-back costs.
- Subsequence tables: review Fresh strings for telling gaps from unbroken runs, reading a cell's prefixes, filling a row and walking back an LCS table.
- Subsequence tables Tell a subsequence from a substring, read what a cell's two indexes cover, and fill or walk back an LCS table. Each card has a worked example on hand.
- Tap the cell Tap the cell an index or a pointer names.
- Trace the scan Step through a pointer scan and predict each move before it is shown.
- Traversal layers: checkpoint Time simultaneous spread and explain how the frontier finishes.
- Traversal layers: review Recall queue layers, unit distances, and simultaneous starts on fresh problems.
- Traversal layers Trace the queue, label distances, and start a wave from several sources.
- Tree summaries: checkpoint Complete a diameter walk and trace it on a fresh tree.
- Tree summaries: review Fresh trees for child heights, the height a call returns versus the path that bends at it, and the longest path seen.
- Tree summaries Build a node's height from its children, tell the height it returns from the path that bends at it, and keep the longest path seen.
- Tree walks: checkpoint Trace a walk on a fresh tree and predict which calls are still on the stack.
- Tree walks: review Fresh trees for naming parts, tracing visit orders, and telling height from node count.
- Tree walks Name the parts of a binary tree, trace the order a walk visits them, and tell height from node count.
- Trees, traversals, and BSTs Read binary trees through the three depth-first orders, level by level, and by the ordering rule of a binary search tree.
- Two-dimensional DP and greedy Fill grid and two-sequence tables, shrink them to one row, and tell when a locally best choice is safe and when it is not.
- Two pointers and sliding window Move two indices through an array so each element is visited a bounded number of times, and learn when that stops being valid.
- Variable windows: checkpoint Count valid subarrays, repair or debug a window scan and bound its cost on new logs. Most items combine the Variable windows skills.
- Variable windows: review Fresh inputs for the Variable windows skills, for recall on later days. No worked examples this time.
- Variable windows Slide a fixed window, keep its counts right as the edges move, and repair a broken window before recording it. Each card asks for one decision, with a worked example on hand.
- Weighted paths: checkpoint Pick a shortest-path method for the stated weights and time limit, and find the repeated work in a heap or a pass, on new graphs.
- Weighted paths: review Fresh graphs for adding up route costs, relaxing edges in a pass, and telling a final distance from a stale heap entry.
- Weighted paths Add up a route's edge weights, relax one edge at a time, and see when a heap entry gives a final distance. Each card asks for one decision, with a worked example on hand.
- Window limits: checkpoint Explain a subarray a sum window loses on signed values, find the input that breaks it, and pick a method that fits the task. Most items combine the Window limits skills.
- Window limits: review Fresh inputs for the Window limits skills, for recall on later days. No worked examples this time.
- Window limits Trace a window that shrinks by its total, see a negative value hide a better subarray, and tell when the shrink is safe. Each card asks for one decision, with a worked example on hand.