Checkpoint & revision
Practice: 15 algorithm problems and operational follow-ups
Use an optional problem set to practise patterns without treating interview anecdotes as guarantees.
On this page
Choose practice by the skill you need
The supplied interview-preparation articles suggested this reading list. The questions below link to LeetCode's original problem pages; their statements, examples, and solutions are not reproduced. The study prompts and notes on applying them to operations are written for this course. Use this optional checkpoint to practise specific skills. The list does not establish how often an employer asks these questions or guarantee interview readiness.
Start with a clear baseline solution, test it, explain its cost, then optimize. Start with counting, interval merging, graph traversal, and dependency ordering. Return to the harder window and streaming problems after those foundations. Meeting Rooms II currently requires Premium on LeetCode; the independent offline exercise below gives you interval-capacity practice without a subscription.
Counting, heaps, and scheduling
- 347: Top K Frequent Elements↗. Practise a frequency map followed by bounded selection. Account for
udistinct keys: expected counting plus heap work isO(n + u log(k + 1)), before ordered output. Follow-up: what history must expire in a rolling window, and what happens when distinct keys exceed memory? - 295: Find Median from Data Stream↗. Maintain lower and upper halves with two heaps. Check both their size balance and the boundary ordering. Exact heaps retain
O(n)samples; they are not a constant-memory p99 estimator. A fixed window additionally needs expiration handling. - 621: Task Scheduler↗. Reason about equal-duration tasks with label cooldowns. Test one label, no cooldown, and tied highest frequencies. Its scheduling model does not include arbitrary CI job durations, dependency DAGs, resource affinity, or failed jobs; name those differences before applying it to runners.
- 253: Meeting Rooms II↗, Premium. For independent interval practice, use the offline exercise below. If your heap contains only active jobs, track its maximum size over time; its final size can be smaller than the peak.
Windows, intervals, and bounded searches
- 239: Sliding Window Maximum↗. Practise a monotonic deque of indices, removing expired entries and dominated candidates. Each index enters and leaves once. A window over
ksamples equals a time window only under a defined sampling contract; a maximum alone is not an anomaly detector. - 76: Minimum Window Substring↗. Track required multiplicities, not just membership. Try a missing item, repeated requirements, and a window that must shrink several times. A diagnostic event sequence also needs explicit tokenization and ordering.
- 56: Merge Intervals↗. Preserve the furthest endpoint when a smaller interval is contained in another. Write down whether touching boundaries merge. A union of planned maintenance windows is scheduled coverage, not measured user downtime.
- 1011: Capacity To Ship Packages Within D Days↗. Prove that feasibility is monotonic before searching the answer range. Preserve the problem's fixed ordering and indivisible items. Do not generalize its greedy feasibility check to arbitrary bin packing or real cluster sizing.
Graphs and connectivity
- 210: Course Schedule II↗. Reuse the prerequisite-ordering idea. Check every edge in the returned ordering instead of requiring one specific sequence. Include isolated nodes and a cycle. A returned order does not make an application healthy.
- 200: Number of Islands↗. Traverse all components using the page's adjacency rule. Test diagonally touching cells and disconnected groups. A grid is a model; a real network requires actual links and reachability evidence.
- 684: Redundant Connection↗. Learn disjoint sets with path compression and union by rank or size. This problem concerns an undirected graph. Union-Find cannot replace directed cycle detection for a deployment dependency graph.
- 743: Network Delay Time↗. Practise Dijkstra's algorithm with nonnegative weights and stale-entry handling in the priority queue. Include an unreachable node. Reachability failure in this model does not establish split-brain, which concerns conflicting authority/state as well as communication.
Prefix sums, stacks, and caching
- 560: Subarray Sum Equals K↗. Track frequencies of prior prefix sums, including the empty prefix. Test negative values and multiple matching windows. An exact-sum window is not automatically a period of anomalous load; that requires a separate detection rule.
- 739: Daily Temperatures↗. Use a monotonic stack for a next-strictly-greater query. Test equal values and a descending sequence. Incident recovery usually means satisfying a threshold or health condition, not merely seeing a larger next value.
- 146: LRU Cache↗. Combine key lookup with recency updates. Test repeated updates, capacity one, and access before eviction. Sentinel nodes can simplify a linked-list implementation but are optional. LRU is one eviction policy; TTL, concurrency, stale reads, and persistence remain separate design choices.
Offline interval exercise
These invented jobs occupy one runner each during half-open intervals [start, end): [(0, 4), (1, 3), (3, 5), (8, 9)]. Write a function returning the peak simultaneous occupancy. The expected answer is 2; a job ending at time 3 releases its slot for one starting at time 3. Require finite ordered endpoints with start < end.
Try a sweep of start/end events, processing endings before starts at equal times. Compare it with a min-heap of active end times. Test no jobs, fully nested jobs, equal start times, and all jobs separated. This computes the capacity for the declared fixed schedule, not a recommended cloud instance count.
Record the follow-up, not just acceptance
For each attempted problem, save your assumptions, baseline, optimized invariant, complexity, counterexample, and test result. Add one real constraint: bounded memory, concurrent access, late data, or restart recovery. Mark any problems you have not attempted so you can return to them later. This optional page need not block the rest of the learning path.
Approximate structures answer different questions. Count-Min Sketch estimates frequencies but does not by itself enumerate the heavy-hitter keys; HyperLogLog estimates distinct counts; Bloom filters support approximate membership. Choose an acceptable error model before replacing an exact structure.
Check the offline interval reasoning
At time 0 occupancy becomes 1; at 1 it becomes 2. At 3 the ending job releases a slot before the new job takes one, so occupancy stays at 2 rather than reaching 3. At 4 it falls to 1, at 5 to 0, at 8 to 1, and at 9 to 0. The peak is 2 although the final occupancy is 0. This is why an active-job heap needs a recorded maximum.
For unfamiliar optional patterns, start with one invariant: two heaps keep lower and upper halves ordered and balanced; a monotonic deque removes expired/dominated candidates; a prefix-sum frequency map counts earlier totals that differ by the target; an LRU map plus linked order supports lookup and recency updates. These are study pointers, not complete solutions to the fifteen source problems. Use MIT's algorithm course materials↗ for further instruction, then return to the original problem constraints.
Sources and limits
The numbered links are the primary problem references, checked on 30 September 2026. The two user-supplied articles are supplementary topic inspiration. No company-specific question-frequency claims, promotional services, or copied solution listings are included. Use the core bites' MIT and Python references to study an unfamiliar algorithm before attempting it.
Your notes and evidence
Record observations, questions, or links to your work. Keep credentials out of your notes.
Back up or restore this path
Progress and notes stay in this browser. A backup contains only this learning path.