- 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.
- MySQL – BETWEEN
BETWEEN as shorthand for two comparisons, and the two things that catch people out: it is inclusive at both ends, and on a DATETIME column `BETWEEN '2024-01-01' AND '2024-01-31'` silently drops almost the whole of the 31st. NOT BETWEEN, BETWEEN on strings, and the half-open `>= ... < ...` form that is the right answer for dates.
- LeetCode 34 – Find First and Last Position of Element in Sorted Array
Plain binary search finds an occurrence; this wants the first and the last, and expanding outwards from a hit is O(n) the moment the array is all one value. The clean answer is one primitive — lower bound — called twice, with target + 1 giving the second answer. Why the window is half-open, and why removing the equality test removes the bugs.
- MySQL – NULL, IS NULL and ISNULL()
NULL is not a value, it is the absence of one, and every surprising thing about it follows from that. IS NULL and IS NOT NULL, the ISNULL() function, IFNULL() and COALESCE(), why `= NULL` is always false, how NULL behaves in aggregates and in GROUP BY, and the nullable column the pizza schema uses on purpose — `user_id` is NULL exactly when the order was placed by a guest.