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.→
October 9, 2026Cookies, localStorage, sessionStorage, IndexedDB: Which Browser Storage When?3 min read

Browsers offer five places to keep data, and they differ in size, lifetime, scope, speed, and whether the server sees them. A side-by-side guide to choosing — and the security mistakes, like tokens in localStorage, that come from choosing wrong.

#Web
October 9, 2026Edit Distance: How Spell-Checkers Measure 'Close Enough'3 min read

The fewest inserts, deletes and substitutions to turn one word into another. How the Levenshtein distance is computed with a small DP table, how to recover the actual edits, and where it's used — from 'did you mean' to fuzzy search and DNA alignment.

#DSA
October 9, 2026Event Sourcing and CQRS: Storing What Happened, Not Just What Is3 min read

Instead of overwriting the current state, store every change as an immutable event and derive state by replaying them. What event sourcing gives you — full history, audit, time travel, new views of old data — what it costs, and how CQRS fits alongside it.

#System Design
October 9, 2026Floyd–Warshall: Shortest Paths Between Every Pair of Nodes3 min read

Dijkstra answers 'how far from here to everywhere'. Floyd–Warshall answers 'how far from everywhere to everywhere' — with three nested loops and one table. How the via-vertex idea works, how to rebuild the paths, and when it beats running Dijkstra many times.

#DSA
October 9, 2026Health Checks: Liveness vs Readiness, and the Restart Storm3 min read

'Is it alive?' and 'can it take traffic?' are different questions with different consequences: one restarts the process, the other just routes around it. How liveness, readiness and startup probes work, and the one mistake that turns a database blip into a full outage.

#System Design
October 9, 2026The Intl API: Formatting Numbers, Dates and Lists for Every Locale3 min read

1,234,567.89 or 12,34,567.89 or 1.234.567,89? JavaScript's built-in Intl API formats numbers, currencies, dates, relative times, lists and plurals correctly for any language — no libraries, no hand-written rules.

#JavaScript
October 9, 2026Error Handling in JavaScript: try/catch, Promises, and Error Causes3 min read

How errors travel up the call stack, how try/catch/finally works, why async errors become rejected promises, the fetch call that doesn't reject on a 404, and how to add context with error causes without losing the original problem.

#JavaScript
October 9, 2026Raft: How a Cluster Agrees on a Leader4 min read

Several servers need to agree on one ordered log, even when some crash. How Raft elects a leader with terms and randomized timeouts, why a majority is the magic number, and how replication and stale leaders are handled — the consensus algorithm behind etcd and many databases.

#System Design
October 9, 2026Service Workers: Making a Website Work Offline3 min read

A service worker is a script that sits between your page and the network and can answer requests itself. How it's installed and updated, the main caching strategies — cache-first, network-first, stale-while-revalidate — and the lifecycle details that trip everyone up.

#Web
October 9, 2026Declaration Files (.d.ts): Giving JavaScript Code TypeScript Types3 min read

How TypeScript type-checks code that isn't written in TypeScript: declaration files describe the shape of JavaScript that lives elsewhere. Where they come from — libraries, DefinitelyTyped, your own builds — and how to write one for an untyped module or a global.

#TypeScript

148 posts · page 2 of 15