- MySQL – Views
Naming a query so the rest of the schema can use it. CREATE VIEW and CREATE OR REPLACE VIEW, what a view costs at query time, MERGE versus TEMPTABLE and why the second one loses your indexes, updatable views and the conditions they have to meet, WITH CHECK OPTION, using a view as a permission boundary, and why MySQL has no materialized views and what people do instead.
- LeetCode 104 – Maximum Depth of Binary Tree
Three lines, and the smallest problem where the recursive shape of tree algorithms is visible. The real value is the trap it sets up: swapping max for min does NOT give minimum depth, because a node with one child is not a leaf and the null branch reports a path ending in mid-air.
- LeetCode 103 – Binary Tree Zigzag Level Order Traversal
Level order with the direction alternating, and the answer people reach for first — reversing the queue — is the one that breaks. How you traverse and how you report are different things, and modifying the traversal to change the output is a category error.
- LeetCode 102 – Binary Tree Level Order Traversal
The problem that teaches BFS on trees, and everything depends on one line: capture the queue's size BEFORE draining the level. Looping on queue.size() re-evaluates a moving target and takes a meaningless slice. Also why deque beats a list in Python by a whole factor of n.
- 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.