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.→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.
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.
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.
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.
'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.
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.
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.
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.
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.
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.
148 posts · page 2 of 15