Blog
Notes on data structures & algorithms, system design, and things I learn along the way.
Learning DSA? Follow the structured path — ordered articles from recursion to dynamic programming.→Quicksort recurses into both halves. Quickselect recurses into one — and that single change drops the expected cost from O(n log n) to O(n). How it works, why it's linear, and when a heap is the better call.
A sorted linked list with express lanes stacked on top. Search, insert and delete in O(log n) expected time, with no rotations and no rebalancing — just a random height for each new node. Why Redis sorted sets use one.
OFFSET is a position in a result set that keeps changing, and it gets slower the deeper you go. A cursor is a value in the data. When each one is the right answer.
An instant and a wall-clock reading are different things, and Date conflates them. What DST actually does to your data, and how Temporal's types stop the bugs at the point of modelling.
Save the row, then publish the event. Two writes, no shared transaction, and a window where one succeeds and the other doesn't. Why no ordering fixes it, and what does.
Prompt engineering without measurement is guessing with extra steps. How to build an eval set from real traffic, pick a grader that isn't lying to you, and avoid tuning your way to a number that means nothing.
Everything an agent reads is input, and a model has no structural way to separate instructions from data. Why mitigations in the prompt are not a boundary, and where the real one goes.
A twenty-character input, a regex that looks fine, and a CPU pinned for minutes. Why backtracking engines go exponential, how to spot the pattern, and what to do instead.
A list of numbers where distance means similarity. What cosine similarity measures, why the same word can have two vectors, and the queries embeddings are quietly bad at.
Promises have no cancel button. AbortController is the standard signal that does — for fetch, event listeners, streams, timers, and your own async functions.
148 posts · page 8 of 15