- MySQL Interview – Advanced Queries
The whiteboard questions that separate people who have written SQL from people who have read about it. Second-highest value, top N per group, finding and deleting duplicates, a running total, gaps in a sequence, a pivot with conditional aggregation, rows in one table with no match in another, and month-over-month growth — each one solved, then explained, then checked against a real database.
- LeetCode 158 – Read N Characters Given Read4 II – Call Multiple Times
The same API with one sentence changed, and that sentence changes the design rather than the code. Problem 157 discards the surplus from its last chunk; called twice, that surplus is lost data. Three fields of state, and you have written a buffered reader.
- LeetCode 157 – Read N Characters Given Read4
An API-adaptation problem: a primitive that reads in 4-character chunks, a caller that wants exactly n. A short read means end of file, and both limits need guarding — writing past n is a buffer overrun into the caller's memory, not a wrong answer.
- MySQL Interview – Fundamentals
The questions almost every SQL interview asks, answered the way you would say them out loud. The difference between the joins, WHERE versus HAVING, DELETE versus TRUNCATE versus DROP, what an index actually is and its cost, primary versus unique key, NULL behaviour, the ACID properties with an example each, normalization up to third normal form, and UNION versus UNION ALL.
- LeetCode 156 – Binary Tree Upside Down
Pure pointer surgery with no search and no complexity to argue about. The whole problem is doing four assignments in an order that does not destroy what the next one needs — null out root.left before reading it and the subtree is gone. Both pointers must be nulled, not just one.