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.→JavaScript objects look like hash maps, but engines don't treat them that way. How hidden shapes and inline caches turn property access into a single memory load — and the coding habits that quietly switch that optimization off.
Local variables vanish when a function returns; objects outlive it. The two regions of memory behind that difference, why assigning an object never copies it, and what it means for closures, performance, and leaks.
Machine clocks drift, so timestamps can't tell you which of two events in a distributed system came first. Logical clocks can — Lamport clocks give a consistent order, vector clocks tell you whether an order exists at all.
The key prop isn't there to silence a console warning. It's how React decides whether an element is the same thing it rendered last time — and getting it wrong moves state to the wrong row. How the diff works, and how to pick a key.
Spread and Object.assign copy one level; everything below is shared. Why that causes “I copied it and the original still changed”, how structuredClone fixes it, and the functions, classes and DOM nodes it refuses to touch.
Models don't see characters or words — they see tokens, produced by byte-pair encoding. How BPE learns its vocabulary, why it explains so many odd LLM behaviours, and what it means for cost and context limits.
A request timed out. Did the charge go through? The client can't know, so it has to retry — and the server has to make that retry harmless. How idempotency keys work, and the race conditions a naive implementation misses.
B-trees update pages where they live. LSM trees buffer writes in memory, flush them as immutable sorted files, and merge those files in the background. How the memtable, SSTables, tombstones and compaction fit together — and what reads pay for it.
Compare a fingerprint of each window instead of the window itself — and update that fingerprint in O(1) as the window slides. The string-matching algorithm that also powers plagiarism detection, rsync, and content-defined chunking.
Dijkstra locks in a node the moment it's popped, which is exactly what breaks when an edge weight is negative. Bellman-Ford gives up that greed, relaxes every edge V − 1 times, and can tell you when no shortest path exists at all.
148 posts · page 7 of 15