- LeetCode 149 – Max Points on a Line
A Hard problem whose algorithm is trivial and whose difficulty is entirely how you represent a slope. Floating point is unsound as a hash key and fails silently on large coordinates; an unreduced pair splits equal slopes; a reduced pair without a sign convention splits opposite directions.
- 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.