Fundamentals
Mock Interview Strategy
I have had interviews where I solved the problem correctly and still got rejected. I have also had interviews where I struggled significantly with the …
Hard Composites
There is a class of interview problem designed specifically to differentiate senior candidates. These are not problems where knowing one pattern is …
Design Problems
Design problems in coding interviews are different from system design rounds. You are not sketching architecture at a whiteboard — you are …
Concurrency Problems
Concurrency problems are the ones where an interviewer can tell immediately whether you actually understand concurrency or have just memorized …
Intervals
Interval problems show up everywhere — in calendar APIs, in resource scheduling, in genomics, in timeline visualizations. In interviews they appear in …
Greedy
Greedy algorithms have a brutal failure mode in interviews: the solution looks obvious, you implement it in fifteen minutes, and then the interviewer …
Backtracking
Backtracking scared me for a long time. The problems looked like they needed some clever mathematical insight — some observation that would magically …
Trie
Tries showed up in a Google interview I did early in my career. The problem was autocomplete. I started sketching a hash map of prefixes to word lists …
Heap Patterns
The first time I saw a “find the K largest elements” problem in an interview, I sorted the array and returned the last K. Correct answer, …
Monotonic Stack
I used to brute-force “next greater element” problems. Nested loops, O(n²), and a silent prayer that the input was small. Then a senior …
Bitmask DP
Every DP pattern we’ve covered has kept the state manageable: an index, a remaining budget, a mode. Bitmask DP enters the picture when the state …
State Machine DP
Most DP problems have a clean one-dimensional state: position in an array, remaining capacity, current index. State machine DP adds another dimension …
Interval DP
Interval DP is the pattern that solves problems where you need to find the optimal way to process a contiguous segment, and the answer depends on how …
Knapsack Patterns
Knapsack is one of those patterns that shows up in disguise constantly. You’ll see problems framed as “partition this array,” …
DP on Trees
Tree DP is the pattern that catches people by surprise. You’ve been thinking of DP as filling a 1D or 2D table from left to right — a …
DP on Strings
String DP has its own flavor that’s distinct from the two-string comparison problems of the last lesson. Here, the state is typically a single …
2D DP Advanced
Edit Distance from the previous lesson is the template for a whole family of problems. Any time you’re comparing two strings — finding common …
2D DP Basics
1D DP was a single row — you filled it left to right and you were done. 2D DP extends that to a full table. You fill it row by row, and each cell …
1D DP Advanced
Climbing Stairs and House Robber have a comfortable property: dp[i] depends on just the previous one or two positions. Each step you take looks back a …
1D DP Basics
Every time I bombed a DP problem in a mock interview, the pattern was the same: I stared at the problem, thought “this looks like DP,” …
Interview Patterns L20: Shortest Path
In L16, I explained why BFS solves shortest path problems in unweighted graphs — every edge costs the same, so distance equals hop count, and BFS …
Interview Patterns L19: Union Find
Union Find is one of those data structures that most people never implement until they need it in an interview, and then they discover it is both …
Interview Patterns L18: Topological Sort
Topological sort comes up whenever there is an ordering constraint — “A must happen before B,” “module X depends on module Y,” …
Interview Patterns L17: Graph DFS
Graph DFS is the tool you reach for when you need to explore every reachable node, not just the closest ones. Unlike BFS, which expands in rings of …
Debugging in Kubernetes
The most stressful hours of my on-call life have been in Kubernetes clusters where something was wrong but nothing was obviously broken. Pods in …
Interview Patterns L16: Graph BFS
The moment someone says “shortest path” in an interview, I mentally split the problem into two cases: weighted or unweighted? If …
Interview Patterns L15: Tree BFS Patterns
Level by level. That phrase shows up in maybe a third of binary tree interview problems, sometimes explicitly and sometimes disguised. “What …
Interview Patterns L14: Tree DFS Patterns
If a binary tree problem asks anything about paths — longest, shortest, sum along a path, common ancestor between two nodes — the solution is almost …
Interview Patterns L13: Tree Construction
Construction problems break the mold. Most tree problems ask you to read a tree and return something — a traversal, a value, a boolean. Construction …
Operators and CRDs
I used to manage PostgreSQL on Kubernetes with a collection of shell scripts and Helm hooks. Provisioning a new database instance meant running a …
Interview Patterns L12: BST Operations
BST problems are deceptively simple on the surface. The property is easy to state: every node’s left subtree contains only values less than it, …
Code Generation
The tree-walking interpreter in Lesson 3 works, but it has a ceiling. Every time you evaluate an expression, you traverse the AST from scratch. No …
Interview Patterns L11: Binary Tree Traversal
The moment an interviewer draws a binary tree on the whiteboard, a clock starts. They are not just testing whether you know what inorder means. They …
Recommendation Systems
Recommendation systems are the most economically consequential ML systems most engineers will ever build. Netflix estimates that its recommendation …
GraphQL in Go
Go is not the most common language for GraphQL tutorials. Most of the ecosystem documentation assumes you’re working in JavaScript or …
Math Patterns
Some interview problems look like they need a data structure or a clever algorithm, but the answer is actually just math. I’ve watched …
CQRS + Event Sourcing Together
CQRS and event sourcing are often discussed together, presented as a single package, and that conflation is responsible for a lot of unnecessary …
CAP Theorem in Practice
CAP theorem is probably the most cited and most misunderstood concept in distributed systems interviews. Candidates memorize “you can only pick …
Design Twitter/X
Twitter is the classic system design problem for good reason. It looks like a glorified blog until you start pulling on the threads: how does a tweet …
Your Story
Almost every interview starts the same way: “So, tell me about yourself.” And almost every engineer I’ve talked to hates this …
Bit Manipulation
Bit manipulation problems have a reputation for being tricks — the kind of problem where you either know the one-liner or you don’t, and if you …
Designing for Failure
In distributed systems, failure is not an exceptional case — it’s the default condition. Networks partition. Hard drives fail. Memory fills up. …
Randomized Algorithms
There is a class of production problems where exact answers are either impossible or not worth the cost. You want to know approximately how many …
Design a Payment System
Payment systems have a property that almost no other software has: the cost of a bug isn’t a bad user experience — it’s a legal liability …
Cryptographic Primitives
There is a joke in security circles: every developer thinks they can write their own crypto. The punchline is that everyone who has tried has been …
ConfigMaps and Secrets
We had a bug where the same Docker image was running in staging and production but behaving differently. I spent an hour diffing the code before I …
Model Serving
Training a model is satisfying. Deploying it to serve real traffic is humbling. I remember the first time I pushed a model to production and watched …
Server-Side WASM
When most people talk about WebAssembly, they mean the browser. That’s where it started, that’s where the tutorials are, and that’s …
Sorting in Interviews
Most candidates treat sorting as a black box — call sort.Ints and move on. That works until an interviewer says “can you do this without …
Design a Search Engine
Search is the feature that separates usable products from unusable ones at scale. When your application has thousands of documents, a sequential scan …
Paxos and Beyond
After spending time with Raft, I found myself curious about the algorithm it was designed to replace. Paxos has a reputation: brilliant, correct, …
AST and Evaluation
After the lexer and parser, we have a tree. A beautiful, hierarchical, unambiguous representation of the program. Now we need to make it do something. …
Compression Basics
Every senior engineer I know makes compression decisions regularly: should this API response be gzip-compressed? Should logs be stored compressed? …
Design a Notification System
Notifications are the feature that can make or break user retention — and also destroy it. Done right, they bring users back at exactly the right …
String Algorithms
String processing sits at the foundation of almost every production system. Log parsing, protocol parsing, search, validation, templating — it all …
Ring Buffers
The ring buffer is the data structure that makes real-time systems possible. Audio processing, network packet capture, kernel I/O buffers, metrics …
Design WhatsApp
WhatsApp is deceptively simple from a user perspective: you send a message, it arrives. But building a messaging system that handles 100 billion …
Projections and Read Models
After I shipped the event-sourced account system, the first question from the product team was: “Can we have a page that shows all accounts that …
Vacuum and Bloat
I watched a Postgres instance run out of disk space on a 500 GB SSD. The database had 50 GB of actual data. The other 450 GB was table bloat — dead …
Schema Design
The schema is the most important artifact in any GraphQL API. It is simultaneously the contract between your client and server, the documentation for …
Recursion
Recursion trips people up not because the concept is hard, but because they try to trace through it. “If I call f(3), then f(3) calls f(2), …
Design a News Feed
The news feed is the product feature that defines social media. Every time you open Instagram or Twitter, you see a personalized, ranked, real-time …
Skip Lists
Redis chose skip lists for its sorted set implementation, and that choice is more interesting than it first appears. When you have ZADD, ZRANGE, and …
Backtracking
Backtracking is the algorithmic equivalent of “try everything, but be smart about giving up early.” It is a systematic way to explore a …
Partitioning
I have worked with a few systems that had grown their main tables to 500 million rows or more. At that scale, even well-indexed queries start slowing …
Technical Debt
The term “technical debt” gets used to mean everything from “this code is a mess” to “we made a pragmatic shortcut we …
Design a Chat System
Building a chat system is the interview problem that catches people on protocol fundamentals. HTTP is a request-response protocol — the client asks, …
Bloom Filters
There’s a beautiful data structure that will tell you one of two things: “definitely not in the set” or “probably in the …
Greedy Algorithms
Greedy algorithms have a simple idea at their core: at each step, make the locally optimal choice. No looking ahead, no considering alternatives, no …
Leadership and Conflict
There’s a specific moment in every senior-level interview loop where the conversation shifts. The system design round wraps up, the coding is …
Memory-Mapped IO
I was reading about how RocksDB works one evening and kept seeing references to mmap for reads. I had heard of memory-mapped files but thought of them …
On-Call Engineering
I did 12 months of on-call on a team that hadn’t invested in reliability. The rotation was weekly. In a bad week, I’d get 15-20 pages. A …
Replication
The first time I had to fail over a Postgres primary, it was 2 AM, the primary was not responding, and I genuinely did not know whether the replica …
Migration Strategies
Rewrites are seductive. The existing system is messy, it’s slow to change, and the new system in your head is clean and fast and well-designed. …
Deployments and Scaling
The week before a major product launch, our Kubernetes cluster started evicting pods. Traffic was spiking as we ran load tests, but instead of scaling …
Tries
When you type “ath” into a search box and it suggests “atharva,” “athens,” and “athletics,” …
Design a URL Shortener
The URL shortener is the “Hello World” of system design interviews. It appears deceptively simple: take a long URL, return a short one. …
Service Mesh
A team I worked with had seventeen microservices. Each service had its own implementation of retry logic, circuit breaking, timeout handling, and …
Dynamic Programming Intuition
Dynamic programming has an intimidating reputation. The name sounds academic, the problems in textbooks often involve sequences and matrices, and the …
Feature Stores
There is a saying in machine learning that is so universally acknowledged it has become a cliché: 80% of the work in any ML project is feature …
Containers from Scratch
I spent the first two years of my career using Docker without understanding what it was actually doing. I thought containers were a “lightweight …
Feature Flags
We deployed a new checkout flow on a Friday afternoon. It had passed code review, passed testing, passed staging load tests. By Friday evening, the …
Connection Pooling
A Postgres connection is not cheap. When I first scaled a service from a single server to 20 replicas — each running a Go application with …
Raft Consensus
When I first tried to understand Paxos — the original distributed consensus algorithm — I read the paper three times and still felt like I was missing …
Parsing
The lexer gave us tokens. The tokens are still flat — a sequence with no hierarchy. The expression 1 + 2 * 3 produces six tokens, but it does not yet …
API Versioning
The first time I shipped a breaking change to a production API without a version, I got an incident at 2am because a partner integration stopped …
Graphs
Most engineers don’t think of themselves as solving graph problems. They think they’re deploying microservices, resolving package …
Rate Limiting
Without rate limiting, a single misbehaving client can consume all your resources and deny service to everyone else. A bug in a client that retries in …
Shortest Path
When I joined a team building a multi-region traffic routing system, the first thing I had to understand was why the routing decisions were not always …
gRPC and Protobuf
The first JSON API I replaced with gRPC was passing []Order objects around — each order had about 40 fields, most of which the caller never used. The …
Design Google Docs
Google Docs is the problem I recommend to every engineer who thinks they understand distributed systems. The surface looks trivial: multiple users …
Signals
The first time I deployed a service to Kubernetes and watched it restart, I noticed that requests in flight were sometimes failing with connection …
Load Testing
We load-tested our new checkout service before launch. 1,000 virtual users, 10 minutes, all hitting /v1/checkout sequentially. It passed with …
WASM from Go
I came to WebAssembly skeptically. The pitch — “run code anywhere, at near-native speed, in a sandboxed environment” — sounded like the …
Query Planning and EXPLAIN
The first time I ran EXPLAIN ANALYZE on a slow query, I stared at the output for five minutes and understood none of it. It looked like a compiler …
Heaps and Priority Queues
Every time your operating system picks the next process to run, it’s using a heap. Every time Kubernetes re-schedules a pod, it’s using a …
DDD Essentials
The concept of “customer” meant something different in every team I talked to at one company. To the billing team, a customer was a …
CDNs
Physics is the enemy of performance. Light travels through fiber optic cables at about 200,000 km/s — roughly two-thirds the speed of light in a …
BFS and DFS
Graph traversal sounds abstract until you realize that most interesting data in production is a graph. Service dependencies are a graph. Database …
WebSockets
When I first built a real-time notification system, I reached for WebSockets because that’s what everyone said to use for …
Event Store Design
My first encounter with event sourcing was a financial system that needed a complete audit trail. The business requirement was clear: every change to …
Epoll and IO Multiplexing
I used to wonder how a Go HTTP server could handle 100,000 concurrent connections with only 8 OS threads. If each connection required a dedicated …
B-Trees and B+ Trees
Every time PostgreSQL, MySQL, SQLite, or MongoDB uses an index, it’s almost certainly a B-tree or B+ tree underneath. Not a binary search tree — …
Monitoring and Alerting
The on-call rotation I inherited had 47 active alerts. On a bad week, the on-call engineer got paged 30 times. Most pages were “something might …
Transaction Isolation
I shipped a bug once that allowed a user to spend the same gift card balance twice. Two requests arrived nearly simultaneously, both read the same …
CQRS
I maintained an e-commerce admin dashboard that had a query so complex it took 12 seconds to run. It joined seven tables across the orders, inventory, …
Message Queues
Synchronous calls are elegant until they’re not. Service A calls Service B. B is slow. A waits. A’s request pool fills up. A becomes slow. …
Hashing and Consistent Hashing
I did not think much about hashing until I had to explain why a cache cluster was unusable after we added two new nodes. We had doubled the cache hit …
DNS
We pushed a production incident fix at 3am — rotated to a new IP address for a critical service, updated the DNS record, set the TTL to 60 seconds. …
Trees and BSTs
When you run SELECT * FROM orders WHERE user_id = 42, your database doesn’t scan every row. It walks a tree. Understanding why databases chose …
TCP/IP Stack
A load test I ran against a Go HTTP server one afternoon produced a strange result: throughput leveled off at about 30,000 requests per second and …
MVCC
One thing that puzzled me early on was how Postgres could let me read from a table while someone else was writing to it — without locking me out and …
Incident Response
The first major incident I was on-call for, I spent 90 minutes trying to fix the problem and 30 minutes frantically communicating to stakeholders in a …
GraphQL vs REST
I spent about six months being wrong about GraphQL. My first exposure to it was a rewrite pitch from a frontend engineer who was tired of making five …
Database Scaling
Your startup ships, gains traction, and one day your database becomes the bottleneck. Queries slow down. CPU spikes. The single machine hosting your …
Event-Driven Architecture
I used to use “event” and “command” interchangeably. A message is a message, right? Then I started debugging an event-driven …
ML Pipelines
The first time I built a “production ML pipeline,” it was a cron job that ran a Python script, trained a model, and saved the artifact to …
Two Pointers and Sliding Window
The first time I recognized the sliding window pattern outside a textbook, I was reading the source code for a rate limiter. There was no comment …
Linked Lists
Linked lists are where candidates reveal whether they actually understand pointers. You can read a hundred tutorials on reversing a linked list, but …
TLS Handshake
A colleague once asked me why adding TLS to a service increased our P99 latency by 50ms. She had measured it carefully, switching between HTTP and …
Stacks and Queues
Every time you make a function call, your program uses a stack. Every HTTP request in a web server sits in a queue. Every undo operation in your IDE …
File Descriptors
I got a 3 AM page for a service that was returning connection errors to every client. The application logs said dial tcp: lookup ...: too many open …
Design Uber
Uber is one of the most instructive system design problems because it forces you to think about real-time data pipelines, spatial indexing, and …
Pod Design Patterns
The first time I deployed a service to Kubernetes, I put everything in a single container. Logging, metrics, TLS termination, the actual application — …
Write-Ahead Log
Databases promise durability. When INSERT returns successfully, your data is safe — even if the server loses power a millisecond later. For a long …
Code Review That Works
I’ve been on the wrong end of bad code reviews in both directions. Reviews that were nitpick sessions about variable naming while missing a race …
Caching
Phil Karlton supposedly said: “There are only two hard things in Computer Science: cache invalidation and naming things.” He was joking, …
Clean Architecture
I’ve read the Clean Architecture book. I’ve also seen teams implement it so literally that they had six layers of indirection for a CRUD …
Binary Search
Binary search has a reputation as a simple algorithm — and it is, conceptually. Divide the search space in half, check the middle, repeat. Every …
Leader Election
I spent three days debugging a production incident where two nodes in our cluster both believed they were the primary. Each was accepting writes. Each …
Hash Maps
Hash maps are the workhorse of production software. Nearly every caching layer, session store, deduplication system, and configuration lookup …
HTTP/2 and HTTP/3
The first time I looked at a waterfall chart in Chrome DevTools and saw a hundred requests stacking up like rush-hour traffic, I knew HTTP/1.1 was the …
Virtual Memory
Early in my career I deployed a Go service and checked top. The VIRT column showed 1.2 GB. I nearly had a heart attack — our server had 4 GB of RAM …
The STAR Method
I used to dread behavioral interviews. I was confident in system design rounds, reasonably calm under algorithm pressure, but the moment someone said …
Binary Search
Binary search has a reputation as the thing you learned in your first CS course and never thought about deeply again. Then you encounter a rotated …
B-Tree Indexes
I once joined a team that had a users table with 8 million rows. The GET /users/{email} endpoint was consistently timing out under load. When I ran …
Git Beyond Basics
Most engineers use maybe 15% of Git. add, commit, push, pull, branch, merge, and status covers daily work. That’s fine until you need to find …
Lexing
I wrote my first lexer as a side project after reading the first chapter of “Writing an Interpreter in Go.” I expected it to be hard. It …
Load Balancing
The first time I drew a system design diagram in an interview, I drew a box labeled “load balancer” and drew arrows from clients to it, …
Monolith First
I’ve seen two teams start new products with microservices. One spent four months before they had anything deployed — Kubernetes setup, service …
Sorting in Practice
Sorting is one of those topics that feels like a solved problem until you actually need to care about it. Every language ships a standard sort. You …
TCP Deep Dive
I used to treat TCP as a black box. Data goes in one side, data comes out the other — reliably, in order, no duplicates. That was all I needed to …
Linked Lists
Linked lists are the most over-taught data structure in computer science and the most under-used structure in production systems. I’ve reviewed …
Processes and Threads
When I first started using Go seriously, I accepted goroutines as “lightweight threads” without really understanding what that meant. The …
How a Query Executes
Every time I call db.QueryContext(ctx, "SELECT * FROM orders WHERE user_id = $1", userID) in Go, I used to think the database just …
How the Internet Works
Every system design interview starts with the same silent assumption: you already know how the internet works. Interviewers won’t ask you to …
Big-O Thinking
I spent two years writing Go services before I really internalized Big-O. Not because I didn’t know the notation — every CS course teaches you …
Arrays and Memory Layout
I spent two years writing Go services before I genuinely understood why iterating over a two-dimensional slice in the wrong order could tank my …
Stack
The stack is one of those data structures that seems too simple to be interesting — push, pop, peek, done. Then you sit in an interview, stare at a …
Design YouTube
YouTube serves over 500 hours of video uploaded every minute and delivers billions of views per day. When I first studied this problem seriously, I …
Sliding Window
Sliding window problems have a tell: the problem asks about a contiguous subarray or substring, and there’s a constraint that makes the brute …
Two Pointers
One of my early interview mistakes was throwing a hash map at every array problem. It works a surprising amount of the time, but there’s a whole …
Arrays and Hashing
When I was preparing for my first round of FAANG interviews, I was overwhelmed. Hundreds of LeetCode problems, dozens of patterns, no clear starting …