Writing.
Data structures and system design taught from the first idea to expert level, and notes from running AI and messaging systems in production. Every concept links to the systems that depend on it.
Data structures & algorithms
Each data structure from the first idea to expert level, with interactive demos, exercises and where it shows up in real systems.
Big-O notation, from first idea to production
How to read time and space complexity, from counting loop steps to amortized analysis, query plans and N+1 bugs, with demos and production code.
Hash maps, from first idea to production
How hash maps and sets work, from a coat check to CPython's dict, Swiss tables and hash flooding, with demos, exercises and real production code.
The two pointers technique, from first idea to production
How two pointers work, from reversing a string to Floyd's cycle detection, PostgreSQL merge joins and one-pass sync diffs, with demos and exercises.
The sliding window technique, from first idea to production
How the sliding window technique works, from a running sum to monotonic deques, stream windows and TCP, with step-through demos and real production code.
Binary search, from first idea to production
How binary search works, from a guessing game to bisect, answer-space search, cache-friendly layouts, B-tree indexes and git bisect, with demos.
Heaps and priority queues, from first idea to production
How heaps and priority queues work, from ER triage to heapq, heapify, Dijkstra, timing wheels and the asyncio scheduler, with demos and production code.
System design
How real backend systems are designed, from the naive version to production, with the data structures underneath and the trade-offs at each step.
Designing a rate limiter, from first idea to production
How rate limiters work, from a ten-line counter to a distributed Redis design: five algorithms, a live simulator, two classic bugs and real production code.
Idempotency and safe retries, from first idea to production
Why retries double-charge and how to stop it: idempotency keys, upserts, backoff with jitter, the outbox and inbox, with live demos and real production code.
Caching, from first idea to production
How caching works, from TTLs and cache-aside to eviction, HTTP headers, stampedes and LLM caches, with two live simulators and real production code.
Queues and backpressure, from first idea to production
How job queues work, from one producer and one worker to Little's Law, Celery tuning, retry storms and backpressure, with two live simulators and real code.
Consistent hashing, from first idea to production
How consistent hashing works, from hash % N to rings, virtual nodes, jump hash, Maglev and Redis Cluster slots, with live demos and measured numbers.
Designing real-time chat, from first idea to production
How real-time chat works: polling vs WebSockets, message ordering, receipts, presence, fan-out across servers and slow readers, with live demos and real code.
Production notes
Notes from running AI and messaging systems in production: what broke, the numbers, and what I changed.
Pin your model IDs: when a “latest” alias tripled our price
A vendor moved a model alias and every AI feature changed model and price with no deploy. What we pin now, and why failover skips vendors without keys.
No lost turns: an AI reply pipeline that can’t silently drop a customer
Queues lose tasks and deploys kill workers. How an owed-reply marker, a 60-second sweeper and a sent marker make sure every customer gets an answer.
Congestive collapse: why our API got slower the harder we pushed it
Throughput fell from 157.6 to 55 req/s as load rose, with zero errors. How a latency-derived concurrency limit fixed it, and where it stops helping.