top of page
Search
Kruskal's Algorithm: A Step-by-Step Interview Walkthrough
Minimum Spanning Tree problems are a staple of technical interviews because they sit at the intersection of greedy reasoning and the Union-Find data structure — two things interviewers love to test together. The signal here is whether you understand greedy correctness and can apply Union-Find fluently, not just whether you can recite the steps.
Jun 1011 min read
Cheapest Flights Within K Stops: A Step-by-Step Interview Walkthrough
Cheapest Flights Within K Stops is a problem that looks like a routine shortest-path question, but it quietly adds a twist that breaks the standard tool. The signal interviewers want is whether you can recognize when a familiar algorithm's assumptions are violated and reach for the right variant instead of forcing the wrong tool.
Jun 1013 min read
Critical Connections in a Network: A Step-by-Step Interview Walkthrough
Critical Connections in a Network is a genuinely hard graph problem, the kind where knowing the right algorithm matters more than coding speed. It asks you to find every bridge in a graph — an edge whose removal would split the network into disconnected pieces. It's a problem that rewards understanding the theory, not just pattern-matching.
Jun 914 min read
Graph Valid Tree: A Step-by-Step Interview Walkthrough
Graph Valid Tree looks like a quick traversal problem and turns out to be a test of whether you actually know what a tree is. Most candidates can run a DFS, but this problem rewards understanding the structural definition of a tree — connected and acyclic — and recognizing that those two conditions, combined with the right invariant, collapse into a surprisingly clean check. The signal here is whether you can reason about graph properties rather than just running an algorithm
Jun 912 min read
Alien Dictionary: A Step-by-Step Interview Walkthrough
Alien Dictionary is one of the hardest "medium" problems in the interview rotation, and it earns that reputation by hiding a clean graph problem behind a deceptive premise. The instinct is to think about sorting or string comparison — but those are dead ends. The real insight is that the sorted order of the words is a set of ordering constraints between letters, and recovering the alphabet means assembling those constraints into a consistent sequence: a topological sort.
Jun 813 min read
Reconstruct Itinerary: A Step-by-Step Interview Walkthrough
Reconstruct Itinerary is a problem that looks like a routine graph traversal and turns out to be a subtle trap for the obvious approach. The setup practically begs for backtracking. That works, but it's exponential, and the candidates who reach for it spend their time wrestling with backtracking bookkeeping instead of seeing the structure. The candidates who recognize "use every edge exactly once" as the definition of an Eulerian path unlock a clean, near-linear algorithm.
Jun 812 min read
Network Delay Time: A Step-by-Step Interview Walkthrough
Network Delay Time is the problem interviewers use to find out whether you understand why Dijkstra's algorithm exists, not just how to type it out. The candidates who understand that unequal edge weights invalidate BFS's core assumption know to reach for Dijkstra instead. The signal here is whether you can tell weighted shortest path from unweighted shortest path, and whether you know why the distinction forces a different algorithm.
Jun 713 min read
Minimum Height Trees: A Step-by-Step Interview Walkthrough
Minimum Height Trees is a problem that punishes the obvious approach and rewards stepping back to find structure. The naive reading — "try every node as the root, measure the height, keep the best" — works, but it's quadratic, and the interviewer is specifically watching to see whether you settle for that or push for the insight that makes it linear. The key realization is that this isn't really a "measure heights" problem at all; it's a "find the center of the tree" problem
Jun 613 min read
Word Ladder: A Step-by-Step Interview Walkthrough
Word Ladder is a shortest-path problem wearing a string-manipulation costume, and the entire challenge is seeing through the disguise. The problem talks about transforming words one letter at a time, which sounds like it might call for clever string algorithms or backtracking. But the moment you reframe words as nodes and one-letter transformations as edges, it becomes a textbook shortest-path-in-an-unweighted-graph problem.
Jun 514 min read
Course Schedule II: A Step-by-Step Interview Walkthrough
Course Schedule II is the natural sequel to Course Schedule, and interviewers often pose it as a follow-up after you've solved the feasibility version. The shift is small to state but significant in practice: instead of asking whether all courses can be finished, it asks you to produce a valid order to finish them.
Jun 310 min read
Course Schedule: A Step-by-Step Interview Walkthrough
Course Schedule is a problem whose entire difficulty lies in recognizing what it's actually asking. The framing — courses, prerequisites, "can you finish everything?" — sounds like a scheduling or simulation problem, and candidates who take that framing literally end up trying to build actual orderings and check them, which is both hard and slow. The candidates who pass are the ones who strip away the cover story and ask: when is it impossible to finish all courses?
Jun 213 min read
Clone Graph: A Step-by-Step Interview Walkthrough
Clone Graph is a problem that looks like a routine traversal until you remember one thing: graphs can loop back on themselves. The interviewer is using this problem to test whether you can handle the three things that make graph copying genuinely tricky.
May 2911 min read
Number of Islands: A Step-by-Step Interview Walkthrough
Number of Islands is a common interview problem because it tests a specific cognitive move: can you recognize that a problem presented in one form is actually a different problem in disguise? The 2D grid framing is intuitive — humans naturally think of grids as visual things — but the underlying problem is counting connected components in a graph. The signal here is whether you can map between representations — see past the surface presentation to the underlying structure.
May 2614 min read
Path Sum in a Binary Tree: A Step-by-Step Interview Walkthrough
Path Sum in a Binary Tree is a deceptively simple-looking problem that interviewers use as a reading comprehension test as much as an algorithm test. The problem statement contains specific constraints that, if misread, lead candidates to solve a harder problem than the one asked. Candidates who skim the requirements often write algorithms that handle "any path" or "any node to any node," which is significantly more complex and earns no extra credit.
May 2511 min read
Binary Tree Maximum Path Sum: A Step-by-Step Interview Walkthrough
Binary Tree Maximum Path Sum is one of the genuinely hard tree problems in the standard interview rotation. Most tree problems are about traversing a structure or computing a single value per node. This one asks something more subtle: find the best path anywhere in the tree, where "anywhere" includes paths that don't start at the root, don't end at a leaf, and bend through any node.
May 2412 min read
Serialize and Deserialize Binary Tree: A Step-by-Step Interview Walkthrough
Serialize and Deserialize Binary Tree is one of the rare interview problems that's actually a design problem. There's no fixed answer — you get to choose your own encoding, and the interviewer is watching to see whether your choice is principled or arbitrary. The signal here is whether you can think about data as having structure that needs explicit encoding, not just values that get written down.
May 2311 min read
Lowest Common Ancestor of a BST: A Step-by-Step Interview Walkthrough
Lowest Common Ancestor of a BST is a problem that interviewers use to test a specific kind of reading comprehension: did the candidate notice they were handed a BST, or did they treat it as a generic binary tree? The signal is whether you treat the data structure's invariants as algorithmic information rather than incidental detail.
May 229 min read
Kth Smallest Element in a BST: A Step-by-Step Interview Walkthrough
Kth Smallest Element in a BST is a problem interviewers reach for when they want to see whether you actually understand what a BST gives you, or whether you treat it as "just a tree." The interviewer is watching for whether you exploit that ordering or wastefully recompute it. The signal here is whether you treat a data structure's invariants as algorithmic information.
May 2111 min read
Validate Binary Search Tree: A Step-by-Step Interview Walkthrough
Validate Binary Search Tree is one of the great traps in the interview rotation. The problem looks like a five-line traversal, and most candidates write a five-line traversal that's almost right — passing every easy test case and failing one subtle one. The reason interviewers love it is that the wrong solution is genuinely tempting: "check that the left child is smaller and the right child is bigger" sounds like the definition of a BST, but it isn't.
May 219 min read
Convert Sorted Array to BST: A Step-by-Step Interview Walkthrough
Convert Sorted Array to BST is a problem interviewers like because it tests whether you understand that structure emerges from constraints, not from clever code. The problem gives you two requirements — BST ordering and height balance — and the right algorithm falls out almost immediately if you reason about what those constraints mean together. The signal here is whether you can extract algorithmic structure from problem constraints rather than fighting them.
May 209 min read
bottom of page