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.→
September 24, 2026Binary Search on the Answer5 min read

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.

#DSA
September 24, 2026Longest Increasing Subsequence in O(n log n)5 min read

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.

#DSA
September 24, 2026Reservoir Sampling: A Fair Sample From a Stream You Can't Count4 min read

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.

#DSA
September 23, 2026Reflow, Repaint, Composite: The Browser Rendering Pipeline4 min read

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.

#JavaScript
September 22, 2026Immutability and Structural Sharing4 min read

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.

#JavaScript
September 22, 2026Streams and Backpressure: Why Your Node Process Runs Out of Memory4 min read

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.

#JavaScript
September 21, 2026Distributed Tracing: Reading the Waterfall4 min read

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.

#System Design
September 21, 2026Web Workers: Getting Heavy Work Off the Main Thread4 min read

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.

#JavaScript
September 20, 2026Distributed Locks: Why Your Lock Isn't Holding4 min read

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.

#System Design
September 19, 2026Hoisting and the Temporal Dead Zone5 min read

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.

#JavaScript

148 posts · page 9 of 15