- LeetCode 160 – Intersection of Two Linked Lists
An O(1)-space solution that looks like sleight of hand: when a pointer runs off one list, restart it on the other. The trick is two lines and the reason is one equation — a + c + b = b + c + a, so both arrive together. Switch on null, not on the last node.
- AWS – Alexa Skills: Where They Actually Live
Short and honest: an Alexa skill is not an AWS service. You build it on the Amazon Developer portal with the Alexa Skills Kit, and the only AWS part is the Lambda function it invokes. What that split means for where you configure things, what the ASK CLI does that the AWS CLI cannot, and how the skill's endpoint is wired to a function ARN. If you came here for AWS, the Lambda post is the one you want.
- LeetCode 159 – Longest Substring with At Most Two Distinct Characters
The sliding window at its most reusable, and unlike Minimum Window Substring it generalises to k by changing one literal. The single bug it has: a count that reaches zero must be DELETED, not left sitting there, or the map size counts characters that have already left the window.
- 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.