- LeetCode 198 – House Robber
The DP that introduces a choice: Climbing Stairs counted branches and added them, this picks the better of two. Same dependencies, different combiner. And the alternating greedy everyone proposes fails on [2,1,1,2], where the best answer skips two houses in a row.
- AWS – KMS and Encryption at Rest
Encryption at rest is a checkbox until something needs decrypting from another account. Customer managed keys versus AWS managed keys and the cost and control that separates them, envelope encryption in one diagram, and the key policy — which is the resource policy that IAM alone cannot override. Rotation, aliases, and the deletion window that is the only irreversible button in the service.
- LeetCode 189 – Rotate Array
The array version of Reverse Words in a String, using the identical three-reversal trick. It is also where forgetting k %= n turns a correct algorithm into an exception, and where the Python one-liner rebinds a local name so the caller sees nothing at all.
- 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.