- Designing a URL Shortener
The classic warm-up question, worked properly. Requirements and estimates, base62 encoding against hash-and-truncate, how to handle collisions without a retry loop that never terminates, the 301-versus-302 decision that also decides whether you get analytics, the read path and its cache, custom aliases, and expiry that does not require scanning the table.
- MySQL – ORDER BY
Sorting results. ASC and DESC, sorting by several columns, sorting by an expression or an alias, where NULLs land in MySQL and how to force them to the other end, sorting by a column you did not select, and why a query without ORDER BY has no guaranteed order at all — even when it looks sorted every time you run it.
- LeetCode 36 – Valid Sudoku
No algorithm at all — a bookkeeping problem. Rows, columns and all nine boxes can be checked in a single pass, and the only interesting line is the formula mapping a cell to its box: (row / 3) * 3 + col / 3. Encoding three facts per cell into one set, why valid is not the same as solvable, and the bitmask version for when you are asked to drop the hashing.
- MySQL – LIKE and Pattern Matching
Matching text patterns. The `%` and `_` wildcards, ESCAPE for matching a literal percent sign, why LIKE is case-insensitive here and what the column's collation has to do with it, NOT LIKE, REGEXP when LIKE is not enough, and the performance rule worth remembering: `LIKE 'Pep%'` can use an index and `LIKE '%roni'` cannot.
- AWS – Load Balancers: ALB, NLB and Target Groups
ALB or NLB, decided in one table instead of three paragraphs. The target group is the object that actually matters and the health check on it is what decides whether your deploy is a deploy or an outage — including the arithmetic that turns a 30-second interval into a two-and-a-half minute outage. Path and host routing rules, sticky sessions and why you probably do not want them, and draining connections.