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.→The array isn't sorted. There is no array. You can still binary search — as long as you can write a yes/no question whose answers flip exactly once.
The O(n²) dynamic program is the one everyone learns. The faster version keeps one array of 'best endings' and binary searches it — and the array it builds is not the answer.
Pick k items uniformly at random from a sequence of unknown length, in one pass, holding only k items. The algorithm is four lines; the proof is one induction step.
Why animating left janks and animating transform doesn't. The five stages of a frame, which properties skip which stages, and what layout thrashing actually costs.
Copying a whole object to change one field sounds wasteful — and isn't, because almost nothing gets copied. How structural sharing works, why it makes === a valid change check, and where it quietly breaks.
A fast producer and a slow consumer need a way to say 'wait'. What backpressure is, how pipeline() gives it to you for free, and why the version with the callback silently buffers everything.
Logs tell you what one service did. Metrics tell you that something is slow. A trace tells you where the time went across every service a single request touched.
The main thread paints your UI and runs your JavaScript, and it can only do one at a time. What workers can and can't do, the cost of postMessage, and when the copy is worse than the work.
A lease can expire while the client that holds it is still running. Why process pauses break mutual exclusion, what fencing tokens fix, and when you shouldn't be using a lock at all.
Nothing moves to the top of the file. What actually happens is that bindings are created before any code runs — and let, const, var, and function declarations are created in four different states.
148 posts · page 9 of 15