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 30, 2026Hidden Classes and Inline Caches: Why Object Shape Matters4 min read

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.

#JavaScript
September 30, 2026The Stack and the Heap: Where JavaScript Keeps Your Data4 min read

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.

#JavaScript
September 28, 2026Lamport and Vector Clocks: Ordering Events Without a Shared Clock4 min read

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.

#System Design
September 28, 2026React Reconciliation: What Keys Are Actually For4 min read

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.

#JavaScript
September 28, 2026Shallow vs Deep Copy in JavaScript, and What structuredClone Can't Copy4 min read

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.

#JavaScript
September 28, 2026Tokenization: How LLMs Actually Read Text5 min read

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.

#AI Engineering
September 27, 2026Idempotency Keys: Making Retries Safe4 min read

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.

#System Design
September 27, 2026LSM Trees: Why Write-Heavy Databases Never Update in Place4 min read

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.

#System Design
September 27, 2026Rabin-Karp and the Rolling Hash5 min read

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.

#DSA
September 26, 2026Bellman-Ford: Shortest Paths When Edges Can Be Negative4 min read

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.

#DSA

148 posts · page 7 of 15