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.→Connect every node for the least total weight. Two greedy algorithms that both work, the one theorem that explains why, and how to choose between them.
A prefix sum array answers range queries in O(1) but costs O(n) to update. A Fenwick tree makes both O(log n) using nothing but the lowest set bit of an index.
A queue deletes a message when it's handled; a log keeps it and tracks who has read how far. That one difference decides replay, fan-out, ordering, and how you debug a bad deploy.
When a dependency is down, the worst thing you can do is keep waiting for it. Three states, the thresholds that matter, and how a breaker stops one slow service from taking down everything upstream.
Most RAG failures are retrieval failures, not generation failures. How chunking and embeddings decide what the model ever sees, the similarity-is-not-relevance trap, and what actually fixes it.
The window is a budget you refill from scratch every turn. Where the tokens actually go in an agent, why prompt caching is a prefix match, and the difference between clearing context and compacting it.
A naive retry loop is a denial-of-service attack you wrote yourself. Exponential backoff, why jitter matters more than the backoff, idempotency, and retry budgets.
Replication copies the same data; sharding splits different data. What each one actually buys you, how routing and failover behave, and the problems sharding creates that you have to live with.
A tool is a name, a description, and a JSON Schema — and the description is prompt text that gets read every turn. Schema design, validation, error messages that repair, and why fewer tools work better.
One extra term in the priority function turns an exhaustive search into a guided one. What admissible and consistent heuristics mean, why they preserve optimality, and where A* degrades.
148 posts · page 10 of 15