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 18, 2026Blue-Green and Canary Deployments: Shipping Without Holding Your Breath3 min read

How to release new versions with minimal risk: rolling updates, blue-green switches, canaries that expose a change to a small share of real traffic first, automated rollback on bad metrics, feature flags that separate deploy from release, and the database migrations that make rollback possible.

#System Design
October 18, 2026System Design Case Study: A Ride-Hailing Service11 min read

How an app like Uber or Ola matches riders with drivers: a high-write location service indexed by geo cell, matching ranked by ETA rather than distance, a trip state machine, live tracking over WebSockets, surge pricing, and the consistency questions behind 'two riders, one driver'.

#System Design
October 18, 2026System Design Case Study: A Web Crawler11 min read

Designing a crawler that fetches billions of pages politely: the URL frontier with per-host queues, robots.txt and rate limits, DNS caching, de-duplicating URLs with Bloom filters and content with fingerprints, avoiding crawler traps, freshness scheduling, and scaling it all across machines.

#System Design
October 18, 2026Flood Fill and Number of Islands: Graphs Hiding in Grids4 min read

A grid is a graph: each cell is a node, and its neighbours are its edges. How flood fill (the paint-bucket tool) and 'number of islands' are BFS or DFS over that implicit graph, how to avoid stack overflows and revisits, and the family of grid problems the same template solves.

#DSA
October 18, 2026Gossip Protocols and Failure Detection3 min read

How a cluster of hundreds of nodes agrees on who's alive without a central coordinator: each node periodically tells a random peer what it knows, information spreads in about log N rounds, and heartbeats riding along let everyone detect failures. With SWIM, phi accrual detectors, and the trade-offs.

#System Design
October 18, 2026HTTP Compression: gzip, Brotli and zstd3 min read

Text responses shrink by 5–20× when compressed, and browsers ask for it on every request. How Accept-Encoding and Content-Encoding negotiate a format, how gzip, Brotli and zstd compare, static versus on-the-fly compression, what not to compress, and the one security caveat.

#Web
October 18, 2026Huffman Coding: Compression with a Greedy Algorithm3 min read

Give frequent symbols short codes and rare ones long codes. How Huffman's algorithm builds an optimal prefix code by repeatedly merging the two least frequent symbols with a min-heap, why no code is a prefix of another, and where Huffman coding still runs today — inside gzip, PNG and JPEG.

#DSA
October 18, 2026Sorting Arrays in JavaScript: Comparators, Stability and Locale3 min read

Why [10, 9, 1].sort() returns [1, 10, 9], how comparator functions work, why sort is stable and what that buys you, sorting text correctly with localeCompare and Intl.Collator, multi-key sorts, and toSorted() for sorting without mutating.

#JavaScript
October 18, 2026JavaScript Collections: Map, Set, WeakMap and WeakSet6 min read

Objects make poor dictionaries: keys are coerced to strings, inherited properties get in the way, and size takes extra work. How Map and Set fix that — iteration order, identity-based keys, set operations, JSON — and how WeakMap and WeakSet stop object-keyed caches and metadata from leaking memory.

#JavaScript
October 18, 2026Why 0.1 + 0.2 ≠ 0.3: JavaScript Numbers and Floating Point4 min read

Every JavaScript number is a 64-bit binary float. Why that makes 0.1 + 0.2 equal 0.30000000000000004, why toFixed rounds 1.005 down, how large IDs silently change when parsed from JSON, and the practical rules: integer minor units for money, BigInt or strings for big IDs, and Intl for display.

#JavaScript

202 posts · page 1 of 21