- MongoDB – Schema Validation
$jsonSchema, validation levels and actions — and why a flexible store still wants rules at the boundary.
- LeetCode 151 – Reverse Words in a String
One line in Python and a real exercise in Java, which is what makes it a good question. Reverse the whole string, then reverse each word back — the first pass fixes the order and breaks the spelling, the second fixes the spelling without moving anything. The spaces are the fiddly part.
- MySQL – Running Queries in Production Safely
The habits that keep an ad-hoc query from becoming an incident. Reading before writing, wrapping a change in a transaction you can roll back, sql_safe_updates, always EXPLAIN before running something new against a big table, deleting and updating in batches, MAX_EXECUTION_TIME, finding and killing a runaway query with SHOW PROCESSLIST, the slow query log, and why a long ALTER TABLE needs a plan.
- 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.