- LeetCode 173 – Binary Search Tree Iterator
Inorder traversal split across two methods, and that is the whole insight — the descend-left loop becomes the advance step and the stack becomes the object's state. Plus the amortised argument that makes next() O(1) on average when a single call can clearly do O(h) work.
- LeetCode 170 – Two Sum III – Data Structure Design
Not an algorithms problem — a question about which operation gets called more often. Two designs with opposite costs, and the answer the interviewer wants is the sentence that chooses between them. Plus why it must count rather than use a set: find(4) after one add(2) is false.
- MongoDB – Indexes and the ESR Rule
Single, compound, multikey, unique and partial indexes, the field order that makes them work, and how to read explain().
- LeetCode 169 – Majority Element
Boyer-Moore voting is four lines that look like they cannot be correct, and the counting argument is short enough to give out loud: every disagreement cancels a pair, and a strict majority cannot be exhausted. The algorithm does not find the majority — it eliminates everything that cannot be it.
- LeetCode 168 – Excel Sheet Column Title
Looks like base-26 and is not: Excel's digits run A to Z representing 1 to 26, with no symbol for zero. That single missing digit is the entire problem, the fix is one decrement inside the loop, and 26 vs 27 is where every wrong solution shows itself.