Start Here
This blog is a study log for a technical software architecture interview. It is written in a fixed order, and the posts build on each other. If you read them in the sequence below, each design question will make sense the first time, because the concept it depends on has already been explained.
How Every Post Is Built
Each question post has the same shape, so you can skim them the same way:
- The question, phrased the way an interviewer asks it, plus the common variants
- What they are really asking, meaning the competency being probed
- The gotchas, where candidates go wrong and why
- How to answer, a structured walkthrough with diagrams and trade-off tables
- Follow-up questions to expect
- Key takeaways
Subject posts drop the first section and explain a concept the design questions depend on. Every gotcha from every post is collected on the Gotchas page, and every term is defined on the Glossary page.
The Reading Order
Foundations, in sequence
- How to Run the First Five Minutes of a System Design Interview. The opening that every later design uses: restate, scope, name the non-functional requirements, estimate three numbers, find the hard part, agree on a plan.
- Back-of-Envelope Numbers Every Architect Should Have Memorized. The reference page for the “estimate three numbers” step: time conversions, the latency ladder, throughput per node, sizes, costs, availability math.
- What Consistency Actually Means. The ladder from linearizable to eventual, the anomaly each level prevents, and the mechanism that enforces it. This is the vocabulary for “the display is eventual; the decision is linearizable.”
- Transaction Isolation Levels. The other axis: what concurrent transactions on one copy can do to each other, what your database actually defaults to, and the toolbox for preventing lost updates and write skew without serializable.
- Idempotency Keys, Properly. How retries are made safe: who generates the key, where the record lives, how the check is made atomic, what to return on replay. Every design with a payment or a queue depends on this.
- Sagas and the Outbox Pattern. How a process spans services without a distributed transaction. The outbox fixes the dual-write bug; the saga sequences local transactions with compensations.
- Design a Ticket Booking System. The capstone. A full design that uses all six foundations and points at each one where it applies.
Scaling the data layer
Subject posts that go one level deeper on a decision the design questions keep touching. Read them after the foundations.
- How Would You Shard This Database?. Six decisions in order: whether to shard at all, the shard key, how keys map to shards, routing, the queries that lose the key, and what breaks across shards, with resharding without downtime and the thirty-second answer.
- What Sharding Takes Away. The companion: why one engine seeing every row is what gave you joins, transactions, unique constraints, and auto-increment IDs, why each breaks across shards, what replaces it, and the rule that a unique constraint survives only if it includes the shard key.
- Geohash vs. Quadtree: How Proximity Search Actually Works. Why an ordinary index cannot answer “what is near me”, how geohash and the quadtree each fold two dimensions into one, where each breaks (cell edges, density, moving objects), the alternatives (S2, H3, R-trees, Redis GEO), and how to choose by workload.
System shapes
Minute one of every design answer is naming the system’s shape, because the shape tells you where the difficulty lives. Each of these posts takes one shape from the first five minutes table and works through its examples: what defines the shape, the generic architecture and the arithmetic, the standard problems, and what makes each example different. Read them after the foundations, in any order.
| Post | Examples | Where the difficulty lives |
|---|---|---|
| Read-Heavy Lookup | URL shortener, product catalog, profile service | Cache and read path; who notices when it is stale |
| Write-Heavy Ingest | Metrics, logging, clickstream | Ingest path, storage tiering, downsampling |
| Fan-Out | News feed, notifications, chat | Delivery to many recipients; hot users |
| Contended Writes | Ticketing, inventory, auctions | Consistency on a hot row; the peak moment |
| Coordination | Schedulers, workflow engines, locks | Leases, exactly-once claims, failure recovery |
| Real-Time | Ride matching, live location, collaborative editing | Latency, ordering, stateful connections |
Design questions
Each of these is a complete answer to a classic question. Read them after the foundations, in any order.
| Post | Shape of the system | The hard part |
|---|---|---|
| Design a URL Shortener | Read-heavy lookup | ID generation and the 301 vs. 302 decision |
| Design a Rate Limiter | Coordination on a shared counter | Atomicity in the store, and what happens when the store is down |
| Design a Distributed Job Scheduler | Coordination with time | At-least-once delivery, leases, and misfire policy |
| Design a Ticket Booking System | Contended writes with a peak | The hold, the waiting room, and the payment saga |
| Monolith or Microservices? | An organizational decision disguised as a technical one | Naming the trade-offs and what would change your mind |
Leadership and behavioral
- “Tell Me About a Time an Architecture Decision Went Wrong”. How to choose the story, tell it in six beats, and handle the follow-ups that catch people blaming the team.
- “How Do You Disagree With a Senior Engineer?”. The companion question: a playbook for pushing back with evidence, calibrating to reversibility, and committing once the decision is made.
- “Tell Me About a Time You Pushed Back on a Deadline”. The third behavioral question: find out why the date exists, size the gap with numbers, bring options across scope, time, people, and risk, and deliver what was chosen without cutting quality quietly.
- “What Is Your Biggest Weakness?”. The self-knowledge question, answered with analysis paralysis as the weakness and the Bezos decision rules as the method: classify the door, decide at seventy percent, disagree and commit, minimize regret, and end with what it still costs.
- “Tell Me About a Time You Influenced Without Authority”. The architect’s central mechanic: start from the other team’s incentives, bring evidence aimed at their actual objection, shrink the ask to a pilot with their criteria, do the first work yourself, let them own the result, and make it a default. With the line between influence and lobbying, and when borrowed authority is right.
Coding screens
The Kotlin Track page indexes these seven posts: the thirty problems grouped by pattern family, the phrases in a prompt that give each pattern away, where each planted bug came from, and a one-line answer for every conceptual question.
- Ten Coding Interview Questions in Kotlin. The ten patterns a senior coding round draws from, each with an idiomatic Kotlin solution, the mistake interviewers listen for, and the Kotlin-specific traps that give away occasional users.
- Ten More Coding Interview Questions in Kotlin. Part two: monotonic stacks, two pointers, bounded tree recursion, topological sort, quickselect, backtracking, and the trie, with a second set of Kotlin traps.
- Ten Coding Interview Questions in Kotlin, Part Three. The last ten patterns: union-find, XOR and bit counting, two-dimensional DP, interval scheduling with a heap, KMP, Dijkstra, binary search on the answer, patience-sorted LIS, tree serialization, and the two-heap median, with a third set of Kotlin traps.
- Concurrency in Kotlin. The coroutine questions senior loops ask: structured concurrency, cooperative cancellation, dispatchers, exception propagation, shared mutable state, and Flow versus Channel, ending with the fetch-with-a-budget question that combines them all.
- “Find the Bug in This Function”. The debugging round: ten functions with one planted bug each, drawn from the gotchas in the three posts above, with the failing input, the class of bug, the minimal fix, and the method that finds them in under a minute.
- JVM Runtime Questions for Kotlin Candidates. One layer down: the memory model and what each primitive guarantees,
synchronizedversusMutex, what boxes,lazyandobjectinitialization, inner versus nested, garbage collection and what actually fixes a pause, the JIT, classpath skew, and a diagnosis playbook. - Functional Programming in Kotlin. Immutability that is real, sealed types that make illegal states unrepresentable, the three error channels and when each applies, laziness with a cost model, fold and composition,
tailrec, and where the pure approach stops paying on the JVM.
Reference Pages
- Gotchas: every gotcha from every post, grouped by theme, as a pre-interview checklist.
- Quiz: the same gotchas with the explanation hidden until you click, with shuffle and a per-browser “I know this” mark so you can drill the ones you do not.
- Glossary: one line per term, linked to the post that explains it.
- Kotlin Track: the seven Kotlin posts on one page, with the thirty problems by pattern, the conceptual questions with one-line answers, and a snippet of the idioms to type before a coding screen.
- Categories and Tags for browsing by topic.
What Is Coming
More design questions written at the ticket-booking depth (payments, news feed, distributed cache, chat, workflow orchestration), more subject posts (versioning and conditional writes, consensus, retries and circuit breakers, multi-region), and more of the leadership questions that come with the role. The Archives page lists everything by date.