- Designing a Notification System
One system, three channels, and every hard part in the delivery guarantees. Provider abstraction so a failing vendor is a config change, fan-out that survives a burst, retries and deduplication when delivery is at-least-once, the preference and opt-out rules that are a legal requirement rather than a feature, rate control so a bug cannot send ten thousand emails, and the templating that keeps copy out of code.
- LeetCode 139 – Word Break
Where greedy string matching visibly fails and DP visibly saves it, with a counterexample small enough for a whiteboard. The reframing is the usual one — can the first i characters be built? — and dp[0] = true is doing real work. Plus why the dictionary must be a set.
- 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.