How Memory Works in AI Agents: Working, Episodic, Semantic, and Long-Term
The model is the CPU. Memory is the hierarchy you build around it, and the hard part was never storage.
How Agentic Workflows Are Designed: Plan, Act, Observe, and the Control Loop
The model is one node inside a state machine, and the edges around it are where reliability is won or lost.
AI Guardrails: Input Filtering, Output Validation, and Defending Against Jailbreaks
The model is the untrusted component in your own architecture, and every control that holds is the code that does not run inside it.
REST vs gRPC vs GraphQL: Choosing an API Contract
The question is never which protocol wins. It is which contract belongs at this boundary, because the caller decides.
How an API Gateway Works: The Front Door to Your System
One thin entry point implements auth, throttling, TLS, and routing once at the edge so a fleet of services can stay focused on business logic.
How to Version and Evolve an API Without Breaking Your Clients
The whole problem exists because you cannot redeploy your clients, so every technique here is about making change invisible until they opt in.
Sessions, Tokens, and OAuth2: How Auth Works and Where It Breaks
Every auth design is a bet on one number: how long a stolen credential stays valid after you want it dead.
How Autoscaling Works: Reacting to Load Without Falling Over
Autoscaling is a control loop with minutes of dead time, and every hard part follows from that one fact.
Backpressure: How Systems Say "Slow Down" Before They Fall Over
When work arrives faster than you can finish it, you get exactly three choices, and picking none of them is how the queue eats your memory.
Cache Invalidation: The Hardest Easy Problem in Computer Science
A cache is a copy that is allowed to lie, and the entire discipline is bounding how much it lies and for how long.
Change Data Capture: Turning Your Database Into an Event Stream
Stop publishing events next to your database writes and start reading the commit decision the database already made.
The Stop Condition Is the Feature: Running Claude Code Loops Like You Mean It
A loop that runs is a demo. A loop you can walk away from needs four things the CLI does not give you: a budget, a real stop condition, an independent check, and a way to see what happened.
Row vs Columnar Storage: Why Analytics Databases Are Built Differently
One choice about how a table is laid out on disk decides everything downstream, from compression to CPU execution to which queries are fast.
Consensus for Builders: How Raft Actually Works
Consensus sounds like a theory problem until a stale leader serves a customer the wrong balance, and then it is your problem.
Cloud Cost Optimization: A Senior Engineer's Lens on the Bill
Cost is a non-functional requirement you trade against reliability and velocity, not a virtue you chase to zero.
CRDTs: How Distributed Systems Agree Without a Leader
They converge without a leader by making merge order stop mattering, and you pay for that in metadata you can never quite throw away.
Data Modeling: Normalization, Denormalization, and Designing for Access Patterns
The senior skill is not picking a side between normalized and denormalized; it is enumerating the access patterns and choosing per workload.
How Package Managers Resolve Dependencies: SAT Solving and PubGrub
Picking one version of every package that satisfies every constraint is provably as hard as Boolean satisfiability, and that single fact explains every resolver you have ever cursed at.
Blue-Green, Canary, and Progressive Delivery: Shipping Without Downtime
A deploy strategy is not about avoiding bugs. It is about controlling how many users meet the bug before you can pull it back.
Design Google Docs: Collaborative Editing Without Losing a Keystroke
Two people typing at the same spot is a distributed systems problem wearing a text cursor, and the answer is never to silently drop one of them.
Design a Logging and Monitoring System: Centralized Logs at Scale
Logging volume routinely exceeds the production traffic it reports on, and every real design decision falls out of surviving that fact cheaply.
Design Netflix: Streaming, the CDN, and Open Connect
The hard part of Netflix was never storage or compute, it was moving tens of terabits per second of video to the right eyeballs at the right moment, which is why they built a CDN that lives inside your ISP.
Design Uber: Dispatch, Geospatial Indexing, and ETA
Finding the nearest driver is a geometry problem hiding a database problem hiding a streaming problem, and the naive answer is wrong at all three layers.
Design WhatsApp: Real-Time Messaging at Planet Scale
The hard part was never the firehose of messages; it was holding tens of millions of mostly-idle connections cheaply and still guaranteeing an offline recipient eventually gets each one.
Design YouTube: Upload, Transcode, and Serve at Planet Scale
The write path is an embarrassingly parallel job queue and the read path is a CDN, and the candidates who keep those two halves separate are the ones who pass.
Distributed Locks: Why They Are Harder Than They Look
The timeout that saves you from deadlock is the exact thing that lets two clients hold the lock at once.
How Distributed Tracing Works: Spans, Context Propagation, and Sampling
Metrics tell you the p99 got worse and logs scatter the story across twenty services; a trace is the only signal that reassembles one request as a single connected object.
Distributed Transactions and the Saga Pattern: Trading Isolation for Availability
A saga keeps three letters of ACID and quietly drops the fourth, and the whole pattern is a negotiation over the one it gives up.
How Embeddings Work: Turning Meaning Into Vectors
An embedding does not store meaning. It stores a geometry of trained similarity, and the difference is the whole engineering problem.
How to Build Evaluation Harnesses for LLM and Agent Systems
A system you cannot measure is a system you cannot safely change, and every model swap becomes a blind bet.
Design a Feature Flag Platform: Decoupling Deploy from Release
Deploy puts dormant code on the server. Release is a runtime data change that turns it on for a cohort, and the gap between them is the whole platform.
Design a File Storage and Sync System (Dropbox / Google Drive)
A file is not bytes in a database row, it is an ordered list of content hashes, and once you see that the whole design falls into place.
The GPU Economics of LLM Inference: Why Serving AI Is So Expensive
You are paying a GPU to drag the model out of memory one token at a time, and the only way to make that cheap is to share each trip across more requests.
HLD vs LLD: What High-Level and Low-Level Design Actually Mean
They are two altitudes of one design, and the thing that separates a staff engineer is the willingness to fly between them on demand.
How a CDN Works: Edge Caching, Anycast, and the Last Mile
You cannot out-engineer the speed of light, so the only durable fix is to move the bytes closer.
How a Search Engine Works: The Inverted Index (Lucene and Elasticsearch)
Search looks like a read-time lookup, but every fast query is paid for at write time by an index that did the hard work in advance.
Leader Election: How Distributed Systems Pick a Boss and Survive Losing One
Picking a leader is the easy half; the murder is in agreeing the previous one is actually dead.
How Ranking Works: From BM25 to Learning-to-Rank
Retrieval finds the few hundred candidates worth looking at; ranking decides the exact order, and they are different jobs with different costs.
How to Design a Ledger: Double-Entry Accounting for Engineers
A balance is not a number you store, it is a sum you prove every time someone asks.
How LLM Inference Serving Works: Continuous Batching, KV-Cache, and Paged Attention
Generating a token is mostly waiting on memory, which is the one fact that explains every serving trick worth knowing.
How LLM Quantization Works: FP16 to INT4, GPTQ, AWQ, and the Accuracy Trade
Naive rounding destroys a large model because of one percent of its numbers, and the whole field is three different ways to protect them.
Design a Stock Exchange: The Matching Engine, the Order Book, and Determinism
The fastest matching engine in the world runs on one thread, and that is the optimization rather than the compromise.
MCP: How AI Agents Get Hands (the Model Context Protocol)
A tool the model can call is an action it can be tricked into taking, and MCP makes connecting those tools the easy part while trusting them stays hard.
How Model Routing and Cascades Work: The Right Query to the Right Model
Paying frontier prices for a FAQ lookup is the default waste, and a good router is the cheapest engineering you will ever ship to fix it.
Designing Multi-Agent Systems (and When a Single Agent Is Better)
Most designs that call themselves multi-agent should be one agent with good tools, and the token bill is the reason why.
Multi-Region and Disaster Recovery: RPO, RTO, and the Cost of Always-On
Active-active is not the summit everyone should climb; for most systems it is a multi-master write problem with a permanent latency tax and a legal minefield.
MVCC and Isolation Levels: How a Database Serves Concurrent Transactions
Snapshot isolation feels like serializability right up until two transactions read the same rows, write different ones, and quietly break an invariant nobody guarded.
Design a Notification System: Push, SMS, and Email at Fan-Out Scale
Every delivery pipeline guarantees at-least-once, and your users feel every duplicate as spam. The whole design is a negotiation between those two facts.
Database Sharding: Splitting Data When One Machine Is Not Enough
Sharding does not make your database faster. It trades a capacity ceiling for a permanent tax on every query that forgets the shard key.
Design a Presence System: Who Is Online at Scale
A senior engineer does not try to make the green dot always correct; they write down exactly how wrong it is allowed to be.
Bloom Filters, HyperLogLog, and Count-Min Sketch: Being Wrong on Purpose to Save Memory
The skill is not knowing these structures save memory; it is knowing exactly which lie each one buys you.
How Quantum Computing Differs From the Chip in Your Laptop
It does not try every answer at once, and believing that it does is the fastest way to misjudge what it can actually do.
WebSockets vs SSE vs Long Polling: Choosing a Real-Time Transport
A shallow answer reaches for WebSockets. A senior answer makes you justify why Server-Sent Events were not enough.
How Recommendation Systems Work: From Collaborative Filtering to Two-Tower Retrieval
The metric that wins the contest is almost never the product, and the gap between them is the whole education.
Retries, Timeouts, and Circuit Breakers: Keeping One Failure From Becoming an Outage
A dependency that fails fast returns your thread. A dependency that hangs holds it, and held threads are how one slow service drains an entire fleet.
Design Search Autocomplete (Typeahead) That Feels Instant
Sub-100ms suggestions are a data-structure problem wearing a latency problem as a disguise.
Secondary Indexes: How Databases Find a Row Without Scanning Every One
An index makes reads fast because it makes writes do more work, and that trade is the whole story.
SLOs and Error Budgets: Deciding What "Reliable Enough" Means
An error budget turns the endless fight between shipping fast and staying up into a single number both sides spend against.
R-Trees and Spatial Indexing: How "Find Nearby" Actually Works
A B-tree sorts one column; the plane has no sort order that keeps neighbors close, so proximity needs a structure that reasons about regions.
How Stream Processing Works: Windows, Watermarks, and Exactly-Once
Every hard part of stream processing is the same problem wearing a different hat: you can never be sure you have seen everything yet.
Threat Modeling for System Design: The Security Pass a Senior Runs
Most security work happens after the breach. Threat modeling is the half hour at the whiteboard that moves the fight earlier, before any code exists to attack.
How Time-Series Databases Work: Why Metrics Need a Different Engine
A metrics workload is append-only at "now" and read in windows, and a purpose-built engine wins by exploiting that shape to do less work and store far fewer bytes.
How Tokenization Works: Why LLMs See Tokens, Not Words
The tokenizer is a separate frozen artifact bolted to the front of the model, and almost every weird LLM failure traces back to it.
How Tool-Calling Works: Function Schemas, the Model, and the Execution Loop
The model never runs your tool. It emits a JSON object that names one, and everything that matters lives in the loop you wrap around that.
Generating Unique IDs at Scale: UUIDs, Snowflake, and ULID
Picking an ID scheme is a three-way bet between coordination, sortability, and index locality, and no scheme wins all three.
CAP, PACELC, and the Consistency Spectrum (Beyond "Pick Two")
A partition forces a choice between consistency and availability, but the rest of the time you are trading latency against consistency on every single operation.
Capacity Estimation on a Napkin (Without Fooling Yourself)
The estimate that cannot change your decision should never be computed. Everything else is theater with extra significant figures.
Consistent Hashing and the Art of Rebalancing
The ring is not the answer. It is the first move in a design space, and knowing what the ring still gets wrong is the whole skill.
Choosing a Database by Data Structure, Not by Logo
The database name is the last decision you make, and the most reversible one, so stop making it first.
Design Instagram: The Feed and the Media Pipeline
The feed never stores a single pixel, and the day you understand why is the day this problem gets tractable.
Design Twitter/X: Timeline Fan-Out and the Hybrid Push/Pull Model
The architecture is a function of the graph, and the celebrity is where every pure strategy goes to die.
Inside a Distributed Cache: Eviction, Sharding, Hot Keys and the Thundering Herd
A cache is a staleness budget you spend on speed, and every interesting failure is the bill arriving at once.
Event-Driven RBAC: Authorization When Every Request Asks Permission
Permissions become a caching problem long before they become a scaling problem. The real skill is knowing which half of that problem is allowed to be slow.
How an LLM Actually Works: Transformer Inference for System Designers
An LLM at inference is a bandwidth-bound streaming loop with a quadratic cost term and a cache that quietly decides your per-token price.
Idempotency and the Exactly-Once Lie
Every system that sells exactly-once is really at-least-once delivery plus a dedup trick at a boundary someone chose carefully.
Idempotent Webhooks: Making At-Least-Once Delivery Behave Like Exactly-Once
Exactly-once delivery is a myth the network will never grant you. Exactly-once processing is a unique constraint and a little discipline.
Log-Based Brokers vs Message Queues: Kafka, SQS and RabbitMQ Under the Hood
The split is not streaming versus messaging. It is whether the broker deletes a message when you acknowledge it, or keeps it and tracks where you are.
Latency vs Throughput, and the Tyranny of the Tail
The average latency is a number no real request experiences, and at fan-out the tail you ignored becomes the median your users feel.
LSM-Tree vs B-Tree: The Storage Engine Decision That Defines Your Write Path
Every storage engine is a bet on two of three things, and the third one degrades whether you planned for it or not.
Metrics, Logs and Traces: Designing the Three Pillars Without Going Bankrupt
Each signal bills on a different cost axis, and the senior skill is choosing which one you are buying before observability outgrows the system it watches.
The Payment System Nobody Sees Fail: Gateways, Idempotency, Retries and the Ledger
A payment system is judged by what it never does: lose a dollar, double a charge, or trust the gateway over its own books.
Designing a RAG System: From Chunk to Answer, and Every Way It Breaks
Retrieval and generation fail independently, so you have to instrument both or you will blame the model for a retrieval miss.
Design a Rate Limiter: Token Bucket vs Sliding Window
The algorithm is the easy half. The interview is won on the race condition between two nodes and the failure mode when Redis is gone.
Replication Strategies That Survive Failure
Every replication design is a bet about which failure you can tolerate, and the bet only comes due when a node dies.
The System Design Interview, Reverse-Engineered: A Repeatable Framework
You do not fail system design for not knowing enough. You fail for how you behave under ambiguity.
Design a URL Shortener (TinyURL / bit.ly): The Read Path Is the Whole Design
The write path can be almost anything; every hard decision in this system lives on the read path, and the candidate who optimizes writes has misread the problem.
How Vector Databases Work: HNSW, IVF and Product Quantization
Every vector index is the same three-way bet between recall, latency, and memory, and the whole job is knowing which corner to give up.