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.
July 18, 2026Caching Strategies: Cache-Aside, Write-Through, and Write-Back5 min read

Adding a cache in front of a database is easy. Deciding when the cache gets populated and how writes stay consistent with the source of truth is where cache-aside, write-through, and write-back diverge — each trading latency against staleness risk differently.

#System Design
July 18, 2026The CAP Theorem and Eventual Consistency, Explained5 min read

Every distributed database quietly picks a side in a trade-off it can't escape: when the network partitions, you serve either possibly-stale data or an error. CAP theorem names that choice — and explains why 'eventual consistency' is a deliberate design, not a bug.

#System Design
July 17, 2026Proxy and Reflect: Intercepting JavaScript Objects4 min read

Proxy lets you intercept fundamental operations on an object — get, set, delete, has — before they happen. It's the mechanism behind Vue's reactivity, ORMs, and API validation layers.

#JavaScript
July 17, 2026WeakMap and WeakSet: Memory-Safe References in JavaScript5 min read

A regular Map keeps its keys alive forever, which turns 'metadata keyed by object' into a memory leak. WeakMap holds weak references instead, letting the garbage collector reclaim entries the rest of the program has already forgotten.

#JavaScript
July 16, 2026Async/Await Under the Hood: Promises in Disguise4 min read

async/await isn't a new concurrency model — it's syntax sugar over promises and generators. Understanding the desugared version explains error handling, sequential-looking parallel bugs, and why 'async' functions always return a promise.

#JavaScript
July 16, 2026KMP String Matching: Search Without Backtracking5 min read

The naive substring search re-checks characters it's already seen and degrades to O(nm) on adversarial input. The Knuth-Morris-Pratt algorithm precomputes a failure table so the search pointer never moves backward, guaranteeing O(n + m).

#DSA
July 15, 2026Dijkstra's Algorithm: Shortest Paths With a Priority Queue4 min read

BFS finds shortest paths when every edge costs the same. Dijkstra's algorithm generalizes that to weighted graphs by always expanding the closest unvisited node next — the algorithm behind every routing map you've used.

#DSA
July 15, 2026Merge Intervals and Greedy Interval Scheduling5 min read

Calendar conflicts, meeting rooms, and 'maximum non-overlapping tasks' are all interval problems that collapse into a single sort-then-scan pattern once you pick the right key to sort by.

#DSA
July 14, 2026Bloom Filters: Probably in the Set, Definitely Not4 min read

A probabilistic data structure that answers set-membership queries in constant space by allowing false positives but never false negatives — and why Chrome, Cassandra, and CDNs all rely on that trade.

#DSA#System Design
July 14, 2026Segment Trees: Range Queries in O(log n)5 min read

When an array changes and you still need fast range sum, min, or max queries, prefix sums stop working. Segment trees answer both range queries and point updates in logarithmic time.

#DSA
July 13, 2026Backtracking: Brute Force with an Undo Button4 min read

One template solves permutations, subsets, N-Queens, and Sudoku. Learn the choose–explore–unchoose pattern and how pruning turns exponential search into something usable.

#DSA
July 13, 2026Big-O Notation: A Practical Guide for Working Developers5 min read

What Big-O actually measures, how to read a function's complexity straight from its shape, and why O(n log n) beats O(n²) long before n gets big.

#DSA
July 13, 2026Database Indexing: Why Your Query Is Slow (and How B-Trees Fix It)5 min read

What an index physically is, how B-trees make lookups logarithmic, composite index ordering, covering indexes, and the query patterns that silently refuse to use your index.

#System Design
July 13, 2026ESM vs CommonJS: What Actually Differs (and Why It Still Bites)5 min read

require vs import isn't just syntax — it's dynamic vs static, copies vs live bindings, sync vs async. A field guide to the module systems and the interop errors between them.

#JavaScript
July 13, 2026Event Delegation: One Listener to Rule the List4 min read

How DOM events really travel — capture, target, bubble — and how delegation exploits bubbling to handle a thousand rows with a single listener.

#JavaScript
July 13, 2026JavaScript Memory Management: How the Garbage Collector Thinks5 min read

Reachability, generational GC, and the four leak patterns that survive garbage collection — timers, detached DOM nodes, growing caches, and forgotten listeners.

#JavaScript
July 13, 2026Load Balancing Strategies: From Round Robin to Consistent Hashing5 min read

How load balancers decide where each request goes — the classic algorithms, L4 vs L7, health checks, and the sticky-session problem that pushes state out of your servers.

#System Design
July 13, 2026Stacks and Queues: Two Rules That Run Your Whole Program5 min read

LIFO and FIFO look trivial until you notice they power your call stack, undo history, browser navigation, and every BFS. Plus the classic interview patterns for each.

#DSA
July 13, 2026Topological Sort: Putting Dependencies in Order5 min read

Build systems, package managers, and course schedulers all answer the same question: what order satisfies every dependency? Kahn's algorithm answers it — and detects impossible cycles.

#DSA
July 13, 2026Union-Find: Connectivity in (Almost) Constant Time5 min read

The disjoint set union structure answers 'are these two connected?' in near-O(1) — with two optimizations you can write in twenty lines. Includes Kruskal's MST and cycle detection.

#DSA
July 12, 2026Consistent Hashing: Scaling Without Reshuffling Everything4 min read

Why `hash % N` falls apart the moment you add a server, and how consistent hashing moves only a fraction of your keys when the cluster changes.

#System Design
July 12, 2026Generators and Iterators: Functions That Pause4 min read

The protocol behind for...of, the spread operator, and async/await — plus generator functions, which can pause mid-execution and resume exactly where they left off.

#JavaScript
July 11, 2026Bit Manipulation Fundamentals3 min read

The operators every developer half-remembers — AND, OR, XOR, shifts — and the handful of tricks that turn them into fast, elegant solutions.

#DSA
July 11, 2026Tries: Searching by Prefix4 min read

The data structure behind autocomplete and spellcheck. How a trie stores words as shared character paths, and why lookups cost the length of the word — not the size of the dictionary.

#DSA
July 10, 2026Heaps and the Priority Queue4 min read

How a heap keeps the smallest (or largest) element one lookup away, why it's stored in a plain array, and the sift-up/sift-down operations that keep it valid.

#DSA
July 10, 2026Linked Lists and Floyd's Cycle Detection3 min read

Why linked lists still matter, and the two-pointer trick that detects a loop in one pass with no extra memory — the famous tortoise and hare.

#DSA
July 9, 2026Dynamic Programming: From Memoization to Tables3 min read

DP is not a scary black box — it's recursion that stops repeating itself. Follow one problem from exponential recursion to a linear table, one cell at a time.

#DSA
July 9, 2026Graph Traversal: BFS and DFS Side by Side3 min read

Breadth-first and depth-first search are the same algorithm with one data structure swapped. See both walk the same graph, and learn which to reach for.

#DSA
July 8, 2026Recursion and the Call Stack: What Actually Happens3 min read

Recursion feels like magic until you see the call stack. Here's the mechanical picture — frames pushing and popping — plus base cases, stack overflows, and tail calls.

#DSA
July 8, 2026Two Pointers and the Sliding Window3 min read

Two of the highest-leverage array patterns in interviews and real code — how they turn nested O(n²) loops into a single O(n) pass, and when each one applies.

#DSA
July 7, 2026Prototypes and Inheritance: How JavaScript Objects Really Work6 min read

The prototype chain is the engine behind every JavaScript object and the class keyword is sugar on top of it — here's how the whole thing actually works.

#JavaScript
July 7, 2026The this Keyword: Four Rules That Explain Every Case4 min read

Why this is confusing in JavaScript and how four simple binding rules — plus arrow functions — determine its value in any situation.

#JavaScript
July 7, 2026Type Coercion and Equality: Making Sense of == in JavaScript5 min read

Why [] == ![] is true and other coercion puzzles — the actual rules behind == , truthiness, and the handful of habits that keep them from biting.

#JavaScript
July 6, 2026Binary Search and BSTs: Halving Your Way to O(log n)5 min read

How binary search eliminates half the problem with every comparison, and how binary search trees turn the same idea into a data structure — with interactive animations.

#DSA
July 6, 2026Closures in JavaScript: Private State, Loops, and Stale Values5 min read

What a closure actually is, how the scope chain makes it work, and the three places closures matter most — private state, the classic loop bug, and React hooks.

#JavaScript
July 6, 2026Debounce vs Throttle: Taming Event Storms in JavaScript4 min read

An interactive guide to debouncing and throttling — when to use each, how to implement them from scratch, and the edge cases that bite in production.

#JavaScript
July 6, 2026Hash Maps Under the Hood: Why O(1) Comes With an Asterisk5 min read

How hash maps actually work — hashing, buckets, collisions, and resizing — with an animated walkthrough and a from-scratch implementation.

#DSA
July 6, 2026The JavaScript Event Loop: How Async Actually Works5 min read

A visual, step-by-step guide to the event loop — call stack, task queue, microtasks, and async/await — with interactive animations you can play through.

#JavaScript
July 6, 2026JavaScript Promises in Depth: Chaining, Errors, and Combinators5 min read

The rules that make promises predictable — state transitions, how .then chains really resolve, error propagation, and when to reach for all, allSettled, race, or any.

#JavaScript
July 6, 2026Building an LRU Cache From Scratch4 min read

Why the classic interview question is really a lesson in composing data structures — with an animated walkthrough and two working implementations.

#DSA#System Design
July 6, 2026Quick Sort and Heap Sort: The In-Place O(n log n) Sorts6 min read

A visual walkthrough of quick sort and heap sort — how partitioning and heaps achieve O(n log n) without merge sort's extra memory, with animated demos and code in Java and JavaScript.

#DSA
July 6, 2026Rate Limiting Algorithms: Token Bucket, Windows, and Their Trade-offs5 min read

How APIs decide who gets throttled — token bucket, fixed and sliding windows, animated demos of each, and what changes when the limiter goes distributed.

#System Design
July 6, 2026WebSockets vs SSE vs Polling: Choosing a Real-Time Strategy4 min read

Four ways to get server data to the browser without a refresh — animated message flows for each, and a decision guide drawn from building live-data UIs.

#System Design
July 5, 2026Sorting Algorithms Explained: Bubble, Selection, Insertion, and Merge Sort5 min read

A visual, hands-on walkthrough of four classic sorting algorithms with animated demos and code in both Java and JavaScript.

#DSA
September 22, 2024How to Create Your First Micro-Frontend Using NextJS8 min read

Build a micro-frontend architecture with Next.js multi-zones: rewrites, assetPrefix, cross-zone navigation, shared auth, deployment, and the pitfalls nobody mentions.

#System Design