- LeetCode 138 – Copy List with Random Pointer
Clone Graph in a linked list's clothes: you cannot point at a node that does not exist yet, and random pointers point forwards. The map answer is short and correct. The O(1) answer stores the mapping inside the list itself by weaving each copy in after its original.
- LeetCode 136 – Single Number
The problem that teaches XOR as a tool rather than a curiosity. Linear time and constant space rule out both obvious answers, and what is left is a one-line fold — which looks like magic until you name the three properties, including the commutativity that handles unsorted input.
- LeetCode 134 – Gas Station
Eight lines of code and a proof that is the entire interview. Why a non-negative total guarantees a solution exists, and why running dry at station i rules out every start from the current candidate through i — which is what makes it one pass instead of quadratic. The reset is Kadane, read differently.
- LeetCode 133 – Clone Graph
The traversal is the easy part. One hash map does two jobs — visited set and old-to-new mapping — and one line decides whether the function terminates at all: register the clone BEFORE recursing, or an undirected edge sends you straight back and never bottoms out.
- MongoDB – Data Modeling: Embed or Reference
The one decision that shapes every MongoDB schema, with the 16 MB limit, unbounded growth and the real cost of denormalization.