- LeetCode 101 – Symmetric Tree
Same Tree with two characters changed, and worth doing straight after it for exactly that reason. Symmetry is a property of a PAIR of nodes, so the recursion takes two arguments and crosses them. Plus the inorder-palindrome shortcut, and the tree that kills it.
- LeetCode 100 – Same Tree
The smallest possible tree recursion, and the template the harder tree problems are written against. Three base cases and one recursive step — and the ORDER of those base cases is the only thing that can go wrong, because each one protects the next from a null dereference.
- LeetCode 98 – Validate Binary Search Tree
The most famous wrong answer on the list: checking each node against its immediate children is not the BST property. A node's bounds come from every ancestor and narrow on the way down. Plus the Integer.MIN_VALUE sentinel trap, and the inorder alternative that generalises to Recover BST.
- LeetCode 94 – Binary Tree Inorder Traversal
Four lines recursively, which is why the statement ends with "could you do it iteratively?" — the recursion is the warm-up and the explicit stack is the question. Why the loop needs both halves of its condition, why no visited flag is required, and Morris traversal for when O(1) space is asked for.
- MySQL – Deadlocks
Two transactions each waiting for a lock the other holds. Reproducing one in two terminals so you can see it happen, reading SHOW ENGINE INNODB STATUS to find out which statements were involved, the difference between a deadlock and a lock wait timeout, gap locks and why REPEATABLE READ produces deadlocks READ COMMITTED does not, and the two fixes that actually work: consistent lock ordering, and retrying.