- LeetCode 146 – LRU Cache
The most common design question on the list, and a design question rather than an algorithms one: no single structure does the job, and two together give O(1) everywhere. Why the list must be doubly linked, why sentinels delete a dozen branches, and why the node has to store its own key.
- MySQL – Replication
Running a second copy of the database. Asynchronous replication and what it costs you, setting up a primary and a replica with GTIDs from scratch, reading SHOW REPLICA STATUS and the one field that tells you it is behind, replication lag and the read-after-write bug it causes in an application, semi-synchronous replication, and read/write splitting — plus when a replica is not a backup.
- AWS – API Gateway: HTTP APIs, Routes and Custom Domains
HTTP API or REST API — one table, and for most backends the answer is the cheaper, faster one. Routes, proxy integration and the event shape your handler receives, CORS as configuration rather than code, and authorizers. Then the stage trap that makes one of your two URLs 404 forever: a named stage prefixes every path while a custom domain does not, and `$default` is the way out.
- LeetCode 145 – Binary Tree Postorder Traversal
The hardest traversal to write iteratively, and the standard answer avoids writing it at all: postorder reversed is node-right-left, which is preorder with the children swapped. Two lines changed and every awkwardness disappears — plus what it costs when you genuinely need it bottom-up.
- MySQL – The Binary Log
The log that makes replication and point-in-time recovery possible. What the binlog records and what it does not, ROW versus STATEMENT versus MIXED format and why ROW is the default now, reading one with mysqlbinlog, finding the statement that deleted the rows, replaying up to a position or a timestamp to recover, expire_logs_days and the disk it fills if you forget.