Interview Q&A — all questions by topic
Every chapter on this site ends with a Self-check: questions & answers section. This page lists every question, grouped by learning path and chapter and tagged with one of three importance levels, so you can decide what to study first.
Question bank generated: 2026-11-30
How to use it
- Each question links to its answer on the chapter page; the chapter page has Open all / Close all buttons and a level filter for self-testing.
- Short on time? Do the Must-know questions first, then Important.
- The levels are editorial: they say how often the question comes up in interviews and at work, not how hard it is.
Importance levels
- Must-know asked in almost every interview; you meet it at work constantly
- Important frequent; expected at senior level
- Good to know extra depth that sets you apart
At a glance
| Learning path | Chapters | Questions | Must-know | Important | Good to know |
|---|---|---|---|---|---|
| Software Design | 29 | 329 | 118 | 156 | 55 |
| Architecture | 21 | 244 | 84 | 108 | 52 |
| System Design | 75 | 847 | 293 | 382 | 172 |
| DDD & Microservices | 15 | 170 | 66 | 79 | 25 |
| Databases | 46 | 521 | 176 | 239 | 106 |
| Messaging | 33 | 356 | 126 | 158 | 72 |
| Go | 45 | 536 | 214 | 232 | 90 |
| Foundations | 18 | 207 | 75 | 90 | 42 |
| Python & FastAPI | 15 | 181 | 76 | 75 | 30 |
| Platform | 19 | 250 | 111 | 98 | 41 |
| Product | 1 | 13 | 6 | 5 | 2 |
| Total | 317 | 3654 | 1345 | 1622 | 687 |
Software Design
Software Architecture vs Software Design: Goals, History & Roles
Open the chapter · 11 questions
- Important 1 — Name the three stages of software design in SWEBOK v4 and give one decision for each.
- Good to know 2 — Why does SWEBOK v4 have a separate Architecture KA when the previous edition did not?
- Good to know 3 — State the IEEE 1471 definition and say what Fowler's definition adds.
- Must-know 4 — A decision takes two hours to reverse and affects one module. Does it need an ADR?
- Good to know 5 — What did Royce write about the simple waterfall figure?
- Important 6 — What flattens the cost-of-change curve, according to Fowler?
- Important 7 — Why is the cost-of-change curve not a law?
- Important 8 — In the example, why does
orderingown thePricerinterface in Go? - Important 9 — Give two ways to enforce an architecture decision automatically.
- Must-know 10 — How is technical debt related to design?
- Good to know 11 — Which path would you read to estimate Black Friday traffic for the pricing module?
The Design Process: Conceptual Design, CRC Cards, Technical Design & Compromise
Open the chapter · 11 questions
- Important 1 — What do the three parts of a CRC card stand for, and which part is asymmetric?
- Good to know 2 — Why do Parnas and Clements say we should "fake" a rational design process?
- Must-know 3 — What is the difference between conceptual and technical design?
- Important 4 — A controller computes late fees from a loan's fields. Which GRASP principles say what to change?
- Important 5 — What is satisficing and how does it apply to design?
- Must-know 6 — When is a spike the right tool, and what happens to its code?
- Important 7 — Throwaway versus evolutionary prototype: how do you choose?
- Must-know 8 — What goes into an ADR and when do you write one?
- Must-know 9 — Why is designing the database first risky?
- Important 10 — How do CRC cards relate to microservice boundaries?
- Good to know 11 — Name GRASP's nine principles.
Quality Attributes, Functional & Non-Functional Requirements
Open the chapter · 12 questions
- Must-know 1 — Classify: "Only the account owner can download invoices", "Download of a 50 MB invoice bundle takes under 10 s at p95", "Invoices stay on EU servers".
- Good to know 2 — List the nine ISO/IEC 25010:2023 characteristics and name two sub-characteristics of reliability.
- Important 3 — Name the six parts of a quality attribute scenario.
- Must-know 4 — Why is "average latency under 200 ms" a weak requirement?
- Must-know 5 — How much downtime does 99.9% allow in 30 days, and what do three serial services at 99.9% give together?
- Must-know 6 — What is the difference between RPO and RTO?
- Important 7 — What does an error budget let a team do?
- Important 8 — Give three trade-off pairs and one decision that moves each.
- Good to know 9 — What is a sensitivity point and what makes it a trade-off point?
- Must-know 10 — Which smells are in "The system must use Kafka and be user-friendly, etc."?
- Important 11 — Write a fitness function that keeps the domain layer free of HTTP in Go and in Laravel.
- Important 12 — When does a user story need a use case alongside it?
Object-Oriented Modeling: Abstraction, Encapsulation, Decomposition, Generalization, Polymorphism
Open the chapter · 12 questions
- Good to know 1 — What three properties does Alan Kay's 2003 definition of OOP name, and which familiar "pillar" is missing from it?
- Must-know 2 — A class has private fields and a public setter for every one of them. Is it encapsulated?
- Important 3 — Name the essential and the accidental parts of an
Orderin a shop. - Must-know 4 — An invoice and its lines: association, shared aggregation or composition? How does that show up in SQL?
- Good to know 5 — Why does
(new CountingTagSet)->addMany(['a','b'])report 4 attempts, and why is the composed version immune? - Important 6 — Classify: Go generics, PHP
interface+implements, Goswitch v.(type), PHP"5" + 1. - Good to know 7 — What prints, and why: an
SMSNotifierthat embedsNotifierand definesChannel(), calling the promotedSend()? - Important 8 — When should you prefer an enum plus
matchover an interface with one class per variant? - Must-know 9 — Two
Customerobjects have the same ID and different e-mails. Equal or not? TwoMoneyobjects have the same amount and currency. Equal or not? - Important 10 — Why does a well-encapsulated Go entity marshal to
{}, and what should you do? - Must-know 11 — Give two limits of the "nouns become classes, verbs become methods" heuristic.
- Must-know 12 — What may cross a microservice boundary from your object model, and what may not?
UML in Practice: Class, Sequence, State, Activity, Component, Package & Deployment Diagrams
Open the chapter · 11 questions
- Must-know 1 — Name the two diagram families and two diagrams of each.
- Important 2 — What exactly does a filled diamond promise that a hollow one does not?
- Must-know 3 — Which visibility symbol should a Go unexported field get, and why?
- Important 4 — How do you draw "Order line has quantity and price at time of sale, linking Order and Product" in UML and in SQL?
- Must-know 5 — In a sequence diagram, how do you tell a synchronous call from an asynchronous one?
- Must-know 6 — What is the difference between
altandopt? - Important 7 — Read this transition label:
paymentDeclined [attempts < 3] / scheduleRetry(). - Good to know 8 — A composite state is left via
holdand re-entered viaH*. What state is the machine in afterresume? - Important 9 — Why is the use case diagram considered weak, and what do you use instead?
- Important 10 — When would you choose a C4 container diagram over a UML deployment diagram, and when the other way round?
- Important 11 — How can a hand-written state diagram be kept from rotting?
Clean Code Principles: Naming, Small Units, Pure Functions & Side Effects, DRY/YAGNI/KISS and Their Failure Modes
Open the chapter · 13 questions
- Must-know 1 — What makes a function pure, and why does it matter for testing?
- Must-know 2 — Explain functional core, imperative shell with an example.
- Must-know 3 — When should you extract duplicated code?
- Must-know 4 — Why are flag arguments a smell, and what replaces them?
- Must-know 5 — Guard clauses or nested ifs, and what do Effective Go and Code Review Comments say?
- Important 6 — What is command-query separation, and when do you break it?
- Important 7 — What is the difference between idempotent and pure?
- Important 8 — Cyclomatic and cognitive complexity: how do they differ and which tools measure them?
- Important 9 — Where do Clean Code and A Philosophy of Software Design disagree?
- Important 10 — What is YAGNI, and what does it not forbid?
- Important 11 — Which tools would you put in CI for a Go service and a Laravel app?
- Good to know 12 — What do the FIRST principles ask of a test?
- Good to know 13 — Why is a Go struct passed by value not automatically immutable?
Design Quality: Complexity, Coupling & Cohesion, Information Hiding, Separation of Concerns, Conceptual Integrity
Open the chapter · 12 questions
- Important 1 — What are Ousterhout's three symptoms of complexity, and what are its two causes?
- Good to know 2 — Put these in order from tightest to loosest: stamp, content, data, control, common, external.
- Important 3 —
func Render(o *Order, asCSV bool)uses which two kinds of coupling, and how do you fix them? - Important 4 — A
boot()function opens the database, warms the cache and posts to Slack. Which cohesion level is it? - Must-know 5 — A class has only private fields and a public getter and setter for each. Does it practise information hiding?
- Must-know 6 — In Go, where should the
Paymentsinterface used byordersbe declared, and what shouldstripepay.Newreturn? - Important 7 — What is a pass-through method and why is it a red flag?
- Important 8 — Package A has Ca = 6 and Ce = 2. What is its instability, and may it depend on package B with I = 0.8?
- Good to know 9 — Order
role == 2,New(a, b, true, false)andInit() before Send()by connascence form. - Must-know 10 — Two services read and write one
customerstable. Name the coupling and two costs microservices.io lists. - Important 11 — How does a team lose conceptual integrity, and name two countermeasures.
- Must-know 12 — Does replacing a synchronous call with an event remove all coupling?
Composing Objects & the Law of Demeter
Open the chapter · 10 questions
- Important 1 — Why does
Dog.Describe()in Go print "Rex makes a sound" even thoughDogdefinesSpeak? - Must-know 2 — Name the friends of a method under the Law of Demeter.
- Important 3 — Is
$users->map(...)->filter(...)->sum()a violation? - Important 4 — Why are PHP traits not composition?
- Important 5 — What is the composition root and where is it in Laravel?
- Good to know 6 — When is Hide Delegate a mistake?
- Must-know 7 — How does Tell Don't Ask relate to the Law of Demeter?
- Important 8 — Does
preventLazyLoadingfix a Demeter violation? - Important 9 — What is the service-level version of a message chain?
- Must-know 10 — Why do tests get easier with composition?
Code Smells, Anti-Patterns & Refactoring (the 14 smells and their moves)
Open the chapter · 12 questions
- Must-know 1 — What two conditions make a code change a refactoring?
- Must-know 2 — Divergent change and shotgun surgery: which is which?
- Good to know 3 — Why did Fowler rename "Switch Statements" to "Repeated Switches" in 2018?
- Must-know 4 — You find the same 6 lines in two places. Do you extract them?
- Must-know 5 — A legacy controller has no tests and you must change it. What is your first step?
- Important 6 — During a refactoring, the characterization test reveals that the quote endpoint charges 0 for unknown shipping. What do you do?
- Important 7 — Which golangci-lint linters would you enable to find long functions, duplication, magic numbers and globals?
- Must-know 8 — Is Laravel Pint a refactoring tool?
- Good to know 9 — How does Refused Bequest appear in Go, which has no inheritance, and how do you fix it?
- Must-know 10 — What is the difference between a code smell and an anti-pattern?
- Must-know 11 — Why is renaming a field in a published event not a refactoring?
- Good to know 12 — Name the three architectural smells Arcan detects from the dependency graph and one cure for each.
Low-Level Design: Classes, Responsibilities, Relationships, Structured vs OO Design
Open the chapter · 12 questions
- Must-know 1 — What is the difference between HLD and LLD, and what artifacts does each produce?
- Good to know 2 — Name two pictures of structured design and what each shows.
- Important 3 — Why is "find the nouns" an incomplete way to find classes?
- Good to know 4 — List the six Wirfs-Brock role stereotypes and give a parking example for three of them.
- Important 5 — What is the difference between aggregation and composition, and how does Go express each?
- Important 6 — Why does Go's "accept interfaces, return structs" put the interface in the consumer's package?
- Important 7 — Is
Pop()a violation of command-query separation? Should you remove it? - Important 8 — How do you make "a session expires after 30 minutes" testable without waiting?
- Important 9 — Why does the parking lot keep one stack of free spots per size plus a map of open tickets?
- Must-know 10 — What breaks if you run two instances of the parking service with the in-memory
Lot? - Important 11 — What does an anti-corruption layer contain and why is it needed?
- Must-know 12 — In an LLD interview, what do you do before drawing any class?
Testing Strategy & TDD: Test Pyramid vs Trophy, Test Doubles, Red-Green-Refactor, BDD, Contract Tests, Flaky Tests
Open the chapter · 13 questions
- Must-know 1 — What is the difference between a stub, a spy and a mock, and when do you choose each?
- Must-know 2 — Explain red-green-refactor and what people get wrong about TDD.
- Must-know 3 — Pyramid, trophy and honeycomb: how do they differ, and what is the catch?
- Must-know 4 — How do you deal with a flaky test?
- Must-know 5 — What does coverage tell you, and why is a coverage target dangerous?
- Important 6 — What is a consumer-driven contract test and why use one instead of an end-to-end test?
- Important 7 — How do you isolate database tests, and what are the traps of transaction-per-test?
- Important 8 — What is the London school versus Chicago school (mockist versus classicist) debate?
- Important 9 — What is mutation testing and how is it different from coverage?
- Important 10 — Laravel: when do you write a Feature test and when a Unit test, and Pest or PHPUnit?
- Important 11 — How do you make a slow suite fast without making it flaky?
- Good to know 12 — What are test data builders and factories good for?
- Good to know 13 — What is shift left and what does testing in production add?
SOLID: five principles for code that survives change
Open the chapter · 10 questions
- Good to know 1 — Who suggested the name SOLID, and roughly when?
- Good to know 2 — Which principle is missing from Martin's 2000 paper, and what is its closest relative there?
- Important 3 — Explain in three sentences how the five principles form one argument.
- Must-know 4 — Name Martin's four symptoms of design rot.
- Important 5 — Why do Go's implicit interfaces make ISP and DIP easier than in Java?
- Important 6 — A package has Ca = 0 and Ce = 4. What is its instability, and is that bad?
- Must-know 7 — What is the Dependency Rule of Clean Architecture, and which SOLID principle does it scale up?
- Good to know 8 — What does Dan North propose instead of SOLID, and what is his core advice?
- Important 9 — When is a
switchover types a better design than an interface? - Important 10 — What are the microservice-level forms of SRP and OCP?
Single Responsibility Principle (SRP)
Open the chapter · 10 questions
- Must-know 1 — A class has 25 methods, all changed only by the payroll team. Does it violate SRP?
- Important 2 — Two functions in different modules contain the same three lines. When should you merge them?
- Must-know 3 — What is the difference between SRP and "a function should do one thing"?
- Important 4 — Why does Cheney say
package utilsis a warning sign? - Good to know 5 — Which metric can reveal a hidden SRP violation that LCOM and CBO miss, and how do you get it?
- Must-know 6 — What does Go's
internal/directory enforce? - Important 7 — Name the Laravel class you would use for: validation, a permission rule, slow work after the response, reacting to
Ordercreation. - Important 8 — How does Conway's law relate to SRP?
- Important 9 — A feature always requires PRs to four microservices. What SRP failure is this?
- Must-know 10 — What are the two refactoring moves you use most to fix an SRP violation, and what is the reverse move for over-splitting?
Open–Closed Principle (OCP)
Open the chapter · 10 questions
- Good to know 1 — What did Meyer mean by "closed", and how did Martin's 1996 column change the mechanism?
- Important 2 — Why can no program be 100% closed, and what do you do about it?
- Must-know 3 — Where should the interface go in a payment service that will gain gateways?
- Must-know 4 — How does
database/sqlstay closed against new databases? - Good to know 5 — Name three Laravel extension points documented in Laravel 13.
- Important 6 — Is a feature flag an OCP extension point?
- Important 7 — You have one
PdfRendererInterfacewith one implementation and no tests using a double. What smell is this and what do you do? - Important 8 — Your interface-based design makes new shapes cheap. Why is adding
Perimeter()expensive? - Must-know 9 — Which API changes are extensions and which are modifications?
- Good to know 10 — How does Larman relate OCP, Protected Variations and information hiding?
Liskov Substitution Principle (LSP)
Open the chapter · 12 questions
- Must-know 1 — Why is
class Square extends Rectanglea subclass but not necessarily a subtype? - Important 2 — A subtype's method requires a non-empty string where the base accepted any string. Which rule does it break?
- Important 3 — Is it an LSP violation for a subtype to return a narrower type, e.g.
Userinstead of?Model? - Good to know 4 — What is the history constraint, and how can a subtype break it without breaking any invariant?
- Must-know 5 — Your Go function drops the last bytes of some streams. What part of the
io.Readercontract did it ignore? - Good to know 6 — Why does
sort.Slicewithxs[i] < xs[j]produce unsorted output for floats with NaN? - Important 7 — Your in-memory fake returns
nullfor a missing user; the real API adapter throws on 404. What do you do? - Important 8 — When is a type check on an interface (not a concrete class) acceptable?
- Good to know 9 — How do
finaland the Template Method pattern enforce a postcondition? - Important 10 — Why is adding a strict validation rule to an existing API endpoint an LSP issue?
- Important 11 — What does a consumer-driven contract test verify that a provider's own tests do not?
- Important 12 — Name two ways SQLite in tests fails to substitute for PostgreSQL.
Interface Segregation Principle (ISP)
Open the chapter · 11 questions
- Must-know 1 — In Martin's example, why is adding
TimeOuttoDoorharmful even for doors that never time out? - Important 2 — What is the difference between a role interface and a header interface?
- Must-know 3 — Why does the Go wiki say to define interfaces in the consuming package?
- Must-know 4 —
sort.Interfacehas three methods. Is it fat? - Important 5 — When is a type assertion to an interface acceptable rather than a smell?
- Good to know 6 — Which Laravel contracts split the user model's responsibilities by client?
- Good to know 7 — What is a marker interface, and give a Laravel example.
- Important 8 — You must add
Watchto a publishedStorageinterface. What do you do? - Important 9 — How is a Backend for Frontend an application of ISP?
- Important 10 — Why are fine-grained events (
EmailChanged) often better than oneUserChanged? - Important 11 — What does over-segregation look like and how do you fix it?
Dependency Inversion Principle (DIP)
Open the chapter · 12 questions
- Must-know 1 — What two things does DIP invert, and which one do people usually miss?
- Important 2 — Does inversion change the run-time call direction?
- Must-know 3 — Distinguish dependency inversion, dependency injection, inversion of control and a DI container.
- Important 4 — Why is calling
app(PaymentGateway::class)inside a domain service a problem? - Must-know 5 — Where should Go interfaces be declared, and why does that help DIP?
- Important 6 — What is a composition root and who should have one?
- Important 7 — When would you use Laravel's
scopedinstead ofsingleton? - Important 8 — What does contextual binding solve?
- Good to know 9 — Compute instability for a package with Ca=6 and Ce=2. Should it be abstract?
- Important 10 — How does DIP apply between microservices that share no interface types?
- Must-know 11 — When is adding an interface over-abstraction?
- Must-know 12 — Two Go packages import each other. What does the compiler say and how does DIP fix it?
Design Patterns: Origin, Why They Matter, the Three Families
Open the chapter · 11 questions
- Good to know 1 — What did Alexander contribute to software design, and in what form did Beck and Cunningham adopt it?
- Must-know 2 — How many GoF patterns are there in each family?
- Must-know 3 — Why is the class diagram not the whole pattern?
- Must-know 4 — Name three things a pattern is not.
- Important 5 — Is Repository a GoF pattern? Where does it come from?
- Important 6 — What is the difference between functional options and Builder?
- Good to know 7 — What did Norvig claim, and what did he not claim?
- Must-know 8 — Which Laravel feature is the Observer pattern, which is Chain of Responsibility, and which is Active Record?
- Good to know 9 — Why is Laravel's
Collection::macronot exactly Decorator? - Must-know 10 — A teammate adds an interface with a single implementation "for flexibility". What do you ask?
- Important 11 — What changes when an in-process Observer becomes a message on a broker?
Creational Patterns: Singleton, Simple Factory, Factory Method, Abstract Factory, Builder, Prototype
Open the chapter · 11 questions
- Important 1 — What two problems does the GoF Singleton solve at once, and which one causes the trouble?
- Must-know 2 — Why is
sync.Oncecorrect while a nil check is not? - Must-know 3 — Your Laravel app moves to Octane and users start seeing each other's tenant names. Which binding is wrong and what replaces it?
- Must-know 4 — What is the difference between a Simple Factory and the Factory Method pattern?
- Good to know 5 — Name the cheap change and the expensive change for an Abstract Factory.
- Important 6 — How does Go express Builder idiomatically, and when would you use a
Configstruct instead? - Important 7 — Why does
clonein PHP orc := *tin Go often break the Prototype pattern? - Important 8 — Is
app(Mailer::class)inside a domain service a problem? What about inside a service provider? - Good to know 9 — What happens if two Go packages call
sql.Registerwith the same name, and what if you forget to import a driver? - Must-know 10 — In a system with 30 pods, how many instances does a "singleton" HTTP client have, and how do you get exactly one active instance cluster-wide?
- Important 11 — When is lazy initialization the wrong choice?
Structural Patterns: Facade, Adapter, Composite, Proxy, Decorator, Bridge, Flyweight
Open the chapter · 12 questions
- Must-know 1 — What does GoF say distinguishes a Facade from an Adapter?
- Must-know 2 — Is
Cache::get('k')in Laravel an example of the GoF Facade pattern? What is it? - Important 3 — You wrap
http.ResponseWriterto record the status code and server-sent events stop streaming. Why, and what is the fix? - Important 4 — A retry decorator works for GET, but POST retries reach the server with an empty body. What went wrong?
- Important 5 — Where do logging decorators go relative to retry if you want one log line per user-visible call? And to see dependency flakiness?
- Good to know 6 — Name GoF's four kinds of proxy and one modern example of each.
- Must-know 7 — Three notification kinds and four channels: how many classes with subclassing, how many with Bridge?
- Important 8 — What is the difference between intrinsic and extrinsic state, and which one must be immutable?
- Good to know 9 — In Composite, what does GoF mean by "transparency vs safety"?
- Important 10 — Which two or three patterns make up an API gateway, an anti-corruption layer and a sidecar?
- Must-know 11 — Why is Eloquent's lazy loading dangerous in a loop, and what does Laravel offer against it?
- Important 12 — What does building a five-layer decorator chain on every call cost in Go, compared with building it once?
Behavioral Patterns: Template Method, Chain of Responsibility, State, Command, Observer, Strategy, Iterator, Mediator, Memento, Visitor
Open the chapter · 11 questions
- Must-know 1 — Your
Orderhasif ($order->status === 'paid')in 14 places. Which pattern, and what must the database also do? - Must-know 2 — What is the one-line difference between Strategy and State?
- Must-know 3 — A Laravel listener sends an email when an order is paid, but customers got emails for orders that were rolled back. Why, and what is the fix?
- Important 4 — Why is a Laravel queued Job an instance of the Command pattern?
- Important 5 — In a Go middleware chain built with
Chain(h, Logging, RequireToken), which runs first, and doesLoggingsee the 401? - Good to know 6 — You add a new invoice line type
GiftWrapLine. What happens in a Visitor design? - Important 7 — What must every Go push iterator do when
yieldreturnsfalse, and what must callers ofiter.Pullalways do? - Important 8 — Your checkout listeners are "listener B must run after listener A". What is wrong and what do you use instead?
- Good to know 9 — Command undo or Memento undo for "apply a filter to a 4K image"?
- Important 10 — What does Observer turn into once the subject and observers are separate services, and what three things must you add?
- Good to know 11 — Where is
ast.Inspecton the Visitor spectrum?
Applying Patterns in Real Systems: Selection, Combination & Anti-Patterns
Open the chapter · 11 questions
- Important 1 — What are the five steps of the selection method, and which comes before candidates?
- Good to know 2 — Name the four costs Fowler attributes to presumptive features.
- Important 3 — Which two patterns does
Illuminate\Support\Managercombine, and where do you add a driver? - Important 4 — How does Laravel's
Pipeline::then()build the chain? - Important 5 — Give two signs of an anemic strategy and the cure.
- Important 6 — Why is
Groupa Composite and why does it make the pricing engine data-driven? - Important 7 — What does Specification separate?
- Important 8 — Which patterns survive extraction unchanged, and which turn into network contracts?
- Important 9 — Why does the clock live in
Cart.Now? - Must-know 10 — What is in an ADR, and how long should it be?
- Important 11 — What does a contract test between
LocalandRemoteadapters protect?
Designing for Concurrency
Open the chapter · 12 questions
- Must-know 1 — A dashboard makes three independent 300 ms queries. What is the latency with sequential code, and with fan-out/fan-in?
- Must-know 2 — Your Go handler uses a mutex around every map access. Can it still have a race condition?
- Must-know 3 — Name the four Coffman conditions and the one that lock ordering breaks.
- Important 4 — Two workers retry a lock every 100 ms and never succeed. What is this, and what fixes it?
- Important 5 — Why is a 100,000-slot buffered channel usually a design smell?
- Important 6 — What is the difference between
ShouldBeUniqueandWithoutOverlappingin Laravel? - Important 7 — Why can a job run twice even with
WithoutOverlapping? - Good to know 8 — When is a Redis lock acceptable, and when do you need a fencing token?
- Must-know 9 — A queue receives 50 jobs/s and each takes 0.4 s. How many workers do you need at minimum?
- Important 10 — Why is a singleton that receives the
Requestin its constructor a bug under Octane but not under PHP-FPM? - Must-know 11 — What does
errgroup.WithContextdo on the first error? - Important 12 — What can the race detector not tell you?
Control Flow & Event Handling in Design
Open the chapter · 12 questions
- Must-know 1 — What question decides the control style of a feature?
- Must-know 2 — Why is "event-driven" not the same as "asynchronous"?
- Important 3 — What is the Hollywood principle and where does it show in Go and Laravel?
- Good to know 4 — Name Fowler's four meanings of event-driven and say which one does not need events.
- Important 5 — Why does a queued listener sometimes throw "model not found", and how do you fix it in Laravel 13?
- Important 6 — After-commit dispatch is on. Can an event still be lost? How do you stop that?
- Must-know 7 — How do you make a handler safe against duplicates and reordering?
- Must-know 8 — Why does
Event::fake()not test a listener, and what does? - Important 9 — In Go, why does the bus copy the subscriber list before calling handlers?
- Good to know 10 — What does
context.WithoutCancelgive the async listener, and why does the bus also usecontext.AfterFunc? - Important 11 — Why is a node event loop bad at CPU-heavy handlers while Go is not?
- Must-know 12 — What is the difference between a domain event and an integration event?
Data Persistence in Design: Repositories, Mapping & Boundaries
Open the chapter · 11 questions
- Must-know 1 — A colleague says "Eloquent already is a repository, so we should not add one." When is that right, and when is it wrong?
- Important 2 — Name the five mismatches between objects and tables and one tool feature for each.
- Important 3 — Why should the repository interface live in the domain package instead of next to the ORM?
- Must-know 4 — Two users edit the same order. Using
UPDATE ... WHERE version = ?, describe what each user sees. - Must-know 5 — Where should the transaction start for "place order", and why not in the repository?
- Must-know 6 — A list endpoint takes 2 seconds and runs 401 queries. What is the design fix, beyond adding
with()? - Must-know 7 — What belongs inside an aggregate and what is referenced by id?
- Important 8 — Why is an in-memory SQLite database a poor stand-in for PostgreSQL in repository tests?
- Must-know 9 — Service A needs data owned by service B. List two acceptable ways and one forbidden way.
- Important 10 — What does
Model::preventLazyLoading(! $this->app->isProduction())do, and why is the condition there? - Important 11 — Why must aggregates be loaded from the primary and not a replica?
Distribution of Components: Local vs Remote, Latency & Failure as Design Inputs
Open the chapter · 11 questions
- Important 1 — Name the six ways a remote call differs from a local call and give one design consequence of each.
- Important 2 — Why does Fowler say "you can't encapsulate the remote/in-process distinction", and what does that imply for the interface?
- Good to know 3 — Does microservices architecture violate the First Law of Distributed Object Design?
- Must-know 4 — List the eight fallacies and give the design consequence of fallacies 1, 2 and 6.
- Must-know 5 — A client calls a service with a 300 ms timeout and retries three times; the service it calls does the same to a third service. How many requests can the third service receive for one user request, and how do you stop it?
- Important 6 — Which of these should be distributed: (a) code that formats an address, (b) an image-resizing function that needs 8 vCPUs in bursts, (c) a capability owned by another team with its own releases?
- Important 7 — A user request fans out to 50 services in parallel, each with a 99th percentile of 1 s and a typical time of 10 ms. Roughly what fraction of user requests will see a slow response?
- Must-know 8 — You must remove a field from a Protobuf message. What do you do, and what must you never do?
- Must-know 9 — Why is retrying
quote()safe in this chapter, and what would you add before retrying acharge()call? - Important 10 — What does a consumer-driven contract test catch that an end-to-end test usually does not?
- Good to know 11 — In the lab, chatty vs coarse differ by 32x on localhost and 40x with 50 ms injected. Why is the ratio larger with latency?
Error & Exception Handling and Fault Tolerance in Design
Open the chapter · 11 questions
- Must-know 1 — A Laravel action catches
Throwable, logs it and returnsnull. Name two concrete problems. - Important 2 — Your repository returns
fmt.Errorf("find: %w", err)whereerris frompgx. What did you just promise callers? - Must-know 3 — A payment call timed out. Is it safe to retry?
- Must-know 4 — Three layers each retry 3 times (4 attempts). How many attempts can one user action cause at the bottom?
- Important 5 — Which errors should trip a circuit breaker for a payment API?
- Must-know 6 — What is the difference between fail-fast and fail-safe? Give one example of each.
- Important 7 — Why does a PHP circuit breaker keep its state in Redis instead of a static property?
- Important 8 — Your Go HTTP handler starts
go sendEmail()which panics. Does theRecoverermiddleware save the server? - Important 9 — What goes into an RFC 9457 response for a database outage, and what must not?
- Important 10 — A queued job calls an unstable API. Which Laravel features give it a time budget, spaced retries, a queue-side breaker and a dead letter?
- Must-know 11 — Why should an external HTTP call not run inside
DB::transaction?
Interaction & Presentation: MVC, MVP, MVVM and Data Flow
Open the chapter · 11 questions
- Must-know 1 — Your template calls
Order::where('status','new')->count()for a badge. What is wrong, and what is the fix? - Good to know 2 — What is the difference between MVC in Smalltalk and MVC in Laravel?
- Good to know 3 — When would you choose Passive View over Supervising Controller?
- Must-know 4 — Why is
json.Marshal(domainOrder)a risky API response? - Must-know 5 — A form submission fails validation. Which status code and which UI behaviour do you use for HTML and for JSON?
- Must-know 6 — Why redirect after a successful POST?
- Important 7 — What does unidirectional data flow give you that two-way binding does not?
- Important 8 — How do Livewire, HTMX and Inertia differ in where state lives?
- Important 9 — Where do controllers, presenters and views sit in Clean Architecture, and which way do dependencies point?
- Important 10 — A mobile app and a web UI need different shapes of the same data. What pattern helps, and what does it cost?
- Must-know 11 — Which tests would you write first for a new screen?
Security by Design
Open the chapter · 11 questions
- Must-know 1 — A route sits behind
authmiddleware and returnsOrder::findOrFail($id). What is wrong and how do you fix it? - Must-know 2 — State Saltzer and Schroeder's "fail-safe defaults" and give a web example of violating it.
- Important 3 — What are the four questions of threat modeling and which STRIDE letters does "someone replays a payment webhook" touch?
- Important 4 — Why does the Go
validatepackage useDisallowUnknownFieldsand no price field in the request type? - Must-know 5 — Name three JWT validation mistakes from RFC 8725 thinking.
- Important 6 — Why should the login limiter key on account plus IP rather than IP alone?
- Important 7 — What does refresh-token rotation with reuse detection buy you?
- Must-know 8 — How do three layers protect against one forgotten
where tenant_id? - Must-know 9 — In microservices, why is a gateway-only authorization design weak?
- Important 10 — What does
govulncheckdo that a plain version scanner does not? - Important 11 — Give two GDPR Article 25 design obligations as code decisions.
Architecture
What Software Architecture Is, Why It Exists, What an Architect Does
Open the chapter · 12 questions
- Good to know 1 — State the Bass, Clements and Kazman definition and one thing it leaves out compared with ISO 42010.
- Good to know 2 — What did Ralph Johnson object to in "architecture is the fundamental organisation"?
- Must-know 3 — Give the four needs that make architecture exist.
- Must-know 4 — Is choosing Kubernetes an architectural decision?
- Important 5 — State the first law and one corollary.
- Important 6 — Name Fowler's two kinds of architect and the rule of thumb about value.
- Important 7 — Why is Richards and Ford's "ensure compliance" best automated?
- Important 8 — Define the last responsible moment and the architectural runway.
- Good to know 9 — What does ATAM produce and when do you run it?
- Must-know 10 — In the Go module, why does
ordersdeclareBilleritself? - Important 11 — Name two ways the Laravel example enforces the module boundary.
- Must-know 12 — Why is a big-bang rewrite an architectural failure mode?
Kruchten's 4+1 View Model: Logical, Process, Development, Physical & Scenarios
Open the chapter · 12 questions
- Important 1 — Name the four views and the "+1", and for each give one stakeholder and one concern from Kruchten's table.
- Good to know 2 — Why does Kruchten call the scenarios view "redundant", and why keep it anyway?
- Important 3 — Your system is a single Laravel app on one server with no queue. Which views do you write?
- Important 4 — A teammate says "the development view is just the logical view with folder names". What is the counter-argument?
- Good to know 5 — What are inside-out and outside-in in the mapping from logical to process view?
- Important 6 — In ISO 42010 terms, what is the difference between a viewpoint and a view?
- Good to know 7 — Which V&B family does each 4+1 view mostly fall into?
- Must-know 8 — What is a C4 container, and which 4+1 view does a C4 container diagram mostly serve?
- Important 9 — Name three techniques that keep the development view from going stale.
- Important 10 — Moving from a modular monolith to microservices, which views change most and which should barely change?
- Important 11 — Where do quality attributes such as security go if not in a separate view?
- Good to know 12 — What did Kruchten's Software Architecture Document contain besides the four views and scenarios?
Architecture Decisions: Trade-offs, ADRs, Second-Order Effects, 'No Perfect Architecture'
Open the chapter · 12 questions
- Must-know 1 — Name the three markers of an architecture decision and give an example of each.
- Good to know 2 — What did Bezos say goes wrong when organisations use Type 1 process for Type 2 decisions?
- Important 3 — Give two techniques that turn a one-way door into a two-way door.
- Important 4 — Why must drivers be weighted before options are listed?
- Good to know 5 — Trace microservices to its third-order effect.
- Important 6 — Define the last responsible moment and the risk on each side of it.
- Important 7 — List Nygard's five ADR sections and two of his rules.
- Good to know 8 — What does MADR's "Confirmation" section add, and why does it matter?
- Must-know 9 — When do you use an RFC rather than only an ADR?
- Good to know 10 — Which quadrant of Fowler's technical debt model is a legitimate architecture decision, and what must its ADR contain?
- Good to know 11 — In the lab, why does
paymentsandnotificationssharingpg-shared.internalpassTestNoSharedDatabase? - Must-know 12 — Go vs PHP: why can the same team rationally choose both?
From Requirements to Architecture
Open the chapter · 10 questions
- Important 1 — What are the inputs to ADD, and which of them may be only implied?
- Good to know 2 — How many architectural drivers does ADD ask you to select, and what does it say if more are (H,H)?
- Good to know 3 — What are the eight QAW steps in order and how many votes does each stakeholder get?
- Must-know 4 — What is the difference between a walking skeleton and a prototype?
- Important 5 — In ADD step 4, what do you do if no pattern satisfies all drivers?
- Important 6 — Why can a capacity estimate remove a style from the shortlist?
- Important 7 — Name three fitness functions you would add for Going Green.
- Good to know 8 — Which Going Green ADR makes "why was this price offered?" answerable, and how?
- Important 9 — Why does the walkthrough of "inspector changes the quote" find a missing responsibility?
- Important 10 — When would you extract Disposition into a service?
Back-of-the-Envelope Capacity Estimation: Traffic, Storage, Bandwidth
Open the chapter · 11 questions
- Must-know 1 — A product has 5 M DAU and each user makes 30 requests per day. What are the average and the peak QPS with a peak factor of 4?
- Must-know 2 — Why is a 1 Gbit/s NIC not enough for 5,000 QPS at 50 KB per response?
- Good to know 3 — A row has 60 bytes of payload and two indexes. Roughly how large is it in PostgreSQL?
- Must-know 4 — State Little's law and use it to size a thread pool for 800 requests per second with a mean time of 25 ms.
- Must-know 5 — Producers write 100 messages per second, consumers handle 150. A backlog of 6,000 exists. When is it empty?
- Important 6 — Why plan for 70 percent utilization instead of 95?
- Good to know 7 — Which of the five worked examples needs a CDN and why?
- Must-know 8 — What is wrong with sizing capacity by QPS alone?
- Important 9 — A page makes 30 backend calls, each with p99 = 100 ms. How often is the page slow?
- Important 10 — Why does the load test use an open model?
- Important 11 — At what numbers would you stop at a monolith with one PostgreSQL, and what would make you shard?
SLAs, SLOs, SLIs & Error Budgets
Open the chapter · 12 questions
- Must-know 1 — What single question separates an SLO from an SLA?
- Must-know 2 — A service has a 99.95% SLO over 30 days. How many minutes of full outage does the budget allow?
- Important 3 — The error ratio is 0.6% and the SLO is 99.9%. What is the burn rate and how long until a fresh 30-day budget is gone?
- Must-know 4 — Why is a single "error rate over the SLO ratio for 10 minutes" alert a poor design?
- Important 5 — What do the long and short windows each contribute in a multiwindow alert?
- Must-know 6 — Three services at 99.9% each, in series. What is the availability, and what two tactics help?
- Important 7 — Why do you put a histogram bucket boundary at the SLO threshold?
- Important 8 — Name two reasons to measure the availability SLI at the load balancer rather than only in the application.
- Must-know 9 — Your payment provider's SLA says 99.9%. Can you promise 99.9% for checkout?
- Important 10 — What makes an error budget policy effective?
- Important 11 — Why is Laravel Pulse not an SLI source?
- Must-know 12 — A 99.99% SLO is requested for an internal admin tool. What do you ask first?
Architecture Styles vs Architecture Patterns
Open the chapter · 11 questions
- Good to know 1 — State the three definitions (style, pattern, tactic) and say who defined each.
- Important 2 — How do style, pattern and tactic nest? Give one example of each for a checkout.
- Must-know 3 — What is the difference between technical and domain partitioning, and why does it matter for a change?
- Must-know 4 — Why is "microservices on one shared database" not microservices?
- Important 5 — Name three costs of the distributed premium and the tactic for each.
- Important 6 — Which style has the best balance of deployability and cost among the distributed ones, and why?
- Good to know 7 — How does Richards' 2015 report differ in vocabulary from the 2020 book?
- Good to know 8 — What did Fielding's derivation of REST show about styles?
- Important 9 — When would you pick space-based over event-driven?
- Good to know 10 — What do Segment and Shopify illustrate?
- Important 11 — Why is a style only half-enforced by a language?
Layered Monolithic Architecture
Open the chapter · 11 questions
- Must-know 1 — Name the four layers and one thing that must never appear in each.
- Important 2 — What is the difference between a closed and an open layer, and what does "layers of isolation" buy you?
- Must-know 3 — Your controller calls a service that calls a repository that calls
Order::find($id), and 80% of your endpoints look like this. What is it called, and what do you do? - Must-know 4 — In one sentence, what does hexagonal architecture change compared with classic layering?
- Important 5 — When is a transaction script the right choice, and what is an anemic domain model?
- Important 6 — Where does the database transaction belong, and why not in the controller or repository?
- Must-know 7 — Why can't a three-layer Laravel app be called "three-tier"?
- Good to know 8 — Which Go features give you layer checks for free, and which check needs a test?
- Must-know 9 — Your
GET /orders/42page shows lines with product names and takes 50 queries. Which layer fixes it and how? - Important 10 — Give three signs that your layered monolith should become a modular monolith.
- Important 11 — What must be true of the layers for a blue/green or rolling deploy to work?
Modular Monolith
Open the chapter · 12 questions
- Must-know 1 — What exactly makes a system a monolith, and what does that say about its quality?
- Must-know 2 — Name the three conditions a module must meet.
- Important 3 — Orders needs product prices during checkout. Call or event? How should the dependency be declared in Go and in Laravel?
- Must-know 4 — Why is
Order::belongsTo(Product::class)across modules a problem even though it works? - Important 5 — When is one database transaction across two modules acceptable?
- Must-know 6 — What does
ShouldDispatchAfterCommitprotect you from? - Important 7 — Which gate catches each violation in the Go example: (a) Billing imports
orders/internal/store; (b) Orders importsbilling; (c)shop/internal/eventbusimportsorders? - Important 8 — How do you keep cross-module reports without cross-module joins in module code?
- Good to know 9 — List five things to keep ready so that Billing can be extracted later.
- Good to know 10 — What did Google's 2023 paper claim, and what happened to Service Weaver?
- Important 11 — Your modular monolith has one module that leaks memory and crashes the process weekly. What do you try before extraction?
- Important 12 — Why can't Packwerk catch every boundary violation?
Microkernel / Plugin Architecture
Open the chapter · 12 questions
- Must-know 1 — What are the two kinds of components in a microkernel architecture, and which one may depend on the other?
- Good to know 2 — Name four discovery methods and one product for each.
- Important 3 — When would you choose a Laravel
Managerwithextendover tagged bindings? - Must-know 4 — What is the difference between a WordPress action and a filter?
- Important 5 — Why do many Go projects avoid the standard
pluginpackage? - Important 6 — What does go-plugin give you that blank imports do not?
- Must-know 7 — Which isolation level would you use for code written by your tenants, and why?
- Important 8 — List the lifecycle states and say which failure must not stop the others.
- Important 9 — What two versions matter for a plugin, and what do they protect?
- Important 10 — Name three anti-patterns and the fix for each.
- Good to know 11 — Why is the extension point of our engine "typed set" and not a hook?
- Good to know 12 — How does a microkernel look at service scale?
Client-Server Architecture and Its Variants
Open the chapter · 12 questions
- Important 1 — What two constraints does Fielding's client-server style add, and what does the separation buy?
- Must-know 2 — A three-layer Laravel app on one server: how many tiers is it, and why?
- Must-know 3 — A user is logged out after every deploy. Name two likely causes and the fixes.
- Must-know 4 — Why is
PUTsafe to retry butPOSTnot, and how do you makePOSTretryable? - Must-know 5 — How does a conditional GET reduce load, and what are the two headers?
- Must-know 6 — When would you pick SSE over WebSocket?
- Important 7 — What is the SSE gotcha over HTTP/1.1 in browsers, and how do you avoid it?
- Important 8 — Why must a Go server that serves SSE not set
WriteTimeout? - Must-know 9 — CORS is configured correctly yet an attacker's site can still make your user's browser change data. Why?
- Must-know 10 — Your service calls three others and each retries 3 times. What is the worst-case amplification, and what do you do?
- Important 11 — Inertia or a Sanctum API: how do you choose?
- Good to know 12 — Two phones edit the same order offline. Describe a safe sync protocol.
Pipe-and-Filter Architecture
Open the chapter · 12 questions
- Must-know 1 — What two invariants make a set of components a pipe-and-filter system?
- Important 2 — Name the four filter types and say which one never changes an item.
- Important 3 — Why does
a | bnot runato completion first? - Must-know 4 — A producer is ten times faster than the slowest stage. What happens with an unbounded pipe, and with a pipe of capacity 100?
- Important 5 — After a four-worker
Mapstage the output order differs from the input order. Give two fixes. - Must-know 6 — Which errors do you retry and which do you dead-letter?
- Must-know 7 — Why must every channel send in a Go pipeline be a
selectwithctx.Done()? - Important 8 — Why does
LazyCollectionkeep memory flat on a 1 GB file, and what breaks it? - Good to know 9 — How is Laravel middleware related to the
Pipelinehelper? - Must-know 10 — What is the difference between
Bus::chainandBus::batch? - Must-know 11 — When is pipe-and-filter a poor choice?
- Important 12 — What replaces the bounded channel when the pipe becomes a Kafka topic, and how do you scale a filter?
Service-Oriented Architecture (SOA)
Open the chapter · 10 questions
- Good to know 1 — What does the OASIS reference model say SOA is, and what does it say it does not cover?
- Good to know 2 — Name the four service types of orchestration-driven SOA and one example each.
- Must-know 3 — What is the difference between an ESB and a message broker?
- Good to know 4 — Why does a SOAP 1.1 client have to parse the body before checking the HTTP status?
- Important 5 — How many translators do 6 applications need with and without a canonical data model?
- Good to know 6 — Give three reasons the WS-* stack was heavy.
- Must-know 7 — What is "smart endpoints and dumb pipes"?
- Important 8 — When is service-based architecture a better choice than microservices?
- Important 9 — Why should a legacy SOAP provider sit behind an anti-corruption layer?
- Important 10 — In the transfer example, what does the orchestrator do when credit fails after debit succeeded?
Microservices Architecture
Open the chapter · 11 questions
- Must-know 1 — Give Lewis and Fowler's definition in one sentence and name the property it rests on.
- Must-know 2 — Ten services share one PostgreSQL schema and are released every second Tuesday together. Are they microservices?
- Good to know 3 — Name three granularity disintegrators and three integrators.
- Important 4 — What are Fowler's microservice prerequisites?
- Must-know 5 — Why should Orders' readiness probe not check Catalog?
- Important 6 — In the lab, why did the fourth request fail in 0.5 ms?
- Important 7 — How does the trace survive the asynchronous hop to Notifications?
- Must-know 8 — What is a consumer-driven contract, and where does it run?
- Must-know 9 — Billing renames
amount_centstoamount. How do you ship it without a lock-step release? - Good to know 10 — What do the Prime Video post and Google's HotOS paper have in common?
- Must-know 11 — Why does
PaymentProvider::captureonly retry onConnectionExceptionand always send the sameIdempotency-Key?
Big Data Architectures: 3Vs, Batch vs Stream, Lambda & Kappa
Open the chapter · 12 questions
- Good to know 1 — What did Laney's 2001 note name, and which Vs came later?
- Must-know 2 — Why is a nightly report on the production OLTP database risky?
- Important 3 — Define event time, processing time and watermark.
- Important 4 — An event arrives after its window closed. What are the options?
- Good to know 5 — Why does a Lambda architecture hurt maintenance, per Kreps?
- Important 6 — Describe Kappa reprocessing in four steps.
- Good to know 7 — When does Kappa fail?
- Important 8 — How do you get an exactly-once result with an at-least-once consumer?
- Important 9 — Why prefer log-based CDC to polling
updated_at? - Good to know 10 — What are the four data mesh principles?
- Must-know 11 — A team of six runs one PostgreSQL and wants Flink, Kafka, a lake and ClickHouse. What do you ask first?
- Important 12 — What does
lazyById(2000)give you in a Laravel ETL command?
Monolith vs Microservices vs Modular Monolith: Deciding
Open the chapter · 12 questions
- Must-know 1 — A CTO asks for microservices "to go faster". What do you ask first, and which metric do you propose?
- Important 2 — Name four items of the microservice premium Fowler lists.
- Important 3 — What is Fowler's main reason against starting with microservices, and Tilkov's main reason against starting with a monolith?
- Good to know 4 — What does Google's HotOS 2023 paper say microservices conflate, and what follows for the decision?
- Good to know 5 — List the four granularity integrators from The Hard Parts.
- Must-know 6 — Which four signals justify extracting one service?
- Must-know 7 — Three services always deploy together and call each other on every request. What are they and what do you do?
- Important 8 — In the Go example, which file changes when inventory moves out of process, and why does ordering not change?
- Must-know 9 — Why must the remote client send an
Idempotency-Key, and why rebuild the request body per attempt? - Important 10 — Laravel: you set
retry(3, 100, throw: false). Can an exception still escape? - Good to know 11 — What did Prime Video's 2023 post actually say?
- Important 12 — Your scorecard gives microservices 80 and the modular monolith 77. What do you decide?
Service Boundaries: Teams, Conway's Law, the Distributed Monolith and the Hidden Tax
Open the chapter · 12 questions
- Must-know 1 — Name the four faces of a service boundary and one leak for each.
- Must-know 2 — State Conway's law in his words and say what it is really about.
- Important 3 — Why is the inverse Conway manoeuvre not an instant fix for an existing system?
- Important 4 — Which Team Topologies team type exists to reduce cognitive load of stream-aligned teams through a self-service internal product, and which interaction mode does it use?
- Must-know 5 — Three services at 99.9% availability are called in a synchronous chain. What is the best-case availability of the request, and which coupling type causes it?
- Must-know 6 — Why is "events instead of calls" not enough to remove coupling?
- Important 7 — Give four symptoms of a distributed monolith and one metric for each.
- Good to know 8 — Name the four granularity integrators from Hard Parts.
- Important 9 — Orders publishes an event that Billing and Shipping consume. Billing translates it to its own model; Shipping stores it as-is. Name the context-map patterns.
- Good to know 10 — When would you choose tactical forking over component-based decomposition?
- Important 11 — Your change-coupling report shows
cartandcheckout, owned by two teams, co-changing in 72% of 41 shared commits. What do you do? - Important 12 — What does the Go contract test on this page protect against, and in whose CI does it run?
Service Communication: Sync vs Async, Contracts, Retries, Idempotency
Open the chapter · 12 questions
- Must-know 1 — Name the five communication styles and give one example of each.
- Must-know 2 — A service calls three dependencies sequentially, each 99.9% available. What is the best-case availability of that request, and what are two ways to improve it?
- Must-know 3 — Your POST to billing timed out after 2 s. Can you retry it? What must be true first?
- Must-know 4 — Frontend, backend and data service each retry 3 times on error. The database is overloaded. How many attempts can one user action produce, and what do you change?
- Important 5 — The edge has a 1000 ms budget, spends 50 ms, and each hop uses a 10 ms margin. Orders spends 200 ms before calling billing. What timeout does billing receive?
- Important 6 — What does an idempotency layer return for (a) a duplicate while the first is still running, (b) a duplicate after completion, (c) the same key with a different body?
- Must-know 7 — Does Laravel's
ShouldBeUniquemake the job handler idempotent? Explain. - Important 8 — When would you pick orchestration over choreography?
- Important 9 — Billing wants to rename
statustostatein its JSON response. How do you do it without breaking orders? - Good to know 10 — Why does gRPC send a remaining timeout rather than an absolute deadline on the wire?
- Good to know 11 — In the lab at 50% random failures, the budgeted client succeeded 65 times and the naive one 100 times. Is the budget wrong?
- Must-know 12 — Which header carries the trace across services, and what must a component that does not trace still do with it?
API Gateway, Backend-for-Frontend & Service Mesh
Open the chapter · 12 questions
- Must-know 1 — Name five responsibilities that belong in the API gateway and two that do not.
- Must-know 2 — What is the difference between a gateway and a BFF in terms of ownership?
- Important 3 — Your mobile BFF calls 10 services in parallel, each slow 1% of the time. How often is the BFF slow, and what do you do?
- Important 4 — When would you choose a CQRS read model over API composition?
- Must-know 5 — What are the data plane and the control plane of a mesh, and does the control plane carry requests?
- Good to know 6 — In Istio ambient mode, which component gives you L7 retries and header-based routing?
- Important 7 — A service receives
X-User-Id: 1from an attacker pod inside the cluster. Which three controls stop this? - Must-know 8 — Gateway, BFF and mesh each retry three times. What happens when Orders slows down, and how do you fix it?
- Important 9 — Why does a mesh not give complete traces automatically?
- Important 10 — Kubernetes Ingress or Gateway API for a new cluster, and why?
- Must-know 11 — When do you not need a service mesh?
- Good to know 12 — In the Laravel BFF, why is each pooled request configured separately, and what does a failed connection look like?
Service Discovery: Client-Side vs Server-Side, DNS, Health Checks
Open the chapter · 12 questions
- Must-know 1 — Why can a hard-coded address not survive autoscaling and rolling deploys?
- Important 2 — What is the difference between self-registration and third-party registration, and when would you pick each?
- Important 3 — A pod is killed with
kill -9. Which mechanism removes it from the registry, and how long does it take? - Important 4 — Compare client-side and server-side discovery on hops, client complexity and trust.
- Must-know 5 — Why does a short DNS TTL not give instant failover?
- Must-know 6 — What do startup, liveness and readiness probes each do on failure?
- Must-know 7 — Why must a liveness probe not check the database?
- Must-know 8 — What are the steps of a graceful shutdown that avoids errors during a deploy?
- Important 9 — Why can eventual consistency be acceptable for a service registry?
- Good to know 10 — What does Eureka's self-preservation mode do and what must clients do about it?
- Important 11 — Why does a gRPC client on a ClusterIP Service often hit only one pod?
- Good to know 12 — What is spoofed registration and how do you stop it?
Data Ownership in Microservices: Database per Service, Shared Database, Brownfield Options
Open the chapter · 12 questions
- Must-know 1 — What two properties make a service the owner of a piece of data?
- Important 2 — Name Richardson's three ways to keep a service's data private and which are cheapest.
- Important 3 — Give two situations in which a shared database is tolerable.
- Good to know 4 — Two services write
customer.status. List the four techniques in order of decoupling. - Must-know 5 — When does API composition stop being enough?
- Must-know 6 — Why not 2PC between microservices?
- Important 7 — A user renames a product and the list still shows the old name. Give two fixes.
- Good to know 8 — In what order would you apply view, split table, FK to code and tracer write, and why?
- Important 9 — What must be true before you stop writing the old store in a tracer write?
- Important 10 — Why is CDC on a raw table a schema-change trap?
- Important 11 — Which single metric best warns that read models are going stale even when no messages flow?
- Important 12 — How does data ownership help with a right-to-erasure request?
System Design
What System Design Is and How It Evolved
Open the chapter · 12 questions
- Must-know 1 — What is the difference between a functional and a non-functional requirement? Give a URL shortener example of each.
- Good to know 2 — How much downtime per year does 99.99% allow, and who published that figure?
- Must-know 3 — Three services in series each have 99.9% availability. What does the user get, and why?
- Important 4 — Why is "two replicas at 99.9% each give 99.9999%" an upper bound?
- Must-know 5 — Explain CAP in one sentence without saying "pick two".
- Important 6 — Why does the shortener use 302 and not 301?
- Important 7 — What is Little's law and what does it say about 19,300 requests/s at 20 ms?
- Important 8 — Name two forces that pushed the industry from three-tier monoliths to microservices.
- Must-know 9 — Is a replica a backup? Why?
- Must-know 10 — What is the difference between an SLO and an SLA?
- Must-know 11 — Why must an application tier be stateless to scale horizontally, and what moves out?
- Important 12 — In an interview and in real life, what is the same and what differs?
The 4-Step Approach: Scope, Estimate, High-Level Design, Decisions
Open the chapter · 12 questions
- Must-know 1 — Name the four steps and the artifact each produces.
- Must-know 2 — Rewrite "the system should be fast and highly available" as two testable requirements.
- Important 3 — What is the difference between a non-goal and a negated goal?
- Must-know 4 — 50 M DAU, each doing 4 writes a day, peak factor 3. What is the peak write QPS?
- Important 5 — Why does the 80/20 formula overstate the news-feed cache, and what is the better estimate?
- Must-know 6 — A tier needs 3,819 QPS at peak, one server handles 500 QPS, and you plan 60% utilisation with N+2. How many servers?
- Must-know 7 — In the news feed, which number changes the design most, and what does it change?
- Important 8 — How does the ride-matching skeleton prevent two riders from getting the same driver without a distributed lock?
- Important 9 — Why does the rate limiter fail open, and what must exist for that to be safe?
- Important 10 — What makes a decision "architecturally significant" in Nygard's ADR proposal, and what happens when it is reversed?
- Must-know 11 — Give two signs that sharding is premature, and what to do instead.
- Must-know 12 — In a 45-minute interview, the interviewer says "assume it all fits on one machine" during your estimate. What do you do?
Latency Budgets, Geography & Tail Latency (p99)
Open the chapter · 12 questions
- Must-know 1 — A service has a mean latency of 30 ms and you are told 1% of requests take 2 s. Roughly what are the other 99% doing, and why does the mean mislead?
- Must-know 2 — A page waits for 50 backends in parallel, each slow 1% of the time. What fraction of pages are slow, and what leaf percentile must be fast for the page p99 to be fast?
- Good to know 3 — What is the RTT floor between Frankfurt and Virginia, and why do measured RTTs exceed it?
- Important 4 — A new HTTPS connection over TCP and TLS 1.3 to a server 90 ms away: how long until the response, if the server takes 50 ms? And with a reused connection?
- Important 5 — Why does hedging at the p95 delay add only about 5% load, and why must it be restricted to idempotent requests?
- Good to know 6 — How do tied requests differ from hedging with zero delay?
- Important 7 — A tier runs at 90% utilisation with a 10 ms service time. Estimate mean and p99 response time with M/M/1, and the effect of dropping to 70%.
- Must-know 8 — Your load test at 100 req/s shows p99 = 1 ms, but the server had a 2 s stall. Why, and how do you measure correctly?
- Must-know 9 — Why is
avg(http_request_duration_seconds{quantile="0.99"})wrong, and what is right? - Important 10 — An EU user travels to the US. With read-local/write-global and an EU home region, what are the latencies for reads and writes, and what consistency issue appears?
- Good to know 11 — Why can putting a slow server on probation improve latency during high load?
- Good to know 12 — Which Laravel Pulse feature would you use for percentiles, and what does Pulse provide instead?
The Client-Server Model
Open the chapter · 10 questions
- Must-know 1 — Why can one program be both a client and a server?
- Important 2 — A PHP-FPM pool has
pm.max_children = 50and the mean request takes 100 ms. What is the throughput ceiling, and what happens at 800 requests per second? - Important 3 — Why does a Go client talking to one host from 20 goroutines reconnect constantly with default settings?
- Must-know 4 — What is the difference between
Cache-Control: no-cacheandno-store, and which pairs with ETag for always-fresh data? - Must-know 5 — A POST timed out. When may the client retry it?
- Must-know 6 — Why does a stateful WebSocket tier make deploys harder than a stateless HTTP tier?
- Important 7 — Name two things that go wrong when a Laravel app moves from FPM to Octane unchanged.
- Important 8 — What does
epollimprove overpoll? - Important 9 — Which parts of a WebRTC call still need a server?
- Must-know 10 — What is the difference between a tier and a layer?
IP, DNS, GeoDNS, TTL & DNS as a Routing Weapon
Open the chapter · 11 questions
- Important 1 — Your Route 53 failover record has TTL 60 and fast health checks with threshold 3. A PHP-FPM app calls it with Laravel's HTTP client using defaults. What is a realistic worst-case time before new requests reach the secondary?
- Must-know 2 — Why can't
example.combe a CNAME, and what are your three options? - Must-know 3 — A teammate created
beta.example.comat 10:01; a smoke test that ran at 10:00 still fails at 10:10 with "Could not resolve host". Why, and how long until it works? - Important 4 — EU users on 1.1.1.1 are routed to the US by your geolocation policy. What is going on?
- Good to know 5 — What does Route 53 return for a multivalue name when all eight records are unhealthy, and why is that sensible?
- Must-know 6 — When is DNS failover the wrong tool, and what replaces it?
- Important 7 — Explain how anycast fails over without changing DNS, and its main drawback for TCP.
- Must-know 8 — Describe a subdomain takeover and the one operational rule that prevents most of them.
- Important 9 — Your weighted canary sends green weight 10 against blue 245, yet green's request share swings between 1% and 15%. Why?
- Important 10 — Which of DNSSEC, DoT and DoH would stop (a) a café Wi-Fi rewriting DNS answers for a laptop and (b) a poisoned answer in an ISP resolver's cache?
- Must-know 11 — A bank allowlists 203.0.113.7. You add a second AZ with its own NAT gateway. What breaks and how do you avoid it?
Forward vs Reverse Proxies
Open the chapter · 10 questions
- Must-know 1 — What is the difference between a forward proxy and a reverse proxy, and who configures each?
- Important 2 — Why can a forward proxy not read an HTTPS URL path when the client uses CONNECT?
- Must-know 3 — When is an L4 proxy the right choice over an L7 proxy?
- Important 4 — An application behind NGINX logs the load balancer's address for every request. List the causes and the fix.
- Must-know 5 — Why is trusting
*intrustProxiesdangerous, and when is it acceptable? - Important 6 — What does
proxy_read_timeout 60smeasure, and why can a request run for ten minutes without tripping it? - Must-know 7 — Distinguish a 502 from a 504 and say which is safe to retry for a POST.
- Must-know 8 — Why does a WebSocket fail through NGINX without extra configuration?
- Important 9 — What problem does the PROXY protocol solve and what is the main rule when enabling it?
- Must-know 10 — How do you deploy without dropping requests behind a proxy?
TCP & UDP
Open the chapter · 11 questions
- Must-know 1 — A client in Frankfurt opens a new HTTPS (TLS 1.3 over TCP) connection to a server in Virginia (RTT 90 ms) for every request. How long before the first response byte, ignoring server time, and what is the cheapest fix?
- Important 2 — Your Go service reports
read: connection reset by peeron the first database query each morning. What is the likely cause and two fixes? - Important 3 — Why does a gRPC service behind an NLB stay unbalanced after a scale-out?
- Important 4 — A PHP-FPM fleet begins failing with "Cannot assign requested address" when talking to Redis. Explain the mechanism.
- Must-know 5 — What is the difference between flow control and congestion control?
- Good to know 6 — You see a constant extra ~40 ms on every call of a small RPC protocol on Linux. What do you check first?
- Important 7 — Why is HTTP/3 better than HTTP/2 on a lossy mobile link, and what does it need from the network?
- Must-know 8 — You must send game player positions 30 times per second. TCP or UDP, and why?
- Important 9 — Your UDP sender with acks returns
ErrNoAck. Did the receiver get the message? - Good to know 10 — During a deploy, clients see connection times of exactly 1 s and 3 s to a freshly started service. What happened?
- Important 11 — Large uploads over a site-to-site VPN hang while small requests work. What is it and how do you fix it?
HTTP/1.1, HTTP/2, HTTP/3, Keep-Alive & HTTPS
Open the chapter · 12 questions
- Must-know 1 — Why does HTTP/2 still suffer from head-of-line blocking, and how does HTTP/3 avoid it?
- Must-know 2 — A Go service makes 200 requests per second to one HTTP/1.1 backend with 50 ms latency using
http.DefaultClient. What two problems does it have, and how do you fix them? - Important 3 — Your Go client sets a custom
TLSClientConfigand suddenly every response isHTTP/1.1. Why? - Important 4 — Users behind an AWS ALB see occasional 502s; the Go backend has
IdleTimeout: 30s. What is happening? - Good to know 5 — Which requests may a client retry after an HTTP/2
GOAWAYwith last-stream-id 5, if it had streams 3, 5 and 7 open? - Good to know 6 — Why did browsers remove HTTP/2 server push, and what replaces it?
- Important 7 — How does a browser find out a site supports HTTP/3, and what happens if UDP is blocked?
- Important 8 — What is wrong with enabling 0-RTT for all requests?
- Important 9 — A gzip middleware is added and conditional requests stop producing 304s for some clients, or caches serve gzip to clients that did not ask. What two headers need attention?
- Must-know 10 — A Laravel app on PHP-FPM calls four internal services per page. Why does
Http::poolhelp, and what does it not fix? - Must-know 11 — Where should TLS terminate, and what must the application be told when it terminates at a load balancer?
- Important 12 — Why can a single HTTP/2 or gRPC client overload one backend behind an L4 load balancer?
Real-Time Communication: Short/Long Polling, SSE, WebSockets, Scaling Connections, Presence
Open the chapter · 11 questions
- Must-know 1 — A dashboard shows warehouse stock that changes a few times a minute; 30,000 staff keep it open. Which transport, and why not WebSocket?
- Must-know 2 — Every WebSocket behind your AWS ALB dies after exactly one minute of silence. What is happening and what are two fixes?
- Important 3 — Your client library reports close code 1006. Should the client reconnect, and did the server send 1006?
- Important 4 — Alice is on gateway 1 and Bob on gateway 2. Alice's message never reaches Bob. What is missing, and what does Reverb need for it?
- Important 5 — Redis Pub/Sub is at-most-once. How can a chat built on it still be lossless for a client that reconnects?
- Important 6 — A user has the app open on a laptop and a phone. The phone loses signal. What should presence show, and how does the design guarantee it?
- Important 7 — You deploy a gateway that holds 120,000 connections. Describe a deploy that does not cause a reconnection storm.
- Must-know 8 — Why is checking the
Originheader required for a cookie-authenticated WebSocket, and why is it not enough on its own? - Important 9 — One customer on bad hotel Wi-Fi makes the whole trading room lag. What design flaw does that reveal, and what is the fix?
- Good to know 10 — Your Laravel SSE endpoint built with
response()->eventStream()never resumes after a reconnect. Why, and how do you fix it? - Important 11 — A 1,000-member presence channel feels slow every morning at 9:00. Estimate the message count when everyone joins and name a fix.
REST API Design: Constraints, Resources, Idempotency, Versioning
Open the chapter · 12 questions
- Must-know 1 — Name Fielding's six constraints and the one that is optional.
- Must-know 2 — A server keeps a user's search results in process memory and returns
?page=2from them. Which constraint does that break, and what operational symptom will you see? - Must-know 3 — Is
DELETE /orders/7still idempotent if the second call returns 410 instead of 204? Why? - Important 4 — A client sends
PATCH {"note": null}. What does that mean under JSON Merge Patch, and how would you express "change status only if it is still pending"? - Must-know 5 — Pick the status code: (a) valid JSON but
total_centsis negative; (b) the body istext/plain; (c)If-Matchis stale; (d) noIf-Matchbut the server requires it; (e) shipped order moved back to pending. - Must-know 6 — Why does offset pagination show duplicates under concurrent inserts, and what does a keyset cursor contain?
- Must-know 7 — Your POST /payments timed out. The client retries with the same Idempotency-Key while the first request is still running. What should it get, and what should it get after the first finishes?
- Good to know 8 — Why do most public APIs stop at Richardson level 2, and what is a cheap step toward level 3?
- Must-know 9 — What is the difference between
Cache-Control: no-cacheandno-store, and which do you use forGET /me? - Must-know 10 — An export takes 4 minutes. Design the HTTP exchange.
- Important 11 — Name three things a contract-first OpenAPI workflow catches that code-first does not.
- Must-know 12 — User 42 requests
/orders/ord_8, which belongs to user 7. 403 or 404, and how does Laravel express it?
GraphQL: Schema, Resolvers, N+1, When It Wins
Open the chapter · 10 questions
- Must-know 1 — Why does GraphQL tend to produce N+1 queries, and what does DataLoader change?
- Important 2 — A response has HTTP 200,
data.order = nulland one entry inerrors. What happened, and how should monitoring treat it? - Important 3 — What does
[Order!]!mean, and what happens if one resolver for a non-null field fails? - Good to know 4 — Why is a Relay cursor "opaque", and what is wrong with
@paginate(type: CONNECTION)in Lighthouse if you expected keyset paging? - Must-know 5 — Give two defences against abusive queries and explain why request-count rate limiting is not enough.
- Must-know 6 — Where should an authorization check live, and why is checking the
/graphqlendpoint not enough? - Important 7 — What is APQ, how does the handshake work, and why does it not replace a safelist?
- Must-know 8 — How do you remove a field without versioning the API?
- Important 9 — Federation versus a plain BFF: when is each right?
- Must-know 10 — Name three situations where REST or gRPC is a better choice than GraphQL.
gRPC & Protocol Buffers; REST vs GraphQL vs gRPC
Open the chapter · 11 questions
- Must-know 1 — A colleague deletes
string customer_email = 4;and, a month later, addsint64 loyalty_points = 4;. What happens to old stored messages, and what two things would have prevented it? - Good to know 2 — Why does -1 take 10 bytes as
int64but 1 byte assint64? - Must-know 3 — A client sends
UpdateDiscount{percent: 0}withint32 percent = 2;. Why can the server not tell "set to zero" from "not sent", and what is the fix? - Must-know 4 — All your gRPC calls return HTTP 200 in the load balancer logs, yet users see errors. Where is the real status?
- Important 5 — After scaling a deployment from 3 to 10 pods behind a ClusterIP Service, the new pods get no gRPC traffic. Why, and name three fixes.
- Must-know 6 — Your retry policy lists
DEADLINE_EXCEEDEDforCreateOrder. What can go wrong and what should you do instead? - Important 7 — What is the difference between a retry policy and a hedging policy, and which methods may use either?
- Important 8 — A client sets keepalive
Timeto 5 s against a grpc-go server with default settings. What happens? - Important 9 — A browser SPA must call
OrderServiceincluding a live-tracking stream. Which options work and what are their limits? - Good to know 10 — Why does
buf breakingwith theWIREcategory not report a field rename, whileFILEdoes? - Must-know 11 — When would you choose GraphQL over gRPC for a new API, and when REST over both?
API Versioning & Evolution
Open the chapter · 10 questions
- Must-know 1 — Is adding an optional response field breaking?
- Important 2 — Why are path versions easier to operate than media-type versions?
- Good to know 3 — What does
Deprecation: @1688169599mean, and how doesSunsetdiffer? - Good to know 4 — How does Stripe keep old versions cheap?
- Must-know 5 — A column rename is needed behind a live API. List the phases.
- Important 6 — Why is "total requests per version" insufficient before a sunset?
- Must-know 7 — What is the difference between a feature flag and a version?
- Good to know 8 — What does
buf breakingcheck, and what are its categories? - Important 9 — Why can a consumer-driven contract be better than an OpenAPI diff for deleting a field?
- Important 10 — What status code should a retired version return, and why not 404?
Web Sessions, Cookies, Serialization & CORS
Open the chapter · 12 questions
- Must-know 1 — Why can the server not see a cookie's
Max-AgeorSecureflag on later requests? - Important 2 — What does
__Host-guarantee, and what must theSet-Cookiecontain? - Must-know 3 — Why rotate the session id on login?
- Must-know 4 — Explain idle vs absolute timeout and why you need both.
- Must-know 5 — When is a preflight sent and what does it carry?
- Must-know 6 — Why is reflecting the
Originheader together withAllow-Credentials: truedangerous? - Important 7 — What does
Vary: Originprotect against? - Important 8 — Why is the naive double submit cookie weak and how does the signed variant fix it?
- Must-know 9 — What is the difference between same-origin and same-site?
- Good to know 10 — How does the selector/validator pattern limit damage from a database leak and from cookie theft?
- Good to know 11 — Why prefer JSON over PHP
serializefor cookie or session payloads? - Important 12 — A SPA at
https://app.example.comcallshttps://api.example.comwith cookies. List the settings needed.
Scaling Strategies: Vertical, Horizontal, Diagonal, Stateless Design, Autoscaling
Open the chapter · 12 questions
- Must-know 1 — Your PostgreSQL primary is at 75% CPU at peak and the app tier is autoscaled. What is your first scaling move, and why not sharding?
- Must-know 2 — With σ = 0.05, what is the best speedup you can ever get, and what do you get at 64 nodes?
- Good to know 3 — A USL fit gives σ = 0.02 and κ = 0.0004. Where is the peak, and what does that mean for
maxReplicas? - Must-know 4 — Name three things that make a web process stateful and where each should go.
- Must-know 5 — Why are sticky sessions a smell in an autoscaled tier, and when is affinity acceptable?
- Important 6 — HPA: 8 pods, target 60% CPU, current average 90%. What does it request? And at 64%?
- Important 7 — Your pods scale up within 15 s of a spike, but users see errors for three minutes. What is happening?
- Important 8 — Describe a correct shutdown sequence for an autoscaled Go replica with a 30 s grace period.
- Must-know 9 — Peak is 19,000 QPS and one cluster breaks at 5,000 QPS. How many clusters for N+2, and what is the utilisation at peak?
- Important 10 — Why does a closed-model load test (fixed virtual users) overstate capacity, and which tools avoid it?
- Important 11 — What changes when a Laravel app moves from PHP-FPM to Octane, from a scaling point of view?
- Important 12 — Why should a VPA and an HPA not both act on CPU for the same Deployment?
Load Balancing: Algorithms, L4 vs L7, DNS & Global, Health Checks, Affinity, TLS Termination
Open the chapter · 11 questions
- Important 1 — Ten Envoy sidecars each use least connections against the same five backends. Why can that overload one backend, and what fixes it?
- Must-know 2 — A cache tier of 10 servers uses
hash $request_uriwithoutconsistent. You add an eleventh server. What happens to the hit ratio? - Important 3 — AWS ALB health checks use default settings. A target crashes. Roughly how long does it keep receiving requests, and how do you shorten that?
- Important 4 — Your health check runs
SELECT 1against the primary database. The database fails over for 20 seconds. What do HAProxy and ALB do? - Must-know 5 — Put these in the right order for a zero-error deploy of one Pod: SIGTERM, readiness fails, endpoint removed from balancers, in-flight requests finish.
- Important 6 — A client sends a POST, the balancer forwards it, the backend crashes before responding. What should NGINX do by default and why?
- Must-know 7 — Why do sporadic 502s appear when the backend's keepalive timeout is 5 s behind an ALB with a 60 s idle timeout?
- Important 8 — When is TLS passthrough the right choice, and what do you lose?
- Good to know 9 — keepalived nodes have priorities 150 and 100 and a tracking script with weight -20. HAProxy dies on the master. Does the VIP move?
- Important 10 — A gRPC service behind a Kubernetes ClusterIP Service is scaled from 3 to 9 Pods, but the new Pods get no traffic. Why, and what are two fixes?
- Important 11 — Which status would you expect from HAProxy when every server's
maxconnis reached and a request waits longer thantimeout queue?
Rate Limiting: Token Bucket, Leaky Bucket, Windows, Distributed Limits
Open the chapter · 12 questions
- Important 1 — A token bucket has
r = 5/sandb = 10. A client sends 10 requests at once and then one request every 100 ms. How many of the next 20 requests pass? - Must-know 2 — Why does a fixed window of 100/min allow 200 requests in 200 ms, and which two algorithms fix it with the least memory?
- Good to know 3 — Write the GCRA decision for a request of cost 1.
- Good to know 4 — Using Cloudflare's numbers (limit 50/min, 42 requests last minute, 18 in the current minute, 15 s elapsed), what is the estimate, and is the next request allowed?
- Must-know 5 — What goes wrong with
INCRfollowed byEXPIREas two commands, and how do you fix it? - Must-know 6 — Your Laravel app runs behind an AWS ALB and every anonymous user gets 429 at the same moment. Why?
- Important 7 — Envoy's global rate limit service times out. What does Envoy do by default, and how do you change it?
- Must-know 8 — When should a limiter answer 503 instead of 429?
- Important 9 — Three nodes count locally and sync every second; each sees 40 requests per second for one tenant whose global limit is 300 per minute. What is the worst-case overshoot?
- Important 10 — A response carries
Retry-After: 10andRateLimit: "default";a=0;w=4. How long should the client wait? - Important 11 — Why is
RateLimiter::attempt()not enough to enforce "exactly 5 messages" under concurrent requests, and what should you use? - Must-know 12 — A GraphQL query would cost 1,000 points and the per-query maximum is 500. Which status, and why not 429?
CDNs: Push vs Pull, Static vs Dynamic, Video Streaming, Cache Hierarchy
Open the chapter · 12 questions
- Must-know 1 — A page has
Cache-Control: public, max-age=60, s-maxage=600. How long does the browser keep it fresh, and how long does a CDN? - Must-know 2 — Why does
no-cachenot stop caching, and what does? - Important 3 — Your edge hit ratio is 96% but the origin egress bill went up. Give two explanations.
- Must-know 4 — A hot JSON object with a 1 s TTL is requested 5,000 times per second at each of 200 PoPs. Without coalescing or a shield, roughly how many origin requests per second at worst, and with both?
- Important 5 — What exactly does
stale-if-error=86400permit, and when should you not send it? - Important 6 — Why is
?v=2weaker than a hash in the file name? - Important 7 — A product page reads an A/B cookie. How do you cache it without serving the wrong variant?
- Important 8 — Why should a purge run after COMMIT, not inside the transaction?
- Important 9 — In HLS, which objects get long TTLs and which short, for live and VOD?
- Important 10 — How does a signed URL coexist with a high hit ratio on video segments?
- Must-know 11 — Name three ways to make sure attackers cannot bypass the CDN.
- Good to know 12 — Why does Go's
singleflightneed a detached context in a cache?
Caching: Levels, Cache-Aside, Read/Write-Through, Write-Behind, Invalidation, Stampedes, Eviction, Redis Clustering
Open the chapter · 12 questions
- Must-know 1 — Why does Facebook delete cache entries on write instead of updating them?
- Important 2 — Draw the race in which cache-aside with write-then-delete still caches stale data. What closes it?
- Important 3 — Why is delete-then-write worse than write-then-delete?
- Must-know 4 — A hot key at 2,000 requests per second takes 300 ms to recompute. Roughly how many requests miss during one recompute without protection, and what are three defences?
- Good to know 5 — What does XFetch's
betado, and why does the rule usedelta? - Must-know 6 — Your Redis cache returns OOM errors on SET. What happened and what do you change?
- Important 7 — Why does
MGET user:1 user:2fail on Redis Cluster whileMGET {user:1}:a {user:1}:bworks? - Good to know 8 — What is the difference between
-MOVEDand-ASK? - Good to know 9 — When is W-TinyLFU better than LRU?
- Must-know 10 — Hit ratio rises from 95% to 99%. By what factor does database load fall?
- Must-know 11 — Name two ways the cache can leak data between tenants and the fix for each.
- Good to know 12 — How does Redis client-side caching keep a local copy fresh, and what must the client do on disconnect?
Object Storage, Distributed File Systems, Presigned URLs & Content-Addressable Storage
Open the chapter · 11 questions
- Must-know 1 — Why is a block volume not a shared storage system, and what do you add to share it?
- Important 2 — In GFS and HDFS, why is the single master not the bandwidth bottleneck?
- Must-know 3 — What does S3 strong read-after-write consistency guarantee and not guarantee?
- Important 4 — List what a presigned PUT can enforce and what it cannot.
- Good to know 5 — Why does a presigned S3 URL behave badly behind a CDN?
- Important 6 — How do you stop incomplete multipart uploads silently costing money?
- Important 7 — Why is content-addressable storage immutable and self-verifying?
- Important 8 — A bucket has versioning on. A user deletes an object. What exactly happens and how do you undo it?
- Must-know 9 — Compare SSE-S3, SSE-KMS and SSE-C by key ownership.
- Must-know 10 — Why do metadata queries belong in a database and not in object metadata?
- Important 11 — Estimate which cost line dominates for 20 TB/month of video egress with 50 TB stored, and name the fix.
Write Buffering, Batching, Coalescing, Sharded Counters & Data Locality
Open the chapter · 10 questions
- Must-know 1 — A service acknowledges a write as soon as it is appended to an in-memory queue. State the durability window and one way to shorten it.
- Important 2 — Why does a bigger batch stop helping?
- Must-know 3 — Batching and coalescing both reduce database messages. What is the difference?
- Must-know 4 — A counter uses
ON CONFLICT DO UPDATE SET views = page_counters.views + EXCLUDED.views. Is a retried batch safe? - Important 5 — Why must a multi-row upsert be deduplicated first?
- Important 6 — Design a sharded counter for 20,000 increments per second when one shard sustains about 1,000 per second. How many shards, and what does a read cost?
- Must-know 7 — Why does hashing not protect against a hot partition, and what does?
- Important 8 — Why use a Redis hash tag in
cnt:{p7}:3? - Important 9 — What must
Closedo in a batcher, and what must it not do? - Must-know 10 — When is write buffering the wrong tool?
CAP Under a Real Partition, CP vs AP, PACELC & Tunable Consistency
Open the chapter · 12 questions
- Important 1 — A three-node etcd cluster is split {1, 2} | {3}. What happens to a
putand to a defaultgetsent to member 3, and how can a client still read there? - Must-know 2 — Why is "CA" not a valid choice for a system running on more than one machine?
- Good to know 3 — Under the strict definitions, why is a PostgreSQL primary with asynchronous read replicas neither CP nor AP?
- Important 4 — N = 3. Compare (R, W) = (1, 2) and (2, 2) during a partition {A, B} | {C}.
- Good to know 5 — Two datacenters with RF 3 each. How many replicas do
QUORUM,LOCAL_QUORUMandEACH_QUORUMneed, and which crosses the ocean on every request? - Important 6 — What does PACELC add to CAP, and how would you classify a default Cassandra deployment and Spanner?
- Good to know 7 — Describe Brewer's three steps for managing a partition, using the ATM.
- Important 8 — A PostgreSQL commit hangs because the only synchronous standby is unreachable; an operator cancels it. Is the transaction rolled back?
- Important 9 — A Kafka topic has RF 3,
min.insync.replicas=1, producers useacks=all. Two followers fall out of the ISR. What is the durability risk, and what is the fix? - Good to know 10 — Which MongoDB settings give a linearizable balance read, and what must the client add so the read does not hang on a minority primary?
- Must-know 11 — Give one data item you would make CP and one you would make AP in a social shopping app, with the knob.
- Good to know 12 — What are harvest and yield, and how would a search page use them during a partition?
Consistency Models: Linearizability vs Serializability, Causal, Client-Centric, Convergence
Open the chapter · 10 questions
- Must-know 1 — Client A's
write(x=1)returned OK at t=10. Client B'sread(x)started at t=20 and returned 0. Which models does this violate: linearizable, sequential, read-your-writes? - Important 2 — Why is serializability not enough for "transfer done, now show the balance"?
- Important 3 — Name the four session guarantees and one user-visible anomaly each prevents.
- Important 4 — What does Laravel's
stickyoption guarantee, and what doesPreventStaleDatabaseReadsadd? - Important 5 — Two concurrent
cas(0 -> 1)andcas(0 -> 2)both return success. Is the history linearizable? Why does it matter? - Good to know 6 — How does a Raft leader serve a linearizable read without writing to the log, and why is a lease read riskier?
- Good to know 7 — What does CockroachDB guarantee if a node's clock drifts beyond
--max-offset, and what does it do about it? - Good to know 8 — Under which conditions does a MongoDB causally consistent session give all four session guarantees?
- Important 9 — Your team uses Cassandra with
QUORUMwrites andQUORUMreads. Is the username table safe against duplicates? - Good to know 10 — Which tool would you use to check a history of multi-key transactions for write skew, and which for a single register?
ACID vs BASE
Open the chapter · 12 questions
- Must-know 1 — Which of the four ACID properties are guaranteed when a crash happens between two
UPDATEstatements, and which mechanism provides it? - Must-know 2 — Why is "consistency" in ACID different from consistency in CAP?
- Good to know 3 — Who coined BASE, when, and why is it better described as a stance than a model?
- Important 4 — A DynamoDB
TransactWriteItemscall times out. How do you retry safely? - Important 5 — Why does 2PC reduce availability, with numbers?
- Must-know 6 — What is the difference between a rollback and a compensation?
- Important 7 — Name three things a saga step must be.
- Must-know 8 — A user saves a profile and sees the old data on the next page. What is happening and what are two fixes?
- Must-know 9 — When is BASE the wrong choice?
- Important 10 — Why dispatch a Laravel job with
afterCommit()inside a transaction? - Good to know 11 — What does the reconciliation job in this chapter compare, and why the 15-minute grace window?
- Important 12 — Which errors may you retry for a SQL transaction and what do you retry?
Replication Topologies: Leader-Follower, Multi-Leader, Leaderless Quorums, Conflict Resolution, Federation
Open the chapter · 11 questions
- Must-know 1 — A user gets "order not found" after checkout. The app has
'sticky' => true. Why does it still happen, and what fixes it? - Important 2 — PostgreSQL has one synchronous standby with
synchronous_commit = on. Can a read on that standby miss a committed row? - Important 3 — Patroni promotes a replica after the primary's leader key expires. What stops the old primary from accepting writes if it is only partitioned?
- Must-know 4 — N=3, W=1, R=1. Is a read after a write guaranteed to see it? What about W=2, R=2?
- Must-know 5 — Why does a sloppy quorum make the system more available but less consistent?
- Important 6 — Two regions edit the same profile name concurrently in DynamoDB global tables (MREC). What happens to the two edits?
- Good to know 7 — In the version-vector cart, why must the client send back the context from its last read?
- Important 8 — Dynamo's union merge of carts never loses an "add to cart". What is the price?
- Important 9 — A Kafka topic has RF=3 and
min.insync.replicas=1, producers useacks=all. Two brokers fall out of the ISR. Are writes still accepted and are they safe? - Important 10 — A SaaS company wants EU customers' data to stay in the EU and low write latency for everyone. Which pattern, and how are writes from an EU customer travelling in the US handled?
- Good to know 11 — What is the difference between database federation and Mastodon-style federation?
Sharding at System Level: Partition Keys, Hot Partitions, Rebalancing, Cross-Shard Queries
Open the chapter · 12 questions
- Must-know 1 — Your PostgreSQL primary is at 85% CPU, almost all from reads. Should you shard?
- Must-know 2 — Why is
hash(user_id) % Na bad placement function, and what replaces it? - Important 3 — MongoDB lists three properties of a good shard key. Name them and give a bad key for each.
- Must-know 4 — A DynamoDB table keyed by
datethrottles every day at 09:00. Explain and fix it. - Good to know 5 — Notion chose 480 logical shards. Why not 512?
- Important 6 — What are the phases of an online partition move, and which one is the only time writes stop?
- Important 7 — A support search by email takes 900 ms on 64 shards though each shard answers in 10 ms on average. Why, and what do you change?
- Important 8 — What is the difference between a DynamoDB LSI and GSI for a sharded design?
- Important 9 — Two tenants on different shards must exchange credits atomically. Give two designs and their costs.
- Good to know 10 — Why do Instagram and Pinterest put the shard number inside the id?
- Good to know 11 — During a Redis Cluster resharding a client receives
-ASK 8 192.0.2.12:6379. What must it do, and how is that different from-MOVED? - Important 12 — Your Laravel app saves an
Orderwithtenant_idwhile that tenant is being moved. What happens with the code in this chapter, and why is that the desired behaviour?
Choosing a Database: Model the Queries, SQL vs NoSQL, Redis vs DynamoDB, Polyglot Persistence
Open the chapter · 10 questions
- Must-know 1 — Why does the DynamoDB guide say not to design the schema until you know the questions?
- Must-know 2 — Classify each as a query shape: "order 01J9A", "last 20 orders of customer 42", "revenue per region last quarter", "red shoes size 42", "friends of friends".
- Must-know 3 — A team says "attributes differ per product, so we need MongoDB". What do you ask?
- Must-know 4 — When must a MongoDB child be referenced instead of embedded?
- Important 5 — Why does a GSI keyed on order status create a hot partition, and how does the adapter fix it?
- Important 6 — What can a Redis primary store lose with
appendfsync everysec, and what settings make it a store rather than a cache? - Must-know 7 — Redis or DynamoDB for (a) sessions with 30-minute TTL, (b) user profiles for 200 million users, (c) a leaderboard updated 10,000 times a second?
- Important 8 — What does distributed SQL give you that PostgreSQL does not, and what does it cost?
- Must-know 9 — Why is application dual write risky, and how does the
migratepackage contain the risk? - Must-know 10 — Give the stores for an e-commerce system run by two developers, and why.
Cascading Failures: How One Service Takes Down Everything
Open the chapter · 11 questions
- Important 1 — A frontend has 1,000 threads and serves 1,000 QPS at 100 ms. 5% of requests start hanging until a 100 s deadline. Roughly what share of requests is served?
- Must-know 2 — Three layers each make 4 attempts. How many attempts can one click produce at the bottom, and what are the two cheapest fixes?
- Good to know 3 — Why did the naive simulator stay collapsed after load returned to 70% at 30 s?
- Must-know 4 — What is the difference between process health checking and service health checking, and which one should Kubernetes liveness use?
- Important 5 — Why can autoscaling on CPU scale a web tier down during a network incident?
- Important 6 — A cache cluster restarts and the database falls over. What does "capacity cache" mean here, and name two mitigations.
- Important 7 — During a collapse, why is "restart everything" risky, and what does slow start do?
- Important 8 — Name the order of a recovery runbook for a metastable failure.
- Important 9 — Which of the four golden signals usually moves first in a cascade, and why is "attempts per first attempt" worth graphing?
- Good to know 10 — What was the sustaining or amplifying mechanism in each of S3 2017, Cloudflare 2019 and Google 2020?
- Must-know 11 — Why is a short client timeout without a retry budget sometimes worse than a long one?
Timeouts, Retries & Jitter
Open the chapter · 12 questions
- Must-know 1 — A POST times out after 1.5 s. May you retry it? Under what condition?
- Must-know 2 — Why does
Http::retry(3, 100)->timeout(3)not bound the call at 3 seconds? - Must-know 3 — Five services in a chain each retry three times. How many calls reach the database for one failing user request, and what is the fix?
- Important 4 — Compute the sleep ceiling for retry 5 with base 100 ms and cap 5 s, and the range under full and equal jitter.
- Important 5 — A server returns 429 with
Retry-After: 30but your backoff gives 200 ms. How long do you wait, and when do you give up instead? - Must-know 6 — Why must the idempotency key be created outside the retry loop?
- Important 7 — Your Laravel job has
--timeout=120and the Redis connection hasretry_after=90. What happens? - Important 8 — What do the three PostgreSQL timeouts protect against?
- Important 9 — What is the difference between a retry budget and a per-request attempt limit?
- Good to know 10 — Why use a fake clock in retry tests?
- Good to know 11 — When does hedging beat a retry, and what must be true of the operation?
- Must-know 12 — Name the three classes of failure and one example of each.
Circuit Breaker
Open the chapter · 12 questions
- Important 1 — A breaker has
minimumNumberOfCalls = 10and the first nine calls all fail. What state is it in, and why? - Important 2 — Why does a count-based window of 100 behave badly on an endpoint receiving 2 requests per second?
- Must-know 3 — Name the three outcomes a failure classifier should produce and one example of each.
- Important 4 — What is the difference between Envoy circuit breaking and Envoy outlier detection?
- Important 5 — With a breaker outside the retries, how many failures does one failed user request record, and what if the breaker is inside?
- Must-know 6 — Why is the half-open state limited to a few probes instead of letting all traffic through?
- Important 7 — Give two reasons a PHP-FPM application cannot keep breaker state in process memory.
- Good to know 8 — What does the generation number in the Go and Laravel implementations protect against?
- Must-know 9 — Which fallback rung is wrong for a payment authorisation and why?
- Important 10 — Why should a breaker ignore rejections coming from a bulkhead or a rate limiter?
- Good to know 11 — How does NGINX approximate a breaker, and what can it not do?
- Must-know 12 — State the main anti-pattern about retries and non-idempotent writes.
Bulkheads & Graceful Degradation
Open the chapter · 12 questions
- Must-know 1 — A service has one pool of 100 goroutines for three dependencies. One dependency goes from 20 ms to 10 s. Explain what happens to the other two.
- Important 2 — Size a compartment for 200 req/s at 50 ms mean latency with 30% headroom, and give the queue bound for 100 ms of tolerated wait.
- Must-know 3 — When is rejecting at the limit better than queueing, and when is a short bounded wait better?
- Good to know 4 — With eight workers and two per tenant, how many shuffle shards exist, and what share of other tenants can a bad tenant fully disable?
- Important 5 — What do
max_connectionsandmax_pending_requestsdo in an Envoy cluster? - Good to know 6 — Why does a Pennant feature that reads the degradation level in
resolve()not switch off when the level changes, and how do you fix it? - Important 7 — What is the difference between
Cache::flexible('k', [30, 300], ...)andCache::remember? - Important 8 — Why does a degradation ladder need hysteresis and a minimum dwell?
- Important 9 — Name three things a game day for the recommendations dependency must verify.
- Must-know 10 — Why might a fallback to the database when the cache fails make an incident worse?
- Important 11 — How do
php artisan queue:work --queue=high,defaultand two Horizon supervisors differ? - Important 12 — What does a PodDisruptionBudget protect, and what does it not?
Load Shedding
Open the chapter · 11 questions
- Must-know 1 — What is the difference between throughput and goodput, and why can throughput be at maximum while goodput is zero?
- Must-know 2 — Why is a concurrency limit a better unit than requests per second?
- Good to know 3 — Describe how Vegas and the gradient controller decide to lower the limit.
- Must-know 4 — When should a server answer 503 and when 429?
- Good to know 5 — What are the four Google criticality values and which are shed first?
- Important 6 — Why does the queue-time budget need a timestamp from the proxy?
- Important 7 — What does a retry budget do, and with what numbers?
- Good to know 8 — Compare drop-head and reject-publish in RabbitMQ.
- Important 9 — How can load shedding break CPU-based autoscaling?
- Important 10 — Why must latency metrics exclude shed requests?
- Important 11 — What should an overload test look like and what result passes?
API Idempotency: Keys, Storage, Retries
Open the chapter · 10 questions
- Must-know 1 — A client times out on
POST /charges. List three possible server states and say which can produce a double charge on a naive retry. - Must-know 2 — Why is "SELECT then INSERT" not a valid claim?
- Good to know 3 — What status do the IETF draft's three error scenarios use?
- Important 4 — Why scope the key per client?
- Important 5 — A crash happens between the PSP charge and the
completedupdate. What three techniques prevent a second charge? - Important 6 — Should a
500be replayed on a retry? - Important 7 — What is the lease for, and what happens if the handler outlives it?
- Must-know 8 — How long should keys be kept?
- Good to know 9 — When do you not need a key table?
- Important 10 — How does the same idea apply to a Kafka consumer?
Distributed Locking: Redis, Redlock, Fencing Tokens, Leases
Open the chapter · 11 questions
- Must-know 1 — Why is
SETNXfollowed byEXPIREworse thanSET NX PX? - Must-know 2 — A job releases its lock with
DEL. Describe how this lets three processes run at once. - Important 3 — Kleppmann's test for efficiency versus correctness locks?
- Important 4 — Why can't a watchdog that renews every 10 s guarantee exclusion?
- Must-know 5 — What exactly does the storage do with a fencing token?
- Important 6 — Why is Redlock's random value not a fencing token?
- Good to know 7 — Give the Redlock acquisition rule and the validity formula.
- Good to know 8 — Which fencing token does each of etcd, ZooKeeper and Consul offer?
- Important 9 — Your Go service takes
pg_try_advisory_lockwithdb.QueryRowand unlocks withdb.Exec. What can go wrong? - Important 10 — A Laravel job uses
new WithoutOverlapping($id)and the worker is OOM-killed. What happens on the redis cache driver, and what is the fix? - Must-know 11 — When is no lock correct, whatever product you use?
Leader Election: Exactly One Active Node
Open the chapter · 12 questions
- Important 1 — Why does Raft guarantee at most one leader per term but not at most one node that believes it is leader?
- Good to know 2 — What does randomizing the election timeout buy, and what did the Raft paper measure without it?
- Important 3 — With client-go defaults, how long after a leader crashes does a standby take over, and why can it not be faster?
- Must-know 4 — Why must
RenewDeadlinebe shorter thanLeaseDuration? - Must-know 5 — A leader checks
IsLeader(), then is paused for 40 s, then writes. What prevents damage? - Important 6 — What problem does Pre-Vote solve, and what does CheckQuorum solve?
- Important 7 — Name a fencing token source for each: Kubernetes Lease, etcd election, ZooKeeper, Kafka partition, your PostgreSQL lease row.
- Must-know 8 — Does
onOneServer()make one server the scheduler leader? What does it do instead? - Important 9 — Why is a session-level PostgreSQL advisory lock a risky leader lock?
- Must-know 10 — Why does Kafka scale even though every partition has a single leader?
- Good to know 11 — Why is the bully algorithm not used in production clusters?
- Must-know 12 — A Laravel singleton worker receives SIGTERM during a deploy. What is the correct order of actions?
Gossip Protocols, Convergence & Failure Detection
Open the chapter · 11 questions
- Important 1 — Why does push-pull anti-entropy finish faster than push when only a few nodes are still uninformed?
- Good to know 2 — A memberlist LAN cluster has 1000 members. How long, roughly, from a crash until every member considers it dead?
- Important 3 — Why does SWIM use ping-req through k members instead of retrying the direct ping?
- Good to know 4 — Member D receives suspect(D, inc 4) while its own incarnation is 4. What does it do, and why can no other member do the same?
- Good to know 5 — What is a rumour mongering residue, and how do production systems deal with it?
- Good to know 6 — Which member does Lifeguard assume might be at fault, and what are its three mechanisms?
- Important 7 — Cassandra's phi detector convicts a node. Will Cassandra rebalance its data?
- Important 8 — Describe the PFAIL to FAIL transition in Redis Cluster.
- Important 9 — Why can you not elect a leader by "the alive member with the lowest id" over gossip?
- Good to know 10 — How do you rotate a gossip encryption key in Consul without downtime?
- Good to know 11 — Why is a Laravel queue worker registry not built with a gossip protocol, and which gossip ideas does it keep?
Vector Clocks, Lamport Clocks & Distributed Causality
Open the chapter · 12 questions
- Must-know 1 — Two events on two hosts are 5 ms apart by their wall clocks. Can you say which happened first?
- Important 2 — State Lamport's two implementation rules and the Clock Condition. Why does the converse not hold?
- Important 3 — In the lab run, L(a2) = 2 and L(c2) = 4. Did a2 happen before c2?
- Important 4 — Compare [A:3 B:1] with [A:3 B:2 C:1] and with [A:2 B:4].
- Good to know 5 — Why does a version vector with one entry per server lose updates when two clients write through the same server, and how do dots fix it?
- Good to know 6 — What does pruning a vector clock cost, and why is that the safe direction?
- Important 7 — Node A's clock is 3 ms ahead of B's. A writes x and sends it; B writes y after receiving x. What do wall-clock LWW and HLC decide?
- Good to know 8 — What exactly does Spanner's commit wait guarantee, and what does it cost?
- Good to know 9 — What happens to a CockroachDB node whose clock drifts, and what error do clients see near the bound?
- Important 10 — A MongoDB client writes with
w:1and reads from a secondary in a causal session. Is read-your-writes guaranteed? - Important 11 — Which two ids let you rebuild the causal tree of a business flow from messages without any clock?
- Must-know 12 — When is last-writer-wins an acceptable conflict rule?
Merkle Trees, Read Repair, Anti-Entropy & Tombstones
Open the chapter · 12 questions
- Good to know 1 — Two replicas each hold 50 million keys in a tree with 65,536 leaves. They are identical except for one key. How many hashes are compared with fan-out 16, and roughly how many keys are streamed?
- Good to know 2 — Why does RFC 6962 prefix leaves with
0x00and nodes with0x01? - Good to know 3 — A browser holds a signed tree head for size 8 and receives the audit path
[h4, h(6-7), h(0-3)]for leaf 5. Write the hash computations. - Important 4 — A Cassandra node was down for five hours. Hints are enabled with defaults. Which writes did it miss permanently, and what fixes them?
- Must-know 5 — Why can read repair at
LOCAL_QUORUMnot replace scheduled repair, even on a read-heavy table? - Important 6 — Describe the exact sequence that turns a delete into a zombie in Cassandra.
- Important 7 — Your team wants to lower
gc_grace_secondsfrom 10 days to 1 hour on a table because of tombstone warnings. When is that safe? - Important 8 — Why should full repair still run if incremental repair runs every day?
- Important 9 — A compacted Kafka topic has
delete.retention.msof 1 day. A service rebuilds its cache from offset 0, which takes 30 hours. What can go wrong? - Important 10 — An offline-first app keeps soft-deleted rows 30 days. A phone comes back after 45 days. What must the API do and why?
- Good to know 11 — Is CouchDB replication a Merkle-tree protocol? How does it carry deletes?
- Good to know 12 — Why does Riak rebuild its AAE hash trees periodically even though they are updated on every write?
CRDTs: Conflict-Free Replicated Data Types
Open the chapter · 11 questions
- Important 1 — Why is "merge = add the two counter values" not a valid CvRDT merge, while "per-slot maximum" is?
- Important 2 — What does an operation-based CRDT need from the network that a state-based one does not?
- Important 3 — EU has a PN-Counter state
P{eu:3}, US hasP{us:2} N{us:1}. What is the value after they sync, and after a duplicate sync? - Good to know 4 — Ana removes "milk" from a shared list while Ben, offline, adds "milk". What does an add-wins OR-Set show after sync, and why, in terms of dots?
- Good to know 5 — When would you choose a remove-wins set over add-wins?
- Important 6 — A phone whose clock is 300 ms slow edits a title after syncing. With an LWW-Register, why can the edit be lost, and what one-line change prevents that?
- Good to know 7 — Why can an RGA not simply delete an element, and when may the tombstone be removed?
- Good to know 8 — Two users type " Alice" and " Charlie" at the same position. Which outcomes are acceptable, and which algorithms can produce an unacceptable one?
- Important 9 — Why does the Laravel sync endpoint lock the document row if the merge is conflict-free?
- Must-know 10 — A product owner wants a CRDT so that ticket sales never exceed capacity in any region. What do you answer?
- Good to know 11 — Is Figma's multiplayer a CRDT system?
Geospatial Indexing: Geohash, Quadtree, R-Tree
Open the chapter · 11 questions
- Must-know 1 — Why can two B-trees on latitude and longitude not answer a radius query efficiently?
- Important 2 — What is the boundary problem in geohash and how is it handled?
- Good to know 3 — Which Redis command replaces GEORADIUS and since which version?
- Important 4 — How does Redis store geo data, and how do you delete a member?
- Important 5 — Why does PostGIS recommend ST_DWithin over ST_Distance in a WHERE clause?
- Good to know 6 — What does the KNN operator do and how is it written?
- Good to know 7 — Compare geohash, S2 and H3 in one sentence each.
- Good to know 8 — Why is a quadtree not used as a disk index in databases?
- Important 9 — What is an MBR and why does it make R-tree search a filter step?
- Must-know 10 — How would you keep a million moving drivers searchable?
- Must-know 11 — Why is rounding coordinates not anonymisation?
Top-K & Heavy Hitters
Open the chapter · 10 questions
- Important 1 — Why is the top-k of the union of two streams not the union of their top-k lists?
- Good to know 2 — Size a Count-Min Sketch for epsilon 0.001 and delta 0.01. What are w, d and the memory with 4-byte cells?
- Important 3 — A Count-Min estimate says a key has 1,200 hits and N is 10 million at epsilon 0.0001. What can you conclude about its true count?
- Good to know 4 — In Space-Saving, what does the error stored with a counter mean, and how do you use it to block a source safely?
- Important 5 — Why does a Count-Min top-k need a heap?
- Important 6 — How do you implement "top 10 in the last hour, recent counts weigh more" in Redis?
- Good to know 7 — What does HeavyKeeper do differently from Count-Min when two flows collide in a bucket?
- Must-know 8 — When is an exact hash map better than any sketch?
- Important 9 — What belongs in the result table per window and why not just query Redis?
- Good to know 10 — Name two reactions to a detected hot key and the chapter that owns each.
Strangler Fig: Safe System Migration
Open the chapter · 11 questions
- Must-know 1 — Why must the facade be in place before the new code is ready?
- Must-know 2 — Why must a percentage rollout hash a stable key?
- Important 3 — Which requests may be shadowed, and why?
- Good to know 4 — Name two reasons a shadow diff is not zero that are not bugs.
- Must-know 5 — What goes wrong with dual write and what are the three mitigations?
- Important 6 — In what order should reads and writes move for one entity?
- Important 7 — When do you use branch by abstraction instead of a facade?
- Must-know 8 — What is the difference between a canary and a feature flag?
- Important 9 — List four things that must be deleted at decommission.
- Must-know 10 — Why is "100% of traffic on the new system" not a finished migration?
- Good to know 11 — Name an organisation that ended in a modular monolith, and one that started distributed.
Security Foundations: Why Systems Get Hacked, CIA Triad, Defense in Depth, STRIDE
Open the chapter · 12 questions
- Good to know 1 — Which three violation categories did Saltzer and Schroeder name, and which CIA property is each?
- Good to know 2 — Which STRIDE letters apply to a data flow, and why not R or E?
- Important 3 — A queue sits between the API and a worker. What new DFD elements does it add and which threats matter most?
- Must-know 4 — Why is a CVSS 9.8 in a dependency not automatically a 9.8 risk for you?
- Must-know 5 — Give two principles violated by an admin panel protected only by an unlisted URL.
- Must-know 6 — What separates defense in depth from simply buying more security products?
- Must-know 7 — Name a preventive, a detective and a corrective control against ransomware on the database.
- Important 8 — Why does the Go audit middleware delete X-Authenticated-Subject from incoming requests?
- Important 9 — What does Laravel's PreventRequestForgery check first, and what status do token and origin failures return?
- Important 10 — How does tokenising card numbers at the payment provider change PCI DSS?
- Good to know 11 — What does Sigstore record in Rekor, and why does that remove key management?
- Must-know 12 — Which design decisions make the first hour of an incident shorter?
Authentication: Passwords & Hashing, MFA, Sessions vs Tokens
Open the chapter · 10 questions
- Important 1 — Why does NIST SP 800-63B-4 forbid composition rules, and what does it require instead?
- Good to know 2 — You must choose Argon2id parameters for login pods with 512 MiB of memory that handle up to 20 concurrent logins. What do you pick?
- Good to know 3 — A user's bcrypt password is 80 characters long. What happens in PHP, in Go, and with Laravel's
bcrypt.limitset to 72? - Important 4 — Why does a dummy hash matter even if the error message is uniform? What breaks it in Laravel?
- Important 5 — A botnet tries "Winter2026!" once against each of 100,000 accounts from 20,000 IPs. Which control catches it?
- Important 6 — Write the rule a TOTP verifier needs to prevent replay, and where the state lives.
- Must-know 7 — Why is a passkey phishing-resistant while TOTP is not?
- Important 8 — What does refresh token reuse detection do when it sees a used token, and why does it punish the legitimate client too?
- Must-know 9 — List everything "log out everywhere" must revoke in a Laravel app with Sanctum and a mobile client.
- Must-know 10 — Which actions deserve step-up authentication, and how do you implement it with sessions?
JWT Deep Dive
Open the chapter · 11 questions
- Must-know 1 — A token's header says
{"alg":"HS256","kid":"rsa-2026-11"}and your JWKS has an RSA key with thatkid. What should happen and why? - Must-know 2 — Why is checking
audmandatory for a company with two APIs and one IdP, even though RFC 7519 marksaudoptional? - Important 3 — Your IdP publishes
Cache-Control: max-age=86400on its JWKS and rotates keys by swapping them. What breaks, and what do you change on both sides? - Important 4 — Name three ways to make "log out" effective before
exp, and the per-request cost of each. - Important 5 — Why should you not denylist
sha256(token)? - Must-know 6 — An SPA stores its access token in
localStorage. An XSS bug is found. What could the attacker do, and what design removes that class of theft? - Good to know 7 — What does
typ: at+jwtprotect against, and what do you do with an issuer that only emitstyp: JWT? - Good to know 8 — A token-exchange service mints 3,000 tokens per second with RS256. Estimate the signing CPU and suggest a fix.
- Important 9 — Laravel Passport revokes a token with
$token->revoke(). Will a separate Go service that verifies Passport tokens with the public key notice? - Good to know 10 — When is JWE worth it, and why must you still verify a signature after decrypting?
- Important 11 — Your verifier refetches the JWKS on every unknown
kid. What attack does this enable?
OAuth 2.0, OpenID Connect & Single Sign-On
Open the chapter · 12 questions
- Must-know 1 — What are the four OAuth roles, and which one does Laravel Passport play?
- Important 2 — Why does a confidential client still use PKCE?
- Important 3 — What exactly is
code_challengeforS256, and what does the AS return when the verifier does not match? - Important 4 — An attacker sends a victim a link to your callback with the attacker's own code. Which check stops it, and what must it be bound to?
- Good to know 5 — What does the RFC 9207
issparameter prevent, and when must the client require it? - Must-know 6 — Name five checks a relying party performs on an ID token.
- Must-know 7 — Why can't you reliably revoke a JWT access token, and what are the two usual answers?
- Important 8 — What happens at the AS when a rotated refresh token is presented a second time?
- Good to know 9 — Why does front-channel logout fail in modern browsers, and what replaces it?
- Important 10 — A SaaS uses Entra ID's multi-tenant endpoint. What must it check so that any Microsoft tenant cannot log in?
- Good to know 11 — What is the difference between impersonation and delegation in RFC 8693?
- Must-know 12 — Why is a BFF more secure than tokens in
localStorageeven though XSS can still call the API?
Authorization Models: RBAC, ABAC, ReBAC & Zero Trust
Open the chapter · 12 questions
- Must-know 1 — Why can a valid JWT still produce a 403?
- Good to know 2 — Which XACML component enforces a decision and which makes it?
- Important 3 — What is role explosion and two ways to reduce it?
- Good to know 4 — Static vs dynamic separation of duties?
- Good to know 5 — What does
doc:readme#viewer@group:eng#membermean? - Important 6 — What is the new enemy problem and what fixes it?
- Important 7 — Why is "list what I can see" harder than a check?
- Must-know 8 — How do OAuth scopes and permissions combine?
- Must-know 9 — Which three layers protect tenants?
- Important 10 — What does returning null from Laravel's Gate::before do?
- Good to know 11 — What are the NIST SP 800-207 ideas in one line each?
- Must-know 12 — Why must the PEP fail closed?
Cryptography in Practice: Symmetric vs Asymmetric, TLS/HTTPS, PKI, Encryption at Rest, Secrets
Open the chapter · 12 questions
- Must-know 1 — Why does TLS 1.3 use both asymmetric and symmetric cryptography, and which does what?
- Good to know 2 — A service encrypts 10,000 events per second under one AES-GCM key with random nonces. What limit applies and when is it reached?
- Important 3 — What is stored next to an envelope-encrypted value, and why each field?
- Important 4 — After rotating a KEK in AWS KMS, do you need to rewrap every DEK to keep reading old data?
- Must-know 5 — Which attacks does TDE stop and which does it not?
- Important 6 — Why is a blind index on a "country" column a bad idea?
- Good to know 7 — What changes on 15 March 2026, 2027 and 2029 for public TLS certificates?
- Important 8 — Why is pinning the leaf certificate in a mobile app risky, and what is the safer alternative?
- Must-know 9 — Why should an application not fall back to an environment variable when Vault returns 403?
- Important 10 — After setting a new APP_KEY and putting the old one in APP_PREVIOUS_KEYS, when can the old key be removed?
- Good to know 11 — What does a cosign keyless signature prove, and what must the verifier check?
- Important 12 — Why are dynamic database credentials better than a rotated shared password?
OWASP Top 10: Injection, XSS, CSRF and Friends
Open the chapter · 12 questions
- Must-know 1 — Why can a sort column not be passed as a bound parameter, and what do you do instead?
- Important 2 — What is second-order SQL injection, and why do "safe" inserts not prevent it?
- Must-know 3 — A page renders
<a href="USER_URL">. The template escapes HTML. Is it safe? - Important 4 — What does
strict-dynamicadd to a nonce-based CSP, and what does it cost? - Must-know 5 — Why does a hostname allowlist not stop SSRF on its own, and where must the IP check run?
- Important 6 — Your Laravel feature test for CSRF returns 200 instead of 419. Why?
- Good to know 7 — Give two reasons the 2025 list moved SSRF into A01.
- Must-know 8 — Two parallel requests redeem one coupon. Name a database-level fix that needs no lock.
- Must-know 9 — Why is
unserialize()on a cookie remote code execution even if your own classes are harmless? - Must-know 10 — An upload passes the extension check and has
Content-Type: image/png. List four further checks. - Must-know 11 — When does an API not need CSRF tokens?
- Important 12 — What is the difference between SAST, DAST and IAST in one sentence each?
DDoS Protection, Firewalls, VPCs & Network Segmentation
Open the chapter · 12 questions
- Must-know 1 — Why can a firewall on your server not stop a 100 Gbps UDP flood?
- Must-know 2 — What is the difference between reflection and amplification?
- Important 3 — How do SYN cookies avoid state?
- Important 4 — Which Go setting ends Slowloris, and why is
ReadTimeoutalone not ideal? - Must-know 5 — Why does a per-IP limit not stop a botnet, and what do you add?
- Must-know 6 — Define a public subnet in AWS.
- Important 7 — Name three differences between a security group and a network ACL.
- Important 8 — Why is VPC peering not enough for ten VPCs?
- Important 9 — What does egress filtering stop that ingress rules cannot?
- Important 10 — Why prefer SSM Session Manager to a bastion host?
- Good to know 11 — What does RTBH do and what does it cost you?
- Good to know 12 — What is economic denial of sustainability?
Mutual TLS & Securing Service-to-Service Traffic
Open the chapter · 12 questions
- Must-know 1 — Why is a source IP not an identity inside a cluster?
- Important 2 — What does the server check in
RequireAndVerifyClientCertand what does it not check? - Good to know 3 — Why must a SPIFFE X.509-SVID contain exactly one URI SAN?
- Important 4 — A fleet fails with
unknown certificate authorityright after you started issuing from a new CA. What went wrong? - Important 5 — Why do short-lived certificates usually remove the need for CRLs inside the mesh?
- Must-know 6 — What is the difference between
PERMISSIVEandSTRICTin Istio? - Important 7 — When is a service token with an audience better than mTLS?
- Must-know 8 — Why is
sslmode=requirenot enough for PostgreSQL? - Good to know 9 — Where can
VerifyPeerCertificatenot help in Go, and what do you use instead? - Important 10 — A certificate-based outage happens at 03:00 every 90 days. What is the likely cause and the fix?
- Important 11 — Why must the app trust
X-Forwarded-Client-Certonly when it is reachable solely through the proxy? - Must-know 12 — What should you monitor for a healthy mTLS estate?
Secure SDLC, DevSecOps, Logging, Incident Response, Compliance & Breaches
Open the chapter · 10 questions
- Important 1 — Name the control you would add at each of the eight lifecycle stages for a new payment webhook.
- Must-know 2 — Why is OIDC federation better than a stored cloud access key in CI?
- Important 3 — What does
govulncheckdo that a presence-based SCA scan does not? - Good to know 4 — Which two things must be true for a hash-chained audit log to detect tail truncation?
- Must-know 5 — What belongs in the "never log" column for an authentication event, and what goes there instead?
- Important 6 — When does the GDPR 72-hour clock start, and what if you miss it?
- Good to know 7 — Which Rev. 3 functions are preparation and which are the response?
- Good to know 8 — What detection failure made Okta's 2023 incident last longer, and how would you design against it?
- Important 9 — Why is a signed SolarWinds update not a counterexample to signing?
- Important 10 — How can an event-sourced system honour an erasure request?
OWASP API Security Top 10 (2023): BOLA, BOPLA, BFLA, Business Flows, Inventory, Unsafe Consumption
Open the chapter · 12 questions
- Must-know 1 — What is the difference between BOLA and BFLA, in one example each?
- Must-know 2 — Why is "compare the JWT subject with the id in the path" not a BOLA fix?
- Important 3 — Should a foreign object return 403 or 404, and what must the log say?
- Must-know 4 — Do UUIDs fix BOLA? What do they fix?
- Must-know 5 — Which two 2019 risks became API3 BOPLA, and what is the fix on each side?
- Important 6 — Why is
$guardedweaker than$fillable? - Important 7 — How do you make "admin route without a check" impossible rather than unlikely?
- Must-know 8 — A drop sells out to bots although every request was valid. Name four controls and their limits.
- Important 9 — What are shadow and zombie APIs, and how does OpenAPI help?
- Important 10 — List five things a client for a third-party API must do that
http.DefaultClientdoes not. - Good to know 11 — Why can an API gateway not fix BOLA and BOPLA on its own?
- Good to know 12 — Why were Injection and Insufficient Logging dropped from the 2023 API list, and does that mean they no longer matter?
API Security Hardening Checklist: Input, Output Headers, Processing, Monitoring, CI/CD
Open the chapter · 13 questions
- Important 1 — Why does
LimitBodypassinnermost(w)tohttp.MaxBytesReaderinstead ofw? - Must-know 2 — A
GETwithout aContent-Typeheader: 415 or not? And a chunkedPOSTwithout one? - Must-know 3 — What must a 405 response contain, and what are the two layers that produce it here?
- Important 4 — Why is HSTS not sent by the lab server, and how do you send it behind a TLS-terminating load balancer?
- Must-know 5 — Which
http.Serverfield stops slowloris, what does Go send when it fires, and how does that differ from Nginx? - Important 6 — What status does
http.TimeoutHandlersend, and why isWriteTimeoutnot a substitute? - Must-know 7 — Your API returns
{"error": "pq: password authentication failed for user orders_rw"}with status 200. List what is wrong. - Important 8 — Why can a JSON body of 20 KB still be dangerous, and which check catches it?
- Must-know 9 — The browser SPA needs cookies on cross-origin API calls. What exact CORS response does the preflight need, and what must never be in it?
- Must-know 10 — What should never appear in an access log line, and how do the Go and Laravel examples enforce it?
- Important 11 — Name the four kinds of CI security checks in this chapter and one tool for each.
- Good to know 12 — Why is a UUID in the URL not a fix for "Avoid user's personal ID in the resource URLs"?
- Good to know 13 — Where do
X-Frame-Options: DENYandframe-ancestors 'none'overlap, and why does this chapter send both?
Observability: Logs, Metrics, Traces and the Stack
Open the chapter · 12 questions
- Important 1 — Why can you not compute a service-wide p99 from per-pod summaries, and what do you do instead?
- Must-know 2 — A metric has labels method (5 values), route (40), code (12) and runs on 30 instances. How many series, and what happens if you add
user_idwith 100 000 values? - Important 3 — What are the four fields of
traceparentand what does the last one mean? - Good to know 4 — Why does tail sampling need a
load_balancingexporter in front of it? - Must-know 5 — Why is
rate(sum(http_requests_total)[5m])wrong? - Important 6 — When is the Pushgateway the right tool, and what are its pitfalls?
- Good to know 7 — In the Go middleware, why are exemplars attached only when the trace is sampled?
- Must-know 8 — What is the difference between utilization and saturation in the USE method? Give a PHP-FPM example of each.
- Important 9 — How does the trace id of an HTTP request reach a Laravel queued job in this chapter's code?
- Must-know 10 — Why should a liveness probe not check the database?
- Important 11 — Loki and Elasticsearch both store logs. What is the core design difference?
- Important 12 — Name three places to remove personal data from telemetry, from earliest to latest.
Alerting That Actually Works
Open the chapter · 12 questions
- Important 1 — Name the four properties Google SRE says a page must have and why "novel" matters.
- Important 2 — A service has a 99.9% SLO over 30 days. What error ratio triggers the fast-burn page and why?
- Important 3 — Why does a
for: 1hclause give worse results than a one-hour window with burn-rate threshold? - Good to know 4 — What does the short window add and why is it about 1/12 of the long window?
- Must-know 5 — Describe three ways Alertmanager reduces an alert storm.
- Important 6 — What is a dead man's switch and how is Prometheus' Watchdog an example?
- Must-know 7 — Why is
rate(errors) / rate(total) > xunsafe if a target stops reporting, and what do you add? - Good to know 8 — Give two metrics for pager fatigue and a target for each.
- Must-know 9 — How would you alert on a queue properly?
- Important 10 — What belongs in the alerting part of a postmortem?
- Must-know 11 — A team gets paged for a CPU alert every Monday morning. What is the sequence of actions?
- Important 12 — Why must the dead man's switch receiver live outside the system it watches?
Chaos Engineering & Game Days
Open the chapter · 10 questions
- Must-know 1 — What is the difference between steady state and "no errors"?
- Important 2 — Why does a hypothesis need a control group?
- Important 3 — When is the verdict INVALID?
- Important 4 — Abort condition vs kill switch?
- Good to know 5 — Why is
kill -STOPa better test thankill -9for some systems? - Important 6 — Name three safety properties of application-level injection.
- Important 7 — What does a tabletop exercise test that a live test does not?
- Good to know 8 — How does
Http::sequence()help rehearsal? - Must-know 9 — What must exist before a production experiment?
- Must-know 10 — What does MTTR measure in a game day?
Containers & Kubernetes: Fundamentals, Scaling, Self-Healing, Services & Ingress
Open the chapter · 12 questions
- Must-know 1 — What exactly isolates a container from its neighbours, and what does it still share?
- Must-know 2 — Why does deleting a secret file in a later Dockerfile step not protect it?
- Important 3 — The control plane is down for ten minutes. What keeps working and what does not?
- Important 4 — A Deployment has 10 replicas and default strategy. What are the most pods and the fewest ready pods during a rollout?
- Must-know 5 — Why is checking PostgreSQL in a liveness probe harmful?
- Important 6 — What must hold for a pod to be Guaranteed, and why does it matter?
- Must-know 7 — Your pods get 502s for a few seconds on every deploy. What is happening and what is the fix?
- Must-know 8 — A pod shows CrashLoopBackOff with 7 restarts. Where do you look and how long until the next attempt?
- Important 9 — Why does a
kubectl drainhang on a single-replica Deployment withminAvailable: 1? - Important 10 — When does KEDA beat a CPU-based HPA for Laravel queue workers?
- Good to know 11 — Why prefer Gateway API over Ingress for a new cluster?
- Must-know 12 — When should you not use Kubernetes?
Service Mesh & the Sidecar Pattern
Open the chapter · 12 questions
- Good to know 1 — What turns an init container into a Kubernetes sidecar, and what does that change for startup, shutdown and Jobs?
- Must-know 2 — Is the control plane in the request path? What happens if Istiod is down?
- Good to know 3 — Name the xDS resource types and what each carries.
- Important 4 — Why can a pod fail to start in a namespace with restricted Pod Security under Istio, and what is the fix?
- Good to know 5 — In ambient mode, which component does mTLS and which does L7 routing?
- Must-know 6 — A VirtualService sets
attempts: 3, the app also retries three times. How many calls can one user request cause, and what do you change? - Important 7 — You applied a DestinationRule and requests to the service now return 503 flag
UF. What is the likely cause? - Must-know 8 — Why do traces break between two services even with a mesh, and how do you fix it?
- Important 9 — What does an Istio AuthorizationPolicy do if no ALLOW policy exists for a workload? What if one exists but nothing matches?
- Good to know 10 — Why does MySQL through an Istio sidecar need an explicit port name?
- Must-know 11 — When is a mesh not justified?
- Important 12 — What must a handler do when the mesh may replay its request?
Serverless & Event-Driven Compute
Open the chapter · 10 questions
- Must-know 1 — A function handles 300 requests per second with an average duration of 150 ms. What is its concurrency, and what does that mean for a 1,000 account limit?
- Must-know 2 — Why does a handler that throws on one bad SQS message cause good messages to be processed twice?
- Important 3 — Where do you configure the DLQ for failed SQS-triggered invocations?
- Must-know 4 — What should the visibility timeout be relative to the function timeout, and what happens otherwise?
- Important 5 — Name three ways to remove or reduce cold starts on Lambda and a limit of each.
- Important 6 — Why is
MessageIda poor idempotency key? - Must-know 7 — A spike makes the database fail with too many clients. What are your two fixes?
- Important 8 — When do you choose Step Functions Standard over Express?
- Good to know 9 — At what point does serverless become more expensive than an instance?
- Important 10 — Why can a FIFO queue limit your concurrency?
Capacity Planning, Failure Scenarios & Disaster Recovery
Open the chapter · 10 questions
- Important 1 — Why is N+1 across three zones 50% more capacity, not one extra server?
- Must-know 2 — What do you need to measure before sizing a fleet?
- Must-know 3 — Why is replication not a backup?
- Must-know 4 — Define RPO and RTO and give each a measurement.
- Important 5 — Which DR strategy fits RPO 30 s and RTO 5 minutes?
- Good to know 6 — What is the worst-case DNS failover time with 10 s checks, 3 failures, TTL 60 s and 120 s overrun?
- Important 7 — Why use a separate account and Object Lock for backups?
- Important 8 — Why fence the old primary before promoting?
- Good to know 9 — How does a Kafka consumer fail over with MirrorMaker 2?
- Must-know 10 — What does a restore drill check?
Payment Processing Architecture: Idempotency, Fraud Detection, PCI
Open the chapter · 12 questions
- Must-know 1 — Why must money never be stored as a float, and what do you store instead?
- Must-know 2 — Your call to the PSP times out. What do you do, and what must you never do?
- Must-know 3 — How do you derive the idempotency key you send to the PSP, and why not a fresh UUID per call?
- Must-know 4 — What is the difference between void and refund, and when is each the compensation in a checkout saga?
- Must-know 5 — List what a webhook handler must do, in order.
- Important 6 — Why does a payment system need a double-entry ledger instead of a balance column?
- Important 7 — Stripe sends
payment_intent.processingafterpayment_intent.succeeded. What happens in your system? - Important 8 — How does the outbox give an exactly-once effect when delivery is only at least once?
- Important 9 — What does reconciliation catch that webhooks do not?
- Important 10 — How does accepting cards in a PSP iframe change your PCI DSS scope, and what still applies?
- Good to know 11 — A medium-risk payment arrives: score 70, card supports 3DS. What does the risk engine do, and why not block?
- Good to know 12 — A renewal fails with
stolen_card; another withinsufficient_funds. What does dunning do with each?
Search Systems: Scoring, Elasticsearch, Typeahead, Personalization & ML Ranking
Open the chapter · 12 questions
- Must-know 1 — Why can an inverted index answer "running AND shoe" without reading any document?
- Must-know 2 — A product indexed with a 201 response is not found by a search 300 ms later. Why, and what are the fixes?
- Important 3 — Write the BM25 term weight and explain k1 and b.
- Good to know 4 — How does BM25F differ from summing per-field BM25 with boosts?
- Important 5 — What must a Persian analyzer do about ZWNJ and Arabic letters?
- Important 6 — Why should edge n-grams not be used in the search analyzer?
- Important 7 — Why are raw clicks poor training labels, and what is one correction?
- Good to know 8 — Compute NDCG@2 for grades [1, 3] with gain 2^rel - 1.
- Important 9 — Why use RRF instead of averaging BM25 and cosine scores?
- Important 10 — How do you change a text field to keyword without downtime?
- Must-know 11 — What makes a typeahead endpoint meet a 100 ms budget?
- Good to know 12 — When should a SaaS use one index per tenant?
ML Systems: Deployment Patterns, Feature Stores, Model Serving, Vector Databases
Open the chapter · 11 questions
- Good to know 1 — Name four of the debt items from Sculley et al. and the architectural fix for each.
- Must-know 2 — What is the difference between training-serving skew and data drift?
- Important 3 — Why does an online store keep only the latest value per entity key, and where does history live?
- Good to know 4 — A label row is at 15:00. Feature rows exist at 12:00 (written 12:00) and 14:00 (written the next day). TTL is 4 hours. What does a point-in-time join return with and without the created-timestamp filter?
- Important 5 — Your canary of a new ranker is healthy. Can you promote it?
- Important 6 — How does Triton's
max_queue_delay_microsecondsaffect latency and throughput? - Must-know 7 — Why must a prediction cache key include the model version?
- Important 8 — A pgvector query with
WHERE category_id = 12returns 4 rows instead of 10. Why, and what are two fixes? - Good to know 9 — What does prefix caching require from your prompt design?
- Important 10 — Labels for your fraud model arrive 30 days late. What do you monitor in the meantime?
- Must-know 11 — In the worked design, why two stages (retrieval then ranking)?
Feeds: Fan-Out on Write vs Read, Fan-In Aggregation
Open the chapter · 10 questions
- Important 1 — Why is write amplification a problem for push and what bounds it?
- Important 2 — How does a k-way merge produce a page without sorting everything?
- Must-know 3 — Why is
OFFSETwrong for infinite scroll? - Must-know 4 — What does the hybrid model do at read time?
- Important 5 — How do you propagate a delete?
- Good to know 6 — What is the role of
ZREMRANGEBYRANKin a feed? - Important 7 — What happens when the fan-out queue is full?
- Must-know 8 — Name three metrics that show feed health.
- Good to know 9 — Why does LinkedIn choose fan-out on read?
- Important 10 — Which source decides a feed's p99?
Case Study: Uber — Location, Driver Tracking, Matching, Pricing, Trip Storage
Open the chapter · 12 questions
- Must-know 1 — Why does the 2016 Ringpop post say database storage is useless for live driver locations?
- Important 2 — How did the 2015 dispatch design survive a datacenter failure without replicating data across datacenters?
- Good to know 3 — Name the two Uber uses of cells and which grid each source names.
- Important 4 — Why can DISCO beat "nearest idle driver"?
- Must-know 5 — What are Ringpop's three parts?
- Important 6 — How does a Schemaless update work if cells are immutable?
- Important 7 — What is a buffered write and what does it trade away?
- Good to know 8 — Give two of Uber's 2016 arguments against Postgres and the matching critique.
- Important 9 — Why did Uber choose SSE in 2015, and what did gRPC add later?
- Good to know 10 — How does surge survive a region failure according to the 2020 Kafka post?
- Good to know 11 — What problem did DOMA solve and with which four ideas?
- Must-know 12 — Which parts of this page are inference rather than Uber's published design?
Case Study: Netflix
Open the chapter · 12 questions
- Important 1 — Why does an OCA not need to know about other OCAs?
- Important 2 — What two deployment types does Open Connect use and who provides what in the embedded one?
- Must-know 3 — Why fill during off-peak windows rather than on demand?
- Important 4 — What problem did per-title encoding solve that the fixed ladder had?
- Good to know 5 — Why did per-shot encoding need "collation" and "checkpoints"?
- Important 6 — What are Zuul 2's three filter types?
- Important 7 — In GraphQL federation, what does the Schema Registry do and what does the gateway do?
- Good to know 8 — Write the gradient limit update and say why the queue term is the square root.
- Good to know 9 — What made Nimble's 8-minute evacuation possible?
- Important 10 — How does EVCache stay correct across two active regions?
- Important 11 — Why does Kayenta create a new baseline cluster?
- Must-know 12 — Which claims on this page are inference?
Case Study: Amazon
Open the chapter · 11 questions
- Must-know 1 — Why did the shopping cart need an "always writeable" store, and what did Amazon give up for it?
- Must-know 2 — What is the difference between a strict quorum and Dynamo's sloppy quorum?
- Important 3 — What do Merkle trees add that hinted handoff does not?
- Good to know 4 — Name three ways DynamoDB differs from the 2007 Dynamo design.
- Good to know 5 — Why did DynamoDB replace adaptive capacity with global admission control?
- Important 6 — Why does item-to-item collaborative filtering scale better than user-based filtering?
- Important 7 — Eight workers, two per customer. How many shuffle shards are there, and what happens to a customer who shares one worker with a poisoned customer?
- Must-know 8 — With three AZs and static stability, how much capacity do you run, and why?
- Must-know 9 — What went wrong with the cache-to-database fallback in the Builders' Library article?
- Must-know 10 — Put these deployment stages in order and say what each catches: one-box, gamma, wave 1, bake time.
- Important 11 — Which claims on this page are inference, and why does that matter?
Case Study: WhatsApp
Open the chapter · 11 questions
- Important 1 — Why did WhatsApp's per-server connection count go from 200k to 2M without a new language or new hardware?
- Must-know 2 — What exactly do two gray check marks promise the sender?
- Important 3 — How can Alice start an encrypted session with Bob while Bob is offline?
- Important 4 — Why does a 200-member group not cost 200 encryptions per message?
- Important 5 — What happens when a member leaves a group, and why?
- Good to know 6 — What is client-fanout and when does WhatsApp use it?
- Good to know 7 — How does the server help when the sender forgot one of the recipient's new devices?
- Must-know 8 — Why can a CDN serve WhatsApp media without breaking end-to-end encryption?
- Important 9 — With a password-protected E2EE backup, what does WhatsApp know?
- Important 10 — Name three abuse signals that need no message content.
- Must-know 11 — Which statements on this page about the data-centre migration are published, and which are inference?
Case Study: X / Twitter
Open the chapter · 12 questions
- Must-know 1 — Why did Twitter precompute home timelines instead of querying on read?
- Good to know 2 — What does
RPUSHXchange compared withRPUSH? - Must-know 3 — Why do high-follower accounts break pure fan-out on write?
- Must-know 4 — How does the hybrid read path assemble a home timeline?
- Important 5 — What are the fields of a Snowflake id and their widths?
- Good to know 6 — What does "k-sorted" mean for Snowflake?
- Important 7 — Why did Snowflake become necessary when tweets moved to T-Bird?
- Important 8 — What property did Gizzard and FlockDB require of writes, and why?
- Important 9 — What consistency did Manhattan choose by default and what is opt-in?
- Good to know 10 — Name the stages of the 2023 For You pipeline.
- Important 11 — Why did Twitter move from EventBus to Kafka?
- Must-know 12 — Which claim on this page is labelled inference and why?
Case Study: YouTube & Video Streaming
Open the chapter · 12 questions
- Must-know 1 — A client's upload dropped. What exact request does it send next, and what does the response tell it?
- Important 2 — Why does the YouTube guide discourage chunked uploads, and when are they still useful?
- Must-know 3 — From "500 hours per minute", estimate daily upload hours and average ingress at 8 Mbit/s source bitrate.
- Important 4 — What trade-off made YouTube build the VCU?
- Good to know 5 — Name the two stages of the 2016 recommendation system and their input/output sizes.
- Important 6 — Why rank for watch time rather than click-through rate, and what did it cost?
- Must-know 7 — A creator says the view count froze. What does YouTube's own documentation say?
- Good to know 8 — How does Procella serve view counts to watch pages?
- Important 9 — Which ingest protocol would you choose for a 4K HDR concert, and which for a Q&A with live chat?
- Important 10 — What does Google Global Cache change for an ISP?
- Important 11 — What are Content ID's three claim actions, and who may use it?
- Must-know 12 — Which parts of this page are inference, and why does it matter?
Case Study: OpenAI
Open the chapter · 10 questions
- Good to know 1 — Which component limited the 2018 cluster after 500 nodes, and what was the first fix?
- Good to know 2 — What stopped etcd writes at about 1,000 nodes and what did the autoscaler do?
- Important 3 — Why did EndpointSlices matter?
- Must-know 4 — Why does gang scheduling exist for these jobs?
- Important 5 — How does OpenAI scale PostgreSQL without sharding it?
- Must-know 6 — What was the root cause of the March 2023 data exposure?
- Good to know 7 — Why did the December 2024 outage last 4 hours 22 minutes?
- Important 8 — What does the docs rule "Retry-After is a minimum" imply for a client?
- Important 9 — Why can prompt caching fail after a small prompt edit?
- Must-know 10 — Name one claim on this page that is inference.
Case Study: LinkedIn
Open the chapter · 10 questions
- Important 1 — Why did the NetDB paper prefer pull over push?
- Important 2 — What does Databus do for a consumer that is too far behind?
- Must-know 3 — Name two reasons FollowFeed chose fan-out on read.
- Good to know 4 — Why 720 partitions?
- Important 5 — Why is Pinot a derived store?
- Important 6 — What orders racing cache writers in the profile cache?
- Good to know 7 — What is D2?
- Good to know 8 — What does the forward index in Cleo do?
- Must-know 9 — What is inference in this chapter?
- Important 10 — Why not pre-materialise second-degree connections?
Case Study: Discord
Open the chapter · 10 questions
- Must-know 1 — Why did Discord bucket messages by time when Cassandra allows 2 GB partitions?
- Important 2 — What problem does request coalescing solve that a TTL cache does not, and why does it need routing?
- Important 3 — The Read States service in Go was fast on average. What exactly was wrong, and what did the Go-side mitigation cost?
- Good to know 4 — What do Manifold and FastGlobal each optimise?
- Must-know 5 — Give two reasons Discord routes voice through its own servers rather than peer-to-peer.
- Important 6 — Why did a single Elasticsearch node failure fail about 40% of bulk index operations, and how was it fixed?
- Important 7 — During the 2023 authentication outage, what did engineers switch off first, and why those features?
- Good to know 8 — What are passive sessions and how much did they save?
- Good to know 9 — Name the trigger and the amplifier of the March 2026 voice outage.
- Important 10 — In an interview, which statements about Discord must you label as inference?
Case Study: Ticketing System (end-to-end 4-step walkthrough)
Open the chapter · 12 questions
- Must-know 1 — Why is the estimate for this problem mostly about the edge and contention rather than database throughput?
- Must-know 2 — Two buyers select overlapping pairs of seats. What two rules stop a deadlock and a long pile-up?
- Must-know 3 — When is
SKIP LOCKEDthe right tool and when is it wrong? - Important 4 — The sweeper has been down for ten minutes. Are expired seats unsellable?
- Important 5 — Why does the design not rely on Redis keyspace notifications to release holds?
- Must-know 6 — A payment succeeds 20 minutes after checkout, after the hold expired and the seats were sold to someone else. What happens?
- Must-know 7 — What does the idempotency fingerprint protect against that the key alone does not?
- Important 8 — Why randomise the pre-queue instead of ordering by arrival?
- Important 9 — Why sign QR tickets with Ed25519 rather than HMAC?
- Important 10 — A ticket is resold. How does the gate reject the seller's old screenshot while offline?
- Important 11 — Redis is lost mid-sale in the Redis-gate variant. What breaks?
- Must-know 12 — Why partition seats by event rather than by seat?
DDD & Microservices
Why DDD: Business & Technical Perspectives of Microservices, Adoption, Business Model Canvas
Open the chapter · 11 questions
- Must-know 1 — What does DDD try to reduce, and where does that cost usually hide?
- Must-know 2 — Which half of DDD matters first, and why?
- Must-know 3 — Define domain and model in Evans's words.
- Must-know 4 — Give two business reasons for microservices and two reasons the business may not need them.
- Important 5 — What is the microservice premium?
- Important 6 — When is DDD-lite enough?
- Important 7 — Which canvas blocks point to the core subdomain?
- Good to know 8 — How do Wardley stages guide sourcing?
- Must-know 9 — Name three prerequisites for DDD.
- Good to know 10 — Which three signals would you track?
- Must-know 11 — Is "capability = context = service" true?
Domains, Subdomains (Core, Supporting, Generic) & Domain Experts
Open the chapter · 12 questions
- Must-know 1 — Name the domain and three subdomains of a food-delivery app.
- Must-know 2 — Why is Billing in the running example supporting even though the company cannot run without it?
- Must-know 3 — Give two reasons why subdomains and bounded contexts are not always 1:1.
- Important 4 — In what order does Khononov's categorisation ask its questions, and why does the order matter?
- Important 5 — What does a complex supporting subdomain tell you?
- Good to know 6 — What are the axes of a Core Domain Chart, and who should score each?
- Good to know 7 — Give an example of a core subdomain becoming supporting or generic.
- Important 8 — What is a Domain Vision Statement and how long is it?
- Important 9 — How do highlighted core and segregated core differ?
- Important 10 — Why is a product owner a risky sole source for core rules?
- Must-know 11 — How do you enforce "the core never depends on vendor SDKs" in Go and in Laravel?
- Good to know 12 — When is building a "commodity" in-house still right?
Ubiquitous Language
Open the chapter · 10 questions
- Must-know 1 — What does "ubiquitous" mean in "ubiquitous language", and where does the ubiquity end?
- Must-know 2 — Why does translation between experts' words and code names hurt the model?
- Important 3 — Give three meanings of "Customer" in an online shop and name the contexts.
- Must-know 4 — Why is
OrderUpdateda weak event name, and what is better? - Must-know 5 — What is wrong with a class named
OrderManagerin the domain layer? - Important 6 — How do you handle a legacy table
tbl_ord(st int)without leaking it into the domain? - Important 7 — How should a Persian-speaking business team with an English codebase manage terms?
- Important 8 — How do you evolve the language when the business renames "Client" to "Customer"?
- Good to know 9 — How does a glossary lint test work and what does it catch?
- Good to know 10 — How do you test whether the language works for a newcomer?
Bounded Context: Discovering and Drawing the Lines
Open the chapter · 12 questions
- Must-know 1 — State Evans's definition of a bounded context and name its three parts.
- Important 2 — Give one example each of n subdomains : 1 context and 1 subdomain : n contexts from the running example.
- Must-know 3 — Why is "a bounded context is a microservice" wrong, and what does Khononov say instead?
- Important 4 — What is a pivotal event and why does it hint at a boundary?
- Good to know 5 — Name the canvas sections.
- Must-know 6 — Sales has
Customer{segment, tier}, Fulfilment hasRecipient{address, phone}. Is this duplication a problem? - Important 7 — List three signals of a wrongly drawn line.
- Important 8 — A rule needs Sales orders and Billing credit limits in one transaction. What do you do?
- Must-know 9 — How does Go enforce the model boundary, and what does it not enforce?
- Must-know 10 — Why are cross-context Eloquent relationships forbidden?
- Important 11 — What does Evans mean by Continuous Integration inside a bounded context?
- Important 12 — Why is "UserContext" an anti-pattern?
Context Maps & Integration Patterns: Partnership, Shared Kernel, Customer-Supplier, Conformist, ACL, OHS/PL, Separate Ways
Open the chapter · 12 questions
- Must-know 1 — What does a context map show that an architecture diagram does not?
- Must-know 2 — Billing calls a Fulfilment API to fetch delivery dates. Who is upstream?
- Good to know 3 — Why does Evans warn against giving the customer veto power in Customer-Supplier?
- Important 4 — Name three things that may go into a shared kernel and three that should not.
- Must-know 5 — When is Conformist the right choice?
- Important 6 — What are the three parts of an ACL, and what does each do?
- Important 7 — Why should an internal domain model not be used as the published language?
- Good to know 8 — An OHS consumer needs XML instead of JSON. What does Evans advise?
- Good to know 9 — Which combinations does Context Mapper reject, and why?
- Important 10 — How do you show and then remove a shared-database edge?
- Important 11 — In a modular monolith, what plays the role of OHS and PL?
- Important 12 — What is the usual next step for a Conformist edge that starts to hurt?
Entities & Value Objects
Open the chapter · 11 questions
- Must-know 1 — What single question decides entity vs value, and who answers it?
- Good to know 2 — Quote Evans on what an entity's model must define.
- Important 3 — Why is an application-generated UUIDv7 often better than an auto-increment id for an
Order? - Important 4 — Name the PHP 8.4 and Go techniques that make a value immutable.
- Important 5 — Why does
MoneyhaveAllocatebut noDivide? - Good to know 6 — Give two reasons a Go value object containing
time.Timemay compare unequal for the same instant. - Good to know 7 — Does Unicode NFKC make "۰۹۱۲" equal to "0912"?
- Must-know 8 — When is
OrderLinea value and when an entity? - Important 9 — Name the four persistence options for value objects and one weakness of each.
- Important 10 — Why should an API not return the domain
Moneyobject's internal serialisation? - Important 11 — When is it acceptable to use an Eloquent model as the entity?
Aggregates & Factories
Open the chapter · 11 questions
- Must-know 1 — What three things does one aggregate define at once?
- Important 2 — Name Vernon's four rules in his words.
- Important 3 — Why did Joe's commit fail in Vernon's Product example, and what is the lesson?
- Must-know 4 — "An order cannot be dispatched unpaid." Transactional or eventual, and how is it enforced in our design?
- Must-know 5 — Two clients add a line to an order with 19 lines at the same time. What makes sure the order does not end with 21?
- Important 6 — Why must the retry loop reload the aggregate instead of saving again?
- Good to know 7 — Give two of the four reasons Vernon accepts for modifying several aggregates in one transaction.
- Important 8 — What is the difference between
OrderFactory::fromCart()andOrderRecord::factory()? - Important 9 — Why must
reconstitute()not recordOrderPlaced? - Important 10 — Your
Customeraggregate conflicts constantly at peak and takes 800 ms to load. What do you do? - Good to know 11 — In a sharded database, what should the shard key of the
ordersandorder_linestables be, and why?
Anemic vs Rich Domain Models
Open the chapter · 10 questions
- Must-know 1 — State Fowler's objection to anemic models in one sentence and the fair reply.
- Good to know 2 — Name the four logic patterns and the subdomain each fits.
- Must-know 3 — Why is
if order.Status == "dispatched"in three files a design smell? - Must-know 4 — What does "make illegal states unrepresentable" mean for
StatusandTotal? - Must-know 5 — Why can the rich
Orderbe unit tested with no store, while the anemic one cannot? - Important 6 — List three ways Strategy 1 (rich Eloquent) can be bypassed.
- Must-know 7 — In Go, what plays the role of
private? - Important 8 — What is the first step of the refactoring and why?
- Must-know 9 — Where do the transaction and the event publication belong?
- Important 10 — Which two numbers measure whether a model is rich?
Repositories: Collections of Aggregates, Not Table Gateways
Open the chapter · 11 questions
- Must-know 1 — Why is there no
OrderLineRepository? - Important 2 — What is the difference between a collection-oriented and a persistence-oriented repository, and which fits Go?
- Must-know 3 — Why should
Savenot commit? - Important 4 — How does
Savedetect a concurrent change? - Important 5 — Does
DB::transaction($cb, attempts: 3)retry a version conflict? - Important 6 — Why use a separate
Reconstituteinstead of the constructor? - Good to know 7 — When is Eloquent-as-the-aggregate acceptable?
- Important 8 — Why a fake plus a contract test rather than a mock?
- Must-know 9 — Where does "page 3 of the order list" belong?
- Must-know 10 — Why must a repository never call another context's repository?
- Must-know 11 — How does an event recorded by the aggregate reach a broker safely?
Domain, Application & Infrastructure Services
Open the chapter · 11 questions
- Must-know 1 — Why is "calculate the order total with promotions and loyalty tier" a domain service and not a method on
Order? - Must-know 2 — Read this line in an application service:
if ($tier === 'gold') $total = intdiv($total * 95, 100);. What is wrong and where does it go? - Important 3 — Why does
PlaceOrderHandlercallPaymentGateway.Authorizebefore opening the transaction rather than inside it? - Important 4 — Two identical requests with the same
Idempotency-Keyarrive at the same moment. Both pass the "already exists?" check. What happens, and why must the loser not void the payment? - Must-know 5 — Where is the port
OrderRepositorydeclared, and where isPaymentGatewaydeclared? Why the difference? - Important 6 — Name two driving adapters and three driven adapters in the Laravel example.
- Must-know 7 — What is the difference between a command handler and a query handler in this chapter?
- Important 8 — Why is
ShouldDispatchAfterCommitnot a full replacement for the outbox? - Important 9 — Is
Cache::remember(...)inside an Eloquent model's business method a problem? What about inside an adapter? - Must-know 10 — How do you test each kind of service most cheaply?
- Important 11 — When Sales becomes a microservice and Billing owns payments, what happens to the
PaymentGatewayport?
Domain Events vs Integration Events
Open the chapter · 12 questions
- Must-know 1 — Name four properties of a domain event.
- Must-know 2 — Why not publish the domain event class directly to the broker?
- Must-know 3 — A listener sends an email when
OrderPlacedis dispatched insideDB::transaction, and the commit fails. What happened and how do you fix it? - Good to know 4 — When is it acceptable to run a domain event handler before commit, in the same transaction?
- Important 5 — Where is the integration event written, and why there?
- Good to know 6 — Give an example of one domain event producing zero, one and two integration events.
- Important 7 — What is the difference between event notification and event-carried state transfer?
- Important 8 — Which CloudEvents attributes are required, and how does a consumer detect duplicates?
- Important 9 — What do correlation id and causation id record?
- Important 10 — Why is
OrderObserver::updateda poor source of business events in Laravel? - Must-know 11 — Your team publishes events and stores orders in tables. Are you event-sourced?
- Important 12 — Who owns
sales.order.placed.v1, and how does Billing protect itself against breaking changes?
Event Storming: Elements, Preparing and Running the Workshop
Open the chapter · 12 questions
- Must-know 1 — Why does Event Storming start with events and not with entities or classes?
- Important 2 — Name the three flavours and one question each answers.
- Good to know 3 — Write the full grammar of the wall in one sentence.
- Must-know 4 — What is the difference between a policy and an invariant?
- Important 5 — Why do people write events alone and silently in the first phase?
- Important 6 — How do pivotal events help to find bounded contexts, and why are swimlanes a weak guide?
- Important 7 — List four things a facilitator does and three they must not do.
- Important 8 — Which outputs go to the Bounded Context Canvas, and which go to the backlog?
- Good to know 9 — Map each sticky colour to a code artifact in Go or Laravel.
- Must-know 10 — Why must a policy be idempotent?
- Important 11 — What changes when you run it remotely?
- Important 12 — Name three common failures and their fixes.
Data Patterns: Shared Database, Database per Service, CQS → CQRS, Read-Side Replication
Open the chapter · 12 questions
- Must-know 1 — Name the two capabilities a single database gives you that disappear with database per service, and the pattern that replaces each.
- Must-know 2 — Billing only reads
sales.orders. Why is that still a shared-database problem? - Good to know 3 — Which three granularities does Richardson list for keeping data private, and which two are cheapest?
- Important 4 — Does
func (h Handler) Handle(cmd PlaceOrder) (Ack, error)withAck{OrderID, Version}violate CQS? - Must-know 5 — Per Young, what is CQRS itself, and what is it not?
- Important 6 — When does Fowler say CQRS is not worth it, and what does he suggest instead for heavy queries?
- Important 7 —
ParcelDispatchedarrives beforeOrderPlaced. What two design choices keep the projector correct? - Must-know 8 — Why must the dedup insert and the read-row update be in the same transaction, and when do you ack?
- Important 9 — Why does the read side keep
received_eventsinstead of rebuilding from Fulfilment's and Billing's databases? - Must-know 10 — A user places an order and the list does not show it. List four strategies and the one you would use by default.
- Good to know 11 — Which replication option keeps ownership and lets you reshape the copy freely?
- Important 12 — A product deleted on the write side reappears in search an hour later. Name the cause and the fix.
Designing for Failure & Reliable Messaging in Microservices
Open the chapter · 11 questions
- Important 1 — List the eight failures a context must assume and give one defence for each.
- Must-know 2 — Why can a crash between
COMMITandbroker.Publishnot be fixed with a try/catch? - Must-know 3 — The relay published a message and crashed before marking it sent. What happens, and who handles it?
- Must-know 4 — Why must the inbox row and the business effect share one transaction?
- Important 5 — Why is the broker offset a bad dedup key?
- Good to know 6 — What is the difference between a compensation and a rollback, and why must compensations be commutative with their forward steps?
- Important 7 — Billing does not answer. What does the saga do, and what happens if Billing answers after the cancel?
- Must-know 8 — When is choreography enough, and when do you orchestrate?
- Must-know 9 — A poison message arrives. Name three wrong reactions and the right one.
- Important 10 — Why is "Sales returns an error while Billing is down" a product decision?
- Must-know 11 — Where do timeouts and circuit breakers live in a DDD context?
API Realization: REST Resources & Constraints, API Management, GraphQL Schemas
Open the chapter · 12 questions
- Important 1 — In DDD terms, what are an Open Host Service and a Published Language, and how do they relate to your OpenAPI file?
- Must-know 2 — Why is
json.Marshal(order)from a handler a design error even when the JSON looks right? - Important 3 — Give two reasons to prefer
POST /orders/{id}/placementoverPATCH /orders/{id}with a status field. - Must-know 4 — A client's
POSTtimes out and it retries. How do you prevent a second cancellation request? - Important 5 — What do
ETag,If-Match,412and428give you, and where do they map in the aggregate? - Must-know 6 — When do you return
202 Acceptedand what must the response contain? - Important 7 — Why are keyset cursors preferred over
?page=7, and what doeslimit + 1do? - Must-know 8 — Name three changes that are additive and three that break consumers.
- Important 9 — In GraphQL, where do you report "the order is already placed" and why?
- Important 10 — Six
OrderLine.productfields are requested in one query. How many Catalog calls should happen, and what makes it so? - Must-know 11 — What can an API gateway enforce, and what must the Sales service still check itself?
- Important 12 — Which tests make breaking a promise to a consumer fail the build?
Databases
SQL Querying Fundamentals: Relations, NULL, Joins, GROUP BY & HAVING, Subqueries, Set Operations, CTEs
Open the chapter · 13 questions
- Must-know 1 — Why does
SELECT * FROM customers WHERE country <> 'DE'not return customers whose country is NULL? - Must-know 2 —
WHERE id NOT IN (SELECT referred_by FROM customers)returns no rows, although some customers referred nobody. Why, and what do you write instead? - Must-know 3 — Why does a
LEFT JOINreport suddenly miss customers with no paid orders after someone addedWHERE o.status = 'paid', and how do you fix it? - Must-know 4 — What is the logical evaluation order of a
SELECT, and why can't you use a select alias inWHERE? - Must-know 5 — What is the difference between
count(*),count(coupon_code)andcount(DISTINCT coupon_code), and what doessum(total)return for zero rows? - Important 6 —
SELECT customer_id, status, sum(total) FROM orders GROUP BY customer_idworks on SQLite and fails on MySQL 8.4 and PostgreSQL. Why, and when is a non-grouped column allowed? - Important 7 — When do you use
WHEREand whenHAVING? - Important 8 — Why is
UNION ALLusually the better default thanUNION, and how do set operations treat NULL? - Important 9 — How does a recursive CTE execute, and how do you stop it from looping forever?
- Important 10 — A scalar subquery returns two rows. What happens in PostgreSQL, MySQL and SQLite?
- Good to know 11 — Where do NULLs appear in
ORDER BY countryon PostgreSQL, MySQL and SQLite, and how do you make it portable? - Good to know 12 — How do you get the generated id of an inserted row in PostgreSQL, SQLite and MySQL from Go?
- Must-know 13 — What is the difference between a semi-join and an inner join, and why does it matter?
Database Internals: Pages, Heap, Tuples & I/O
Open the chapter · 11 questions
- Must-know 1 — Why does reading a single 40-byte row in PostgreSQL cost at least 8 KB of I/O?
- Good to know 2 — What do
pd_lowerandpd_uppertell you? - Important 3 — A row has
ctid (0,1). AfterUPDATEof a non-indexed column with room on the page, what is itsctid, and what does the primary-key index point to? - Important 4 — Name the two conditions for a HOT update.
- Must-know 5 — Why might an "Index Only Scan" still read the heap?
- Important 6 — When does PostgreSQL TOAST a value, and what are the four strategies?
- Important 7 — Why does a long UUID primary key hurt InnoDB more than PostgreSQL?
- Must-know 8 — What is double caching, and how do PostgreSQL and InnoDB treat it?
- Good to know 9 — Which functions give the heap only, the table with TOAST/FSM/VM, all indexes, and everything?
- Important 10 — A queue table has 2,000 live rows but is 40 GB. Is that bloat or fragmentation, and what are the steps?
- Good to know 11 — What does a SQLite "cell pointer array" correspond to in PostgreSQL?
ACID & Transactions
Open the chapter · 12 questions
- Important 1 — Which of the four properties does a rolled-back transaction demonstrate, and how does PostgreSQL implement "none of it" without an undo log?
- Must-know 2 — Why can a database with all four ACID properties still end up with wrong business data?
- Must-know 3 — What happens to the rest of a PostgreSQL transaction block after one statement fails, and how do you continue anyway?
- Important 4 — What does the commit path write to disk, and what does
synchronous_commit = offchange? - Important 5 — In Laravel, an inner
DB::transactionthrows and the outer catches it. What SQL ran and what is kept? - Good to know 6 — Why should
attemptsbe set on the outermostDB::transactiononly? - Good to know 7 — Which constraint types can be
DEFERRABLEin PostgreSQL, and when is a deferred violation reported? - Must-know 8 — A request opens a transaction, calls a payment API, then writes the result. Name two things that go wrong.
- Must-know 9 —
COMMITreturns a network error. Did it commit? - Must-know 10 — How does Redis
MULTI/EXECdiffer from a SQL transaction? - Important 11 — Why use
BEGIN IMMEDIATEin SQLite for a transaction that will write? - Must-know 12 — When do you reach for a saga and an outbox instead of a transaction?
Isolation Levels: Definitions, Anomalies & Real-World Use Cases
Open the chapter · 10 questions
- Must-know 1 — At PostgreSQL Read Committed, a transaction runs the same
SELECTtwice and gets different rows or values. Why, and what is it called? - Important 2 — What does PostgreSQL Repeatable Read really implement, and which anomaly can still happen?
- Must-know 3 — Two sessions run
SELECT balancethenUPDATE ... SET balance = :newinside transactions at Read Committed. What goes wrong, and name two fixes. - Good to know 4 — What is a rw-dependency, and what is the pivot in an SSI dangerous structure?
- Important 5 — When is the snapshot taken in InnoDB Repeatable Read compared with PostgreSQL?
- Important 6 — Which error code must your retry loop catch in PostgreSQL, and which two in InnoDB?
- Important 7 — Why does a row lock on the rows you read not stop a phantom?
- Must-know 8 — Is Read Uncommitted in PostgreSQL faster because it allows dirty reads?
- Must-know 9 — Does Serializable mean transactions ran one after another?
- Must-know 10 — Does an isolation level protect a workflow that spans a cache, a replica and another service?
MVCC, VACUUM & Bloat in PostgreSQL
Open the chapter · 11 questions
- Good to know 1 — You run
UPDATE t SET note = 'x' WHERE id = 1on a table with three indexes, none onnote. How many index entries are written if the page has room? If it does not? - Good to know 2 — What does
xmaxset on a live, visible row usually mean? - Good to know 3 — A session shows
state = 'idle in transaction'andbackend_xminis null butbackend_xidis set. Does it hold back vacuum? - Must-know 4 — Why does
VACUUMon a 10 GB table with 3 GB dead leave a 10 GB file? - Important 5 — With defaults, when is a 50-million-row table autovacuumed?
- Important 6 — Why does adding autovacuum workers not make vacuum faster overall?
- Good to know 7 — What are the four steps of the manual's wraparound runbook, and what must you not run?
- Important 8 — A replica with
hot_standby_feedback = onruns a 4-hour query. What happens on the primary? - Good to know 9 — How does InnoDB's equivalent of a long transaction show up, and where?
- Good to know 10 — What is the difference between
n_dead_tupandpgstattuple'sfree_percent? - Important 11 — Why is
ctidunsafe as a row identifier between two statements?
Locks & Concurrency Control
Open the chapter · 11 questions
- Good to know 1 — Which PostgreSQL table lock modes does a plain
SELECTconflict with? - Important 2 — Why does
CREATE INDEXblock inserts whileCREATE INDEX CONCURRENTLYdoes not? - Important 3 — A child-table insert hangs while a worker processes the parent order. What lock is probably involved and what change fixes it?
- Must-know 4 — What is the difference between
lock_timeoutandstatement_timeout? - Good to know 5 — Why can
pg_try_advisory_lockleak a lock when called through*sql.DB? - Good to know 6 — In InnoDB at Repeatable Read, an index on
c1holds 10, 11, 13, 20.WHERE c1 = 11 FOR UPDATEon a non-unique index: can another session insert 12? 15? - Good to know 7 — What does
X,GAP,INSERT_INTENTIONwithLOCK_STATUS = WAITINGinperformance_schema.data_lockstell you? - Important 8 — Why do locks differ from latches in how you diagnose them?
- Important 9 — A MySQL transaction gets error 1205. Has the transaction been rolled back?
- Must-know 10 — Why is
NOLOCKnot a fix for blocking in SQL Server? - Must-know 11 — A like counter row limits throughput to about 200 updates a second. Name two redesigns.
Deadlocks: Detection & Avoidance
Open the chapter · 11 questions
- Must-know 1 — Draw the wait-for graph for two transfers in opposite order. Which edge closes the cycle?
- Important 2 — Why does PostgreSQL wait
deadlock_timeoutbefore checking? - Important 3 — How does InnoDB choose its victim, and what is the error?
- Must-know 4 — What is the difference between
1213and1205? - Must-know 5 — Which coffman condition does lock ordering break?
- Important 6 — Why can a parent
SELECT ... FOR UPDATEdeadlock with child inserts in PostgreSQL, and what is the fix? - Good to know 7 — Why do two sessions both succeed at
SELECT ... FOR UPDATEon a missing id in InnoDB, and then deadlock? - Must-know 8 — What must a retry wrapper do for a deadlock to be safe?
- Important 9 — Name two limits of Laravel's
attempts. - Important 10 — How do you detect a rising deadlock rate in PostgreSQL?
- Important 11 — Why can two databases deadlock without any engine noticing?
Optimistic vs Pessimistic Locking
Open the chapter · 10 questions
- Must-know 1 — Why must the version comparison be inside the same
UPDATEas the write? - Must-know 2 — An
UPDATE ... WHERE version = ?returns without error. How do you know whether you won? - Important 3 — Why does a retry loop need jitter and a cap?
- Important 4 — Ten clients all update one hot row. Compare the work done under optimistic retries and under
FOR UPDATE. - Important 5 — What is the difference between
FOR UPDATEandFOR NO KEY UPDATE? - Must-know 6 — What do
NOWAITandSKIP LOCKEDeach do, and which one is for queues? - Important 7 — How can a lock on one row cause an outage on other endpoints?
- Must-know 8 — Why can you not hold a database lock while a user edits a form?
- Important 9 — Which status codes belong to HTTP optimistic concurrency?
- Good to know 10 — In what sense is PostgreSQL's Serializable level optimistic?
Indexing: B-tree, Hash, GIN & GiST
Open the chapter · 12 questions
- Must-know 1 — A query
WHERE tenant_id = ? AND created_at >= ? ORDER BY created_atis slow. Which index do you build and why that column order? - Important 2 — The plan says
Index Only Scan ... Heap Fetches: 48210. What is wrong and how do you fix it? - Important 3 — When does PostgreSQL choose a Bitmap Heap Scan over an Index Scan?
- Important 4 — You have an index on
(a, b). WillWHERE b = 5use it on PostgreSQL 18? - Important 5 — Why does
WHERE email LIKE 'ann%'not use the index onemailin anen_US.UTF-8database? - Important 6 —
CREATE UNIQUE INDEX CONCURRENTLYfailed. What state is the database in, and what do you do? - Good to know 7 — Which index type for
payload @> '{"type":"paid"}'on ajsonbcolumn, and which operator class? - Important 8 — Why does a long
VARCHAR(36)UUID primary key hurt InnoDB more than PostgreSQL? - Must-know 9 —
idx_scan = 0for an index on the primary. Can you drop it? - Important 10 — When is BRIN the right choice, and when is it useless?
- Must-know 11 — How can you know whether an index would help before spending an hour building it?
- Important 12 — What is the difference between a key column and an
INCLUDEcolumn?
B-Tree vs B+Tree in Production Databases
Open the chapter · 11 questions
- Must-know 1 — Why does a B+tree with 8 kB pages need only 4 levels for a billion
bigintkeys, while a balanced binary search tree needs about 30? - Must-know 2 — Name two structural differences between a B-tree and a B+tree and one practical consequence of each.
- Important 3 — What happens, step by step, when a leaf page in PostgreSQL is full and a new key must go into it?
- Important 4 — Why do UUIDv4 primary keys produce a larger index than UUIDv7 keys of the same width?
- Good to know 5 — What does
avg_leaf_density = 45withleaf_fragmentation = 50inpgstatindextell you, and what do you do? - Important 6 — In InnoDB, why does the primary key's size affect every secondary index?
- Good to know 7 — What problem do Lehman and Yao's high key and right-link solve?
- Good to know 8 — What changed in PostgreSQL 13 and 14 for B-tree indexes, and who benefits?
- Must-know 9 — When is a full table scan the right plan?
- Important 10 — Why is
fillfactor = 100risky on a table that receives inserts in the middle of the key range? - Good to know 11 — Why might CockroachDB advise against monotonically increasing primary keys when PostgreSQL advises for them?
Storage Engines: B-tree vs LSM-tree
Open the chapter · 11 questions
- Important 1 — Why does a 100-byte update in InnoDB cost more than 100 bytes of I/O?
- Important 2 — What two places does every RocksDB write go to, and why both?
- Good to know 3 — Name the three blocks a point lookup touches inside one SSTable in the best case and what each does.
- Good to know 4 — Which compaction style would you pick for a 90-day-TTL sensor table in Cassandra, and with what window?
- Important 5 — Why can't an LSM drop a tombstone as soon as it is compacted once?
- Important 6 — RocksDB logs "Stalling writes because we have 20 level-0 files". What are two fixes?
- Good to know 7 — What does the RUM conjecture say, and where do bloom filters sit in it?
- Important 8 — Why does a random UUID primary key hurt InnoDB more than PostgreSQL?
- Good to know 9 — How does LMDB recover after a crash without a WAL?
- Important 10 — A benchmark shows an LSM beating a B-tree by 5× on inserts after 3 minutes. What do you ask?
- Important 11 — What do Redis RDB and AOF correspond to in disk-engine terms?
Query Planning, EXPLAIN & Join Algorithms
Open the chapter · 11 questions
- Must-know 1 — A node shows
rows=10estimated andactual rows=10 loops=5000. Is the estimate wrong? - Important 2 — Why can
WHERE city = 'Berlin' AND zip = '10115'be underestimated, and what fixes it? - Important 3 — What does
Batches: 32under aHashnode mean, and where else do you see it? - Must-know 4 — A query is fast in psql and slow from a Go service using pgx. What is the first hypothesis and how do you test it?
- Important 5 — When does PostgreSQL 12+ inline a CTE, and how do you force each behaviour?
- Must-know 6 — Why is
SET work_mem = '1GB'inpostgresql.confdangerous? - Good to know 7 — A query joins 14 tables and its plan changes from run to run. Which mechanism is involved?
- Important 8 — What does
Heap Fetches: 90000on an Index Only Scan returning 100,000 rows tell you? - Good to know 9 — In MySQL 8.4, how do you see actual rows per operator, and how do you influence join order?
- Good to know 10 — What is parameter sniffing in SQL Server and two ways to deal with it?
- Important 11 — Why should
auto_explain.log_timingusually be off in production whenlog_analyzeis on?
Bloom Filters & Probabilistic Structures
Open the chapter · 12 questions
- Must-know 1 — A Bloom filter returns
truefor a key. What do you know? - Important 2 — How many bits per key does a 1% false positive rate need, and what is the optimal k?
- Important 3 — Why can a standard Bloom filter not have false negatives, and how can a counting filter get one?
- Good to know 4 — Why does RocksDB confine a key's probes to one cache line, and what does it cost?
- Important 5 — When is a Cuckoo filter better than a Bloom filter, and what can go wrong?
- Important 6 — What error does HyperLogLog have in Redis and how much memory does it use?
- Important 7 — You want weekly unique visitors from seven daily HyperLogLogs. How?
- Important 8 — A Count-Min estimate says 25 for a key that you think appeared twice. Is the sketch broken?
- Important 9 — When does a PostgreSQL BRIN index skip nothing?
- Must-know 10 — Why do Cassandra and RocksDB need Bloom filters at all?
- Good to know 11 — Why is the PostgreSQL
bloomindex slower than six single-column btrees yet still useful? - Must-know 12 — When must you not rely on a Bloom filter?
Pagination: Offset vs Keyset
Open the chapter · 12 questions
- Must-know 1 — Why does an index on
created_atnot makeOFFSET 900000fast? - Must-know 2 — A feed shows the same order twice across pages 1 and 2. What happened and what fixes it?
- Must-know 3 — Why must the
ORDER BYend with a unique column? - Important 4 — What does
(a, b) < (x, y)mean, and when can you not use it? - Must-know 5 — Write the seek condition for
ORDER BY created_at DESC, id ASC. - Important 6 — Why is base64 not enough for a cursor, and what does a signature add?
- Good to know 7 — How do you show "page 3 of 240" on a 40-million-row table cheaply?
- Important 8 — Why can keyset pagination not jump to page 40, and what are the options?
- Important 9 — What is a deferred join and what does it not fix?
- Must-know 10 — Why use
chunkById()instead ofchunk()when the loop updates the filter column? - Important 11 — How does Slack tell you the list has ended, and what must you not do?
- Important 12 — Why is keyset better than offset on read replicas?
Cursors & Streaming Results
Open the chapter · 11 questions
- Must-know 1 — Why does a
foreachover a PDO MySQL result not save memory by default? - Good to know 2 — What is the difference between
DECLARE ... WITH HOLDandWITHOUT HOLD? - Important 3 — What does an idle cursor loop cost the database?
- Must-know 4 — How does Laravel
cursor()differ fromlazyById()? - Good to know 5 — Why does
cursor_tuple_fractionmatter for exports? - Important 6 — What is "Commands out of sync" and how do you avoid it?
- Must-know 7 — Why pass
r.Context()intoQueryContextin an export handler? - Important 8 — When is
COPYbetter than streamingSELECT? - Must-know 9 — What is backpressure in a streaming export?
- Important 10 — How do you tell a complete NDJSON stream from a truncated one?
- Important 11 — Why does PgBouncer transaction pooling break cursors?
Working with Billion-Row Tables
Open the chapter · 11 questions
- Must-know 1 — Why is a billion-row
UPDATEin one statement dangerous even though it is a single command? - Good to know 2 — What does
COPY ... FREEZEneed, and why is it useful? - Important 3 — Give the autovacuum trigger formula and say why it is a problem on a large table.
- Important 4 — When is BRIN better than a B-tree, and when useless?
- Must-know 5 — Why is
DROP PARTITIONpreferred overDELETEfor retention? - Must-know 6 — How do you get a fast approximate row count in PostgreSQL, and what is its limit?
- Important 7 — What do
maintenance_work_memandmax_parallel_maintenance_workersdo for index builds? - Important 8 — Why can a long-running transaction stall
CREATE INDEX CONCURRENTLY? - Good to know 9 — What breaks if
wal_levelis set tominimalfor a bulk load? - Good to know 10 — Which InnoDB setting bounds concurrent DML during online DDL, and what happens on overflow?
- Important 11 — How do you throttle a backfill by replica lag?
Partitioning & Sharding in PostgreSQL
Open the chapter · 11 questions
- Important 1 — Your
eventstable is RANGE-partitioned bycreated_at. Why doesSELECT * FROM events WHERE id = 123touch every partition? - Important 2 — Why can't you create
PRIMARY KEY (id)on that table, and what doesPRIMARY KEY (id, created_at)actually guarantee? - Good to know 3 — What is the difference between
Subplans Removed: 11and(never executed)inEXPLAIN ANALYZE? - Good to know 4 — Which lock does
ATTACH PARTITIONtake on the parent, and how do you avoid the validation scan? - Good to know 5 — Your rotation job runs
DETACH PARTITION ... CONCURRENTLYinsideDB::transaction(). What happens, and what else can make it fail? - Must-know 6 — You add 20 hash partitions on one server. How much write throughput did you gain?
- Must-know 7 — Name three properties of a good shard key.
- Must-know 8 — Why is a scatter-gather query slower and less consistent than the same query on one database?
- Important 9 — You route with
fnv1a(user_id) % 3(the lab router) and need a fourth shard. Roughly how much data moves, and what would have avoided it? - Important 10 — Why does
postgres_fdwsharding not give atomic writes across two servers? - Good to know 11 — What does a Citus reference table solve?
Consistent Hashing
Open the chapter · 10 questions
- Must-know 1 — Why does
hash(key) % nremap about 86% of keys when a 6-node cache becomes 7 nodes? - Must-know 2 — On a ring with one token per node, who gets a removed node's keys? How do virtual nodes change this?
- Good to know 3 — How does Dynamo build a preference list when virtual nodes are used?
- Must-know 4 — What is
HASH_SLOTin Redis Cluster and what does a hash tag do? - Good to know 5 — Why can jump hash not remove node 3 of 10?
- Good to know 6 — What does the bounded-load capacity
ceil(c x m / n)guarantee, and what does it cost? - Good to know 7 — How do you set Laravel 13 to use Redis Cluster versus client-side sharding?
- Important 8 — Which of PostgreSQL hash partitioning, Kafka's default partitioner and Cassandra uses real consistent hashing?
- Must-know 9 — A single celebrity key overloads one node on a good ring. Name three mitigations.
- Important 10 — Why is hash-function choice part of the data format?
Storage & Data Scaling: The Scale Ladder
Open the chapter · 12 questions
- Must-know 1 — Your p99 doubled and the buffer hit ratio fell from 99% to 92%. What do you check first, and which rungs are candidates?
- Must-know 2 — 40 million requests per day with a peak factor of 5 and a 90:10 read:write split. What are the peak QPS and write rate?
- Must-know 3 — At 3,000 QPS and 10 ms database time, how many connections are busy, and what happens when latency becomes 100 ms?
- Good to know 4 — With contention 0.05 and coherency 0.002, where does the USL peak, and what does adding more nodes do after it?
- Must-know 5 — Why does a user not see their own edit after a redirect, and name three fixes.
- Must-know 6 — How do TTL jitter, singleflight and
Cache::flexibleeach reduce a stampede? - Must-know 7 — Why does partitioning not scale writes, and what is it good for?
- Good to know 8 — What did Notion mean by "Shard earlier", and how does that differ from premature sharding?
- Important 9 — Name three things you lose when you shard, per Figma.
- Important 10 — A single Redis node is at 100% CPU while the cluster is idle. What is it, and what are two fixes?
- Important 11 — When should a different store win over scaling PostgreSQL further?
- Important 12 — What is the rollback of each of: a read replica, a cache, logical sharding, physical sharding?
Distributed SQL, Consensus & 2PC
Open the chapter · 12 questions
- Important 1 — A coordinator crashes after both participants voted YES. Why can't a participant simply abort after a timeout?
- Good to know 2 — What does presumed abort save, and what does it not fix?
- Important 3 — Why do production systems not use 3PC?
- Important 4 — You find a row in
pg_prepared_xactsthat is three days old. What do you do? - Must-know 5 — Why is a 4-node Raft cluster no better than 3 nodes?
- Good to know 6 — In Paxos, a proposer learns in phase 1 that one acceptor has already accepted (ballot 4, value 9). It wants to propose 5. What must it propose, and why?
- Must-know 7 — A Raft leader serves a read from its local state without any check. How can that read be stale, and what are the two fixes?
- Important 8 — Three replicas in regions A, B, C with RTT A–B 10 ms and A–C 70 ms; the leaseholder is in A. Roughly what does a write from a client in A cost, and why not 70 ms?
- Good to know 9 — What does Spanner's commit wait guarantee, and how long is it?
- Must-know 10 — A worker holding a Redis lock pauses for 20 s, the lock expires, another worker takes over, and then the first wakes up and writes. What prevents corruption?
- Important 11 — Your PostgreSQL primary with two replicas handles the load and you lose at most a few seconds of data on failover. When would you move to distributed SQL?
- Must-know 12 — Two services own two databases and must both reflect a payment. Why is a saga with an outbox usually preferred to XA?
OLTP vs OLAP & Columnar Storage
Open the chapter · 12 questions
- Must-know 1 — Why does
SELECT sum(amount) FROM paymentsread so much less in a column store? - Good to know 2 — Name five compression encodings and when each wins.
- Good to know 3 — What is late materialisation and which engines expose it?
- Important 4 — Why do zone maps stop working on shuffled data?
- Important 5 — In ClickHouse, why is
PRIMARY KEYnot a uniqueness constraint, and how do you get "latest row per key"? - Important 6 — A report on the PostgreSQL standby is cancelled with
conflict with recovery. Give two fixes and their costs. - Important 7 — What must exist for
REFRESH MATERIALIZED VIEW CONCURRENTLY, and what does it cost? - Good to know 8 — What does
pg_ivmadd and what is the downside? - Must-know 9 — Why do star schemas denormalise, and what is the grain?
- Important 10 — How does Type 2 SCD keep history correct?
- Must-know 11 — ETL vs ELT: when would you choose ELT?
- Good to know 12 — What does a lakehouse table format add to a folder of Parquet files?
Replication, Read Replicas & Failover
Open the chapter · 12 questions
- Important 1 — Your replica shows
flush_lsnclose to the primary butreplay_lsnfar behind. What are two likely causes, and which knob is involved? - Important 2 — A replica was shut down for three days and the primary's disk filled. Why, and what setting would have kept the primary up?
- Good to know 3 — What is the difference between
synchronous_standby_names = 's1, s2'and'ANY 1 (s1, s2)'? - Important 4 — A user cancels a hanging
COMMITon a primary with a synchronous standby that is down. Is the row committed? - Important 5 — Why does
now() - pg_last_xact_replay_timestamp()report 10 minutes of lag on a fully caught-up replica at night? - Must-know 6 — After an async failover, can you simply start the old primary with
standby.signal? - Must-know 7 — Explain split brain and two ways Patroni prevents it.
- Important 8 — What does
remote_applygive you thatondoes not, and what does it cost? - Good to know 9 — Why can't you fail over to a logical-replication subscriber without preparation?
- Must-know 10 — A Laravel app uses
read/writehosts. A user saves a form and the redirect shows old data. Name the built-in fix and its limitation. - Must-know 11 — Why is RDS Multi-AZ (single standby instance) not a read-scaling solution?
- Important 12 — In MySQL semisynchronous replication, what does the source wait for, and what happens if no replica answers?
Durability, WAL & Crash Recovery
Open the chapter · 11 questions
- Must-know 1 — A client receives "COMMIT" and the server loses power one millisecond later. Under PostgreSQL defaults, is the transaction there after restart, and where was it at the moment of the crash?
- Important 2 — What exactly can
synchronous_commit = offlose, and why can it not corrupt the database? - Important 3 — Why does WAL volume jump right after every checkpoint?
- Important 4 —
pg_stat_checkpointershowsnum_requested= 900 andnum_timed= 40. What is happening and what do you change? - Good to know 5 — Why does PostgreSQL's crash recovery have no undo pass, while InnoDB's does?
- Good to know 6 — What did fsyncgate teach, and what does
data_sync_retry = offdo? - Must-know 7 —
pg_walhas grown to 200 GB and the disk is nearly full. Name three likely causes and the one thing you must not do. - Important 8 — In MySQL, why do you need both
innodb_flush_log_at_trx_commit = 1andsync_binlog = 1? - Must-know 9 — Your connection dropped while
COMMITwas in flight. How do you find out whether the order exists without risking a double charge? - Important 10 — Why is a replicated cloud volume (EBS, Persistent Disk) not a reason to set
synchronous_commit = offorinnodb_flush_log_at_trx_commit = 2? - Important 11 — How does Kafka achieve durability without flushing every message, and which producer and topic settings make it hold?
Backup, PITR & Disaster Recovery
Open the chapter · 12 questions
- Must-know 1 — Why is a streaming replica not a backup? Name the failure it does not protect against.
- Must-know 2 — List the three things a PITR needs and what makes it fail.
- Important 3 — Which
recovery_target_*would you use before a planned risky migration, and how do you create it? - Good to know 4 — What does
recovery_target_action = pausegive you? - Important 5 — After PITR what is a timeline and why does PostgreSQL create one?
- Must-know 6 — A nightly job exits 0 and S3 has a 2 KB file. What went wrong and what check would have caught it?
- Important 7 — Compute RTO: 3 TB base at 300 MB/s, 100 GB WAL replayed at 100 MB/s, 20 minutes of overhead.
- Must-know 8 — What does 3-2-1-1-0 add to 3-2-1?
- Must-know 9 — Why is
pg_dumpallnot consistent across databases, and what is? - Important 10 — What do you need besides the latest incremental to restore it?
- Important 11 — Name two things that make a backup bucket survive stolen production credentials.
- Important 12 — Why can a failing
archive_commandtake the primary down?
Eventual Consistency in Database Systems
Open the chapter · 11 questions
- Must-know 1 — A user saves a profile and is redirected; the next page shows the old name. Laravel has
'sticky' => true. Why did it not help, and what does? - Important 2 — PostgreSQL with
synchronous_standby_names = 'FIRST 1 (s1)'andsynchronous_commit = on: is a read ons1right after commit guaranteed fresh? - Important 3 — Cassandra, RF=3, writes at
ONE, reads atQUORUM. Is read-your-writes guaranteed? - Good to know 4 — Why can a quorum system still return an older value after a newer one was returned?
- Good to know 5 — Which MongoDB read/write concern combination gives all four causal guarantees durably, and what does
"local"+{ w: 1 }give? - Must-know 6 — A DynamoDB order history page uses a GSI by customer. Product asks for "always show the order just placed". What do you do?
- Important 7 — What is the difference between Cosmos DB Session and Consistent prefix?
- Must-know 8 — Two regions accept writes to the same cart item with LWW. What goes wrong and what are the alternatives?
- Must-know 9 — Why is MySQL semi-sync not a read-your-writes solution, and what is?
- Good to know 10 — A dashboard may be up to 30 s old. Which knobs implement that in Cosmos DB, CockroachDB, MongoDB and Oracle?
- Important 11 — How would you prove that your read-after-write routing works?
Database System Design: Requirements to Worked Sketches
Open the chapter · 12 questions
- Must-know 1 — A product brief says "10M links per month, mostly reads". Which three numbers do you derive first, and what are they?
- Must-know 2 — Why is "design tables first, queries later" acceptable in a single PostgreSQL but not in DynamoDB or a sharded system?
- Must-know 3 — Your stock decrement reads
available, checks it in PHP, and writes the new value. Name the bug and the fix that needs no level change. - Important 4 — Two tabs of the same customer both pass the "max 2 per customer" check. Why doesn't the atomic stock update stop it, and what does?
- Important 5 — A hot SKU gets 400 checkouts/s in a flash sale and p99 explodes although CPU is 30%. Why, and what are two fixes?
- Important 6 — When is fan-out on write the wrong choice, and what replaces it?
- Must-know 7 — A user places an order and the next page says "no orders". The database is fine. What happened and how do you fix it?
- Important 8 — You have two async replicas and nightly logical dumps. A developer runs
DELETE FROM orderswithoutWHEREat 14:05. What can you recover, and what should the design have had? - Must-know 9 — How many database connections does a checkout at 230 transactions/s with 15 ms per transaction need, and why do teams still run out?
- Good to know 10 — Why did Discord bucket chat partitions by time, and how big were the buckets?
- Must-know 11 — What is the cheapest rung to try before adding read replicas, and why?
- Must-know 12 — In an interview you have 45 minutes for "design a URL shortener". What do you put on the board, in order?
Schema Design, Normalization & Data Types
Open the chapter · 12 questions
- Must-know 1 — A table
order_lines(order_id, product_id, product_name, qty)has the key(order_id, product_id). Which normal form does it violate and how do you fix it? - Good to know 2 — What is the difference between 3NF and BCNF, and when do they differ?
- Must-know 3 — Why is an application-side read, add one, write back unsafe for a counter cache?
- Important 4 — Name two reasons a random UUIDv4 primary key costs more than a
bigintidentity in MySQL InnoDB. - Important 5 — A foreign key is declared
ON DELETE CASCADE; the parent has 10 million children. What goes wrong? - Good to know 6 — When is a deferrable constraint needed?
- Must-know 7 —
SELECT * FROM a WHERE id NOT IN (SELECT a_id FROM b)returns no rows although some should match. Why? - Must-know 8 — A
CHECK (price >= 0)accepted a row withprice = NULL. Why, and what fixes it? - Important 9 — Why can a polymorphic association leave orphans, and what are two alternatives?
- Must-know 10 — A user in Tehran enters an appointment at "09:00 next March 1". What do you store and why?
- Important 11 — In Go, what happens if you
ScanaNULLinto a plainstring, and what are the three safe options? - Important 12 — Your lab read dropped from 0.69 s to microseconds after a counter cache. What did you pay, and what keeps it honest?
Zero-Downtime Schema Migrations
Open the chapter · 12 questions
- Must-know 1 — A migration that adds a nullable column "only takes a millisecond" yet the site froze for 40 seconds. What happened?
- Important 2 — Why is
lock_timeoutbetter thanstatement_timeoutfor a migration step, and where should you set it? - Important 3 — Which of these rewrite the table in PostgreSQL 11 or later:
ADD COLUMN a int DEFAULT 0,ADD COLUMN b uuid DEFAULT gen_random_uuid(),ALTER COLUMN c TYPE bigint,DROP COLUMN d? How can you verify? - Must-know 4 — Describe the six steps to rename a column without downtime.
- Important 5 — Why must dual writes go live before the backfill starts?
- Important 6 — What does
ADD CONSTRAINT ... NOT VALIDskip, what does it still need, and what doesVALIDATE CONSTRAINTlock? - Must-know 7 — Give the safe sequence for adding
NOT NULLto a populated column on PostgreSQL 12 or later. - Important 8 — A
CREATE INDEX CONCURRENTLYfailed. What state is the database in and what do you do? - Important 9 — Why is
ALTER TYPE ... ADD VALUEawkward in a transactional migration, and what are the alternatives to an enum? - Important 10 — What happens on a PostgreSQL hot standby when the primary runs an
ALTER TABLEwhile a 10-minute report is running there? - Important 11 — Why is a failed multi-statement migration worse on MySQL than on PostgreSQL?
- Must-know 12 — Why is
down()a poor rollback plan, and what is the alternative?
Connection Pooling
Open the chapter · 12 questions
- Important 1 — Why does an idle PostgreSQL connection still cost something, and why did it cost more before PostgreSQL 14?
- Must-know 2 — An 8-core server with all data in cache: what is the starting pool for active connections, and what do you do next?
- Must-know 3 — A service handles 1500 req/s, and each holds a connection for 4 ms on average. What pool do you need?
- Must-know 4 — What does
SetMaxOpenConns(0)do, and what is the defaultMaxIdleConns? - Important 5 — How do you set an acquisition timeout with
database/sql? - Must-know 6 — Which three symptoms identify pool exhaustion rather than a slow database?
- Important 7 — Which PgBouncer pooling mode do you use for a normal web app, and which features break?
- Good to know 8 — Why do prepared statements fail behind PgBouncer before 1.21, and what changed?
- Good to know 9 — In Laravel 13, what do
pooledanddirectdo? - Must-know 10 — Why does
max_connections = 1000not solvetoo many clients already? - Important 11 — What does
idle_in_transaction_session_timeoutprotect, and where do you set it? - Must-know 12 — A serverless function opens one connection per invocation and the database falls over during a burst. What changes?
ORM Pitfalls: N+1, Lazy Loading & Bulk Operations
Open the chapter · 12 questions
- Must-know 1 — A Blade view prints
$author->books->count()for 50 authors. How many queries run, and name two fixes? - Must-know 2 — Does
Author::with('books')run aJOIN? - Important 3 — You narrow a relation with
with('books:title')and the stitching breaks. Why? - Important 4 — A job flips
in_stock = falseusingBook::where('in_stock', true)->chunk(200, ...)and finishes with rows still true. What happened and what do you change? - Important 5 — What does
Book::where(...)->update([...])skip compared with loading and saving each model? - Important 6 — Why can
insertOrIgnorebe dangerous? - Must-know 7 — Your import of 10,000 rows crashes at row 6,000. How many rows are stored with a
save()loop and without a transaction, and how do you make it all-or-nothing? - Good to know 8 — Why does
Book::find(1)twice in Eloquent give two objects while Doctrine gives one? - Must-know 9 — Which of these is injectable:
where('name', $x),whereRaw("name = '$x'"),orderBy($col)with user input,whereRaw('name = ?', [$x])? - Important 10 — Why does a unique index on
users.emailbreak soft-deleted accounts re-signing up, and what fixes it in PostgreSQL? - Must-know 11 — How would you spot an N+1 from the database side?
- Important 12 — Why is mocking the ORM a poor substitute for a real database in tests?
Multi-Tenancy Strategies
Open the chapter · 10 questions
- Important 1 — What are the four kinds of tenant isolation, and which model is weakest on each?
- Important 2 — Why must
set_configusetrueas the third argument in a pooled application? - Important 3 — A table has
ENABLE ROW LEVEL SECURITYand a correct policy, yet the application sees all rows. Name three causes. - Must-know 4 — What is the difference between
USINGandWITH CHECK? - Must-know 5 — Why does an index on
(tenant_id, created_at)beat one on(created_at)for per-tenant queries? - Important 6 — How do you roll out a schema change to 5 000 tenant schemas?
- Important 7 — Why is
DELETE FROM ... WHERE tenant_id = ?not enough for offboarding? - Good to know 8 — When would you move one tenant out of a pooled database, and how?
- Important 9 — What does MySQL offer instead of RLS?
- Must-know 10 — What must a tenant-isolation test never do?
ID Generation at Scale
Open the chapter · 10 questions
- Must-know 1 — Why can a rolled-back transaction leave a gap in a PostgreSQL sequence?
- Important 2 — What does
CACHE 20change for two concurrent sessions? - Good to know 3 — Which
innodb_autoinc_lock_modekeeps IDs consecutive within one bulk insert? - Good to know 4 — Name the four fields of a Snowflake ID and their sizes.
- Important 5 — What should a Snowflake generator do when the clock moves backwards?
- Must-know 6 — Why are UUIDv4 primary keys harder on a B-tree than UUIDv7?
- Important 7 — When does
UUID_TO_BIN(u, 1)help in MySQL? - Must-know 8 — Why must a public ID be authorised even if it is a random UUID?
- Must-know 9 — What is an idempotency key and who generates it?
- Important 10 — Why can two IDs from different nodes sort in the wrong order?
Database Observability
Open the chapter · 11 questions
- Must-know 1 — Why can a 2 ms query cost more than a 2 s query?
- Important 2 — What does normalization in
pg_stat_statementsdo, and what does it hide? - Must-know 3 — A session is
activeandwait_event_type = 'Lock'. What do you do next? - Must-know 4 — Why is
idle in transactiondangerous even though the session runs nothing? - Must-know 5 — Why is a high cache hit ratio not proof of health?
- Important 6 — Which parameter logs the plan of a slow statement, and what is the cost?
- Good to know 7 — Where did checkpoint statistics go in PostgreSQL 17?
- Must-know 8 — Why must
db.query.textbe sanitized or parameterized? - Important 9 — How do you link a trace to a database wait?
- Must-know 10 — List the alerts you would set first and why.
- Important 11 — Why does the server's number differ from the span's?
Database Security: Threat Model, Roles, RLS, Injection, Audit
Open the chapter · 10 questions
- Must-know 1 — Your
pg_hba.confhashost all all 10.0.0.0/8 md5abovehostssl shop shop_app 10.0.3.0/24 scram-sha-256. A client from 10.0.3.7 connects. Which line applies and why does it matter? - Important 2 — Why is a stolen md5 hash worse than a stolen SCRAM verifier?
- Must-know 3 — The app connects as the table owner, and you enable RLS with a tenant policy. A query without a tenant filter still returns every tenant's rows. Why, and what are two fixes?
- Must-know 4 — You bind every value with
$1, but?sort=goes intoORDER BY. Is the endpoint safe? - Important 5 — What is second-order SQL injection, and why do bind parameters at insert time not prevent it?
- Good to know 6 — A
SECURITY DEFINERfunction reads tablepwdswithout schema qualification. How can a low-privilege user abuse it, and what is the fix? - Must-know 7 — What does
sslmode=requirefail to protect against, and which mode does? - Important 8 — Why does the RLS tenant setting need to be transaction-local in a pooled application?
- Important 9 — Name two reasons
log_statement = 'all'is not an audit log. - Important 10 — During a suspected breach, why should you not immediately restore from the latest backup?
Encryption at Rest, in Transit & in Use (TDE, Column, Homomorphic)
Open the chapter · 12 questions
- Must-know 1 — A laptop with an encrypted disk is stolen while the database was running and logged in. Is the data safe? Which layer would have helped?
- Must-know 2 — Why does TDE not stop a DBA from reading a customer's card number?
- Important 3 — What exactly does PostgreSQL offer for encryption at rest?
- Important 4 — Explain envelope encryption and why rotation of the KEK is cheap.
- Must-know 5 — Why is
sslmode=requirenot enough, and what is the single change that fixes it? - Important 6 — How can you search an encrypted email column, and what does it leak?
- Important 7 — When is deterministic encryption a bad idea?
- Must-know 8 — Why must passwords be hashed rather than encrypted, and with what?
- Good to know 9 — What does confidential computing protect, and what does it not?
- Important 10 — A customer exercises erasure but their data is in year-old backups. What do you do?
- Important 11 — After rotating
APP_KEY, some rows fail to decrypt. What happened? - Good to know 12 — Which of PHE, SHE and FHE would you consider for encrypted
SUMover a few thousand rows?
PostgreSQL & Database Fundamentals
Open the chapter · 12 questions
- Must-know 1 — Why does PostgreSQL need a pooler sooner than MySQL?
- Good to know 2 — Name five processes you see in
pg_stat_activity.backend_typeon an idle server. - Good to know 3 — What replaced the statistics collector process, and from which version?
- Important 4 —
ALTER SYSTEM SET shared_buffers = '2GB'pluspg_reload_conf(): is it live? - Good to know 5 — Where is the table
ordersstored on disk? - Important 6 — What does
search_pathdefault to and why does it matter for security? - Important 7 — What is the difference between
pg_catalogandinformation_schema? - Good to know 8 — Which setting is only a planner hint and allocates nothing?
- Important 9 — How do simple and extended query protocol differ, and which does pgx use by default?
- Must-know 10 — How long is a PostgreSQL major version supported, and is a minor upgrade a dump/restore?
- Good to know 11 — Which
\command runs each result cell as SQL? - Must-know 12 — Why is a stray
trustline dangerous inpg_hba.conf?
MySQL Storage Engines: InnoDB vs MyISAM (and the rest)
Open the chapter · 10 questions
- Good to know 1 — What does the handler API do, and why does it let MySQL mix engines?
- Must-know 2 — Why does InnoDB store rows in a clustered index, and what does a secondary index point to?
- Good to know 3 — How does the buffer pool's midpoint insertion protect it from a table scan?
- Important 4 — What exactly does
innodb_flush_log_at_trx_commit=1guarantee, and what does 2 risk? - Important 5 — What are undo records used for, and what does a long transaction do to the history list length?
- Important 6 — Which problem does the doublewrite buffer solve that redo cannot?
- Important 7 — In the life of an UPDATE, when does the client get OK, and is the data page on disk by then?
- Important 8 — Why can a MyISAM table be marked as crashed after kill -9, and how do you fix it?
- Good to know 9 — When is MyRocks a better fit than InnoDB, and what do you give up?
- Important 10 — How do you convert a large MyISAM table to InnoDB with the least risk?
SQLite in Depth
Open the chapter · 12 questions
- Must-know 1 — Why is SQLite called serverless, and who coordinates two processes that open the same file?
- Good to know 2 — In rollback-journal mode, what is the commit point, and what is a hot journal?
- Must-know 3 — What does WAL change about concurrency, and what does it not change?
- Important 4 — Why can a long-running read transaction make the
-walfile grow without bound? - Good to know 5 — Order the lock states and say what PENDING is for.
- Important 6 — Why does
BEGIN DEFERREDfollowed by a read and then a write sometimes fail withSQLITE_BUSYeven with a large busy timeout? - Must-know 7 — What isolation does SQLite give, and how?
- Important 8 — What do type affinity and
STRICTdo differently when you insert'abc'into anINTEGERcolumn? - Important 9 — Name three PRAGMAs that are per connection and must be set for every pooled connection.
- Must-know 10 — Why does a Go test using
:memory:fail with "no such table" intermittently? - Important 11 — Give three safe ways to back up a live database and one unsafe way.
- Good to know 12 — What does Litestream replicate and what does it not give you?
NoSQL: Families & Data Models
Open the chapter · 10 questions
- Must-know 1 — Why is "Not Only SQL" a better description of the ecosystem than of a single database?
- Good to know 2 — What is the difference between the Bigtable and Dynamo lineages?
- Must-know 3 — What does "access-pattern-first" mean, and why does it hurt a later query?
- Important 4 — Why is the aggregate also the transaction boundary in many NoSQL stores?
- Must-know 5 — Name three things relational databases give you that most NoSQL families do not.
- Important 6 — A DynamoDB read right after a write returns old data. Why, and what are your options?
- Must-know 7 — Why is a dual write to PostgreSQL and Elasticsearch dangerous?
- Important 8 — How does a Cassandra table design differ from a relational one?
- Good to know 9 — Which family fits "friends of friends who bought this", and what is the PostgreSQL alternative?
- Must-know 10 — Give two reasons to stay on PostgreSQL before adding a NoSQL store.
Redis: Data Structures, Commands & Patterns
Open the chapter · 11 questions
- Must-know 1 — Two clients run
GET counterthenSET counter <value+1>. What can go wrong and what are two fixes? - Important 2 — You enable
io-threads 4. Does a 2-second Lua script stop blocking other clients? - Important 3 — p99 latency spikes every few minutes on a 30 GB instance with RDB save points. Name the likely cause and two mitigations.
- Must-know 4 — A cache instance uses
volatile-lruand starts returningOOMerrors. Why? - Important 5 — Inside
MULTI,SET s xsucceeds andLPUSH s yfails withWRONGTYPE. What is the value ofsafterEXEC? - Important 6 — What is the difference between
MOVEDandASK? - Important 7 — Why does
MSET a 1 b 2fail on Cluster and how do you make it work? - Important 8 — A master acknowledges
SET, then crashes, and Sentinel promotes a replica. Is the write guaranteed to exist? DoesWAIT 1 100change that? - Must-know 9 — Why is a Redis TTL lock not enough to protect writes to a database for correctness, and what fixes it?
- Important 10 — You deleted half of your keys but
used_memory_rssdid not drop. Is that a leak? - Good to know 11 — Which Redis licences can you choose from for Redis 8, and what is Valkey?
MongoDB in Depth
Open the chapter · 11 questions
- Must-know 1 — A product document embeds every review and has started failing updates. What is happening and what are two fixes?
- Important 2 — Your query filters
user_idandstatusby equality, ranges ontotal_centsand sorts bycreated_at. In what order should the compound index fields be? - Important 3 — What three numbers in
explain("executionStats")tell you whether an index is good? - Good to know 4 — A write acknowledged with
w: 1, j: truedisappeared after a failover. Why? - Important 5 — Why might a user not see their profile change right after saving it, and how do you fix that in MongoDB?
- Important 6 — Which transaction errors may you retry, and how?
- Important 7 — Your replica set is two data nodes and an arbiter. One data node fails. What happens to
w: "majority"writes? - Important 8 — You sharded
eventson{ created_at: 1 }. What goes wrong and what do you do? - Important 9 — When does a query on a sharded collection become a broadcast?
- Good to know 10 — A change-stream consumer was down for three days and now fails to resume. Why?
- Must-know 11 — When should you choose PostgreSQL
jsonbover MongoDB?
Wide-Column & Key-Value at Scale: Cassandra & DynamoDB
Open the chapter · 12 questions
- Must-know 1 — Why does a low-cardinality partition key (like
status) cause throttling even when the table is mostly idle? - Important 2 — With replication factor 3, which read and write levels guarantee that a read sees the latest acknowledged write?
- Good to know 3 — What is the difference between a sloppy quorum and a strict quorum?
- Important 4 — How do Dynamo and Cassandra resolve conflicting writes?
- Must-know 5 — Why does a DynamoDB GSI query sometimes miss an item you just wrote?
- Important 6 — What does a
TransactWriteItemscall cost, and what are its limits? - Important 7 — Why is
INSERT ... IF NOT EXISTSexpensive in Cassandra? - Must-know 8 — A Cassandra table used as a queue becomes slow to read. Why, and what do you do?
- Important 9 — Why must Cassandra repair run at least once per
gc_grace_seconds? - Must-know 10 — What is single-table design, and what does it cost?
- Important 11 — DynamoDB global tables: what happens when two Regions write the same item concurrently?
- Must-know 12 — When is PostgreSQL enough?
Cassandra & ScyllaDB in Depth
Open the chapter · 12 questions
- Must-know 1 — With RF=3, how many replicas must answer a
QUORUMread, and how many nodes may be down? - Important 2 — Why do
QUORUMwrites plusQUORUMreads give you read-your-writes? - Important 3 — A write at
ONEsucceeded but a read atONEa moment later returned nothing. Which three mechanisms can fix the stale replica later? - Must-know 4 — What defines a partition, and what orders rows inside it?
- Must-know 5 — You need to look up a user by id and by e-mail. What do you do?
- Important 6 — Why can a delete bring back deleted data?
- Important 7 — Why is a 1,000-row unlogged batch across many partitions a bad idea?
- Important 8 — Which compaction strategy fits TTL'd append-only time series, and why?
- Good to know 9 — Name three differences between ScyllaDB and Cassandra that matter for operations.
- Good to know 10 — How would a Laravel 13 app talk to Cassandra?
- Important 11 — When is an LWT the right tool, and what does a timeout mean?
- Important 12 — Why use
NetworkTopologyStrategyeven with one datacenter?
Graph Databases
Open the chapter · 12 questions
- Important 1 — What does "index-free adjacency" mean, and does it mean a graph database needs no indexes?
- Good to know 2 — Give three differences between a labeled property graph and RDF.
- Must-know 3 — Why can a recursive CTE loop forever, and what are two ways to stop it?
- Good to know 4 — In our lab, how did PostgreSQL's recursive CTE compare with Neo4j at three to five hops, and what should you conclude?
- Good to know 5 — Why can you not use a parameter for the hop count in a Cypher 5 variable-length pattern, and what do you do instead?
- Important 6 — What is the difference between Cypher, GQL and Gremlin?
- Important 7 — What are a supernode and one mitigation?
- Important 8 — Why is sharding a graph hard?
- Good to know 9 — Name four GDS algorithm families and one procedure each.
- Must-know 10 — Is GraphQL a graph database?
- Important 11 — Why must the body of a Neo4j transaction function be idempotent?
- Must-know 12 — When would you not use a graph database?
Full-Text Search: PostgreSQL FTS vs Elasticsearch
Open the chapter · 11 questions
- Must-know 1 — Why can a B-tree not speed up
LIKE '%word%', and which two index types can? - Must-know 2 — What does an inverted index store, and how does
quick AND foxuse it? - Important 3 — Why did
to_tsvector('english', 'Café')not match a search forcafe, and what fixes it? - Good to know 4 — Name the Persian-specific problems a search must handle.
- Good to know 5 — What do BM25's
k1andbcontrol, and what are their Elasticsearch defaults? - Important 6 — Why is
ts_rankexpensive on a broad query, and how do you limit the cost? - Important 7 — What does
refreshdo in Elasticsearch, and what is the default behaviour? - Must-know 8 — Why is a bare dual write unsafe, and what replaces it?
- Important 9 — How does Reciprocal Rank Fusion combine keyword and vector results?
- Important 10 — When is Laravel Scout's observer-based sync not enough?
- Important 11 — Why would you pick Meilisearch over PostgreSQL FTS, and what do you give up?
Vector Search & pgvector
Open the chapter · 12 questions
- Important 1 — Why does
ORDER BY 1 - (embedding <=> :q) DESC LIMIT 10not use an HNSW index, and how do you fix it? - Important 2 — A query with
WHERE tenant_id = 7 ORDER BY embedding <=> :q LIMIT 10returns 0 rows although the tenant has thousands of documents. Why, and what are three fixes? - Important 3 — When are cosine and inner product rankings identical?
- Must-know 4 — What is recall@10 and how do you measure it in Postgres?
- Must-know 5 — Why must IVFFlat be built after data is loaded?
- Important 6 — HNSW build takes 67 seconds instead of 7 seconds. What is the most likely cause?
- Must-know 7 — You switch embedding models from 1536 to 1024 dimensions. What is the safe sequence?
- Good to know 8 — What does
hnsw.iterative_scan = strict_orderguarantee, and what does it not? - Important 9 — Why is a shared HNSW index across tenants a recall risk?
- Must-know 10 — When is a dedicated vector database a better choice than pgvector?
- Good to know 11 — Why use Reciprocal Rank Fusion instead of adding BM25 and cosine scores?
- Good to know 12 — How big is a 1536-dimension
vectorand ahalfvecof the same size?
Messaging
Messaging Fundamentals: Queues, Topics & Async
Open the chapter · 11 questions
- Must-know 1 — Name the four benefits of asynchronous messaging and the three costs it brings.
- Must-know 2 — What is the difference between a command and an event, and is it a broker feature?
- Must-know 3 — What happens to a message in a RabbitMQ queue, a Kafka topic and a Redis stream after a consumer reads it?
- Must-know 4 — How can a Kafka topic be both publish/subscribe and point-to-point?
- Must-know 5 — Why is a RabbitMQ durable queue not enough to survive a restart?
- Must-know 6 — Who pushes and who pulls?
- Important 7 — Which party owns "ack after the work" and which owns "wait for the confirm"?
- Must-know 8 — Why can a Laravel job dispatched inside a database transaction fail, and how do you prevent it?
- Important 9 — Which drivers does Laravel 13 ship for queues?
- Good to know 10 — How many EIP patterns are there, and which chapter owns Pipes and Filters?
- Must-know 11 — For a flash sale, would you choose a queue, a topic or RPC to take the orders, and what must you watch?
Integration Styles & Channels: File, Shared DB, RPC, Messaging
Open the chapter · 11 questions
- Must-know 1 — What are the four integration styles and the main weakness of each?
- Important 2 — Why is Publish-Subscribe described as built from Point-to-Point channels?
- Important 3 — When should you choose one channel per message type over a shared channel with a type header?
- Important 4 — How does an Invalid Message Channel differ from a Dead Letter Channel?
- Important 5 — Which settings together give Guaranteed Delivery on RabbitMQ, on Kafka and on Redis Streams?
- Important 6 — Why does a bridge ack the source only after the target confirmed?
- Good to know 7 — How do you stop two mirrored brokers from passing a message back and forth?
- Important 8 — Kafka has no per-message TTL. How do you implement Message Expiration there?
- Good to know 9 — What are the three fields of a Message Sequence, and how does the receiver cope with duplicates?
- Must-know 10 — What is the difference between a Message Bus, a Message Broker and an ESB?
- Must-know 11 — Why dispatch the event after the transaction commits in Laravel?
Delivery Guarantees: At-Most-Once, At-Least-Once, Exactly-Once
Open the chapter · 11 questions
- Must-know 1 — A producer times out waiting for an ack. Why can it not know whether to retry?
- Must-know 2 — A Kafka consumer commits offsets, then processes the batch, then crashes. What semantics is that?
- Must-know 3 — What exactly does
enable.idempotence=trueprotect against, and what not? - Good to know 4 — Your Kafka Streams app reads
payments, writesscores, and also inserts into PostgreSQL in the same loop. Which effects are exactly-once with EOS enabled? - Important 5 — What is a zombie producer and how does Kafka stop it?
- Important 6 — A RabbitMQ publisher in confirm mode gets
basic.ackbut the message is in no queue. How? - Important 7 — Why can an acknowledged Redis Streams
XADDbe lost? - Must-know 8 — A Laravel job implements
ShouldBeUniqueand still charges twice. Give two ways that can happen. - Must-know 9 — How do you get exactly-once effect into a database from Kafka without Kafka transactions?
- Good to know 10 — How do sequence numbers detect loss, and what loss can they miss?
- Must-know 11 — Which semantics would you choose for an audit trail, and why?
Message Acknowledgment: ack/nack, Offsets, PEL & Redelivery
Open the chapter · 11 questions
- Must-know 1 — What does an ack change in RabbitMQ, Kafka and Redis Streams?
- Must-know 2 — A consumer acks first and then crashes while processing. What is the delivery semantics, and what is lost?
- Must-know 3 — Why does ack-after-side-effects still need an idempotent handler?
- Good to know 4 — Delivery tags 5 to 8 are unacked and tag 6 failed. Why is
basic.ack(8, multiple=true)wrong? - Must-know 5 — After handling record 9 on a partition, which offset do you commit, and why?
- Important 6 — A Redis consumer dies holding an entry. When is it redelivered?
- Good to know 7 — A quorum queue consumer uses
basic.nackwith requeue for a poison message on RabbitMQ 4.3. What happens? - Must-know 8 — What do
max.poll.interval.msandsession.timeout.mseach detect? - Must-know 9 — A Laravel job runs 100 s and
retry_afteris 90. What goes wrong? - Important 10 — Name the three numbers you alert on for stuck messages.
- Important 11 — Why is
redeliverednot enough for deduplication?
Ordering & Partitioning: Keys, Head-of-Line Blocking
Open the chapter · 11 questions
- Must-know 1 — Why does a single Kafka partition give total order, and what does it cost?
- Must-know 2 — You partition
orders.eventsbyevent_id. What breaks? - Important 3 — A topic has 6 partitions and one tenant produces 50% of the events, keyed by
tenant_id. You raise partitions to 24. What happens? - Important 4 — Under which exact Kafka producer settings can retries reorder records?
- Important 5 — A Go producer (franz-go) and a Laravel producer (laravel-kafka) write the same keys to one topic. What must you configure?
- Good to know 6 — On RabbitMQ, why is
x-modulus-hashpreferred overx-consistent-hashfor ordering? - Must-know 7 — Your consumer keeps failing on one message. You send it to a DLQ after 5 tries and continue. What is the ordering risk, and the alternative?
- Important 8 — Two Redis Streams consumers in one group read
user-events. Is per-user order preserved? - Important 9 — Why is
WithoutOverlappingnot an ordering guarantee in Laravel? - Important 10 — Your consumer processes keys in parallel with per-key lanes. Offsets 100 (key A) and 101 (key B) are in flight; 101 finishes first. What do you commit?
- Good to know 11 — When is a version check not enough?
Idempotent Consumers & the Inbox Pattern
Open the chapter · 11 questions
- Must-know 1 — Why can an at-least-once broker never be fully safe without consumer-side dedup?
- Must-know 2 — Why does a
SELECTbefore theINSERTnot make dedup safe? - Must-know 3 — What goes wrong with "mark then process" in two commits?
- Must-know 4 — Why must the mark and the effect be in one transaction, and what limits that?
- Important 5 — Name three sources of an idempotency key and one weakness each.
- Important 6 — How do you choose the TTL of dedup rows?
- Good to know 7 — Why can partitioning the inbox by
processed_atbreak dedup? - Important 8 — Why are Kafka's exactly-once transactions not an inbox?
- Must-know 9 — What is the difference between
ShouldBeUniqueand an idempotent consumer? - Important 10 — How does a version check make a projection idempotent and order-tolerant?
- Must-know 11 — A third-party webhook can arrive five times over three days. What key and window?
Message Design & Schema Evolution
Open the chapter · 12 questions
- Must-know 1 — Which fields belong in the envelope rather than the payload, and why?
- Important 2 — A consumer handling
payment.captured(idm2, correlationm1) publishesorder.confirmed. What are its correlation and causation ids? - Must-know 3 — Your registry is in
BACKWARDmode. Which do you deploy first, producers or consumers? - Good to know 4 — Why does Confluent recommend
BACKWARD_TRANSITIVEfor Protobuf, and why does it matter for Kafka replays? - Important 5 — In Avro, you add
currencywithout a default. Which mode rejects it and why? - Important 6 — You removed Protobuf field 3. What must you do with its number and name?
- Must-know 7 — When is a thin event the better choice than event-carried state transfer?
- Good to know 8 — What exactly is in the first five bytes of a Confluent-serialized Kafka value?
- Important 9 — A 1.4 MB JSON event compresses to 300 KB with lz4. Which Kafka limit stops it with default settings?
- Must-know 10 — Name three pitfalls of passing an Eloquent model to a queued Laravel job.
- Important 11 — In a claim check, who deletes the stored object, and when?
- Important 12 — Why should a consumer's JSON Schema not use
additionalProperties: false?
Message Transformation: Translator, Enricher, Normalizer, Canonical Model
Open the chapter · 11 questions
- Important 1 — What is the difference between a Content Filter and a Message Filter, and which one is the Kafka Connect
FilterSMT? - Must-know 2 — A partner sends
19,99EUR with a decimal comma and another sends1999JPY in minor units. What must the translator know to produce one canonical amount? - Important 3 — Why does the Normalizer have a router and separate translators instead of one parser?
- Must-know 4 — An enrichment lookup times out and the cache is cold. What should the pipeline do, and why?
- Good to know 5 — Name the layers of a signed, encrypted, enveloped message and the unwrap order.
- Important 6 — When does a Canonical Data Model hurt?
- Important 7 — Which Kafka Streams operator should a Translator use, and why not
map? - Must-know 8 — Can RabbitMQ transform a message body on the broker?
- Important 9 — Why must output event ids be deterministic, and how does the example achieve it?
- Good to know 10 — If streaming parsing is not faster on your host, why use it?
- Important 11 — What belongs in an Invalid Message Channel record, and what does not?
RabbitMQ in Depth
Open the chapter · 12 questions
- Must-know 1 — A publisher sends persistent messages to a durable classic queue without confirms, and the node crashes. Can messages be lost?
- Good to know 2 — Your quorum queue keeps redelivering a poison message forever on 4.3 even though
delivery-limitis 10. Why? - Important 3 — Can you turn an existing classic queue into a quorum queue with a policy?
- Must-know 4 — Why should a two-node cluster be avoided?
- Important 5 — Your producers hang but consumers keep working. What is the likely cause and the first command?
- Important 6 — You need to rebuild a read model from last week's events. Which queue type supports that and how do you start reading?
- Important 7 — Name three ways to delay a message on RabbitMQ 4.4 and the one to avoid.
- Important 8 — A message is published to a topic exchange with no matching binding and no alternate exchange,
mandatory=false, in confirm mode. What does the publisher get? - Good to know 9 — How does
laravel-queue-rabbitmqimplementrelease(60)? - Important 10 — Why can't one RabbitMQ queue use all 16 cores, and what do you do about it?
- Must-know 11 — Two regions need each other's order events. Cluster or federation?
- Good to know 12 — What does amqp091-go's experimental recovery do with publishes waiting for a confirm when the connection drops?
Kafka in Depth
Open the chapter · 12 questions
- Good to know 1 — A topic has RF 3 and
min.insync.replicas=1. Two followers fall out of the ISR and the leader then dies after acknowledging anacks=allwrite. What happens to that write? - Important 2 — Why does a consumer only read up to the high watermark, and what is the LSO?
- Good to know 3 — What problem did the leader epoch (KIP-101) solve?
- Must-know 4 — A Go service and a Laravel service produce events keyed by order id to the same topic. Events for one order arrive out of order. Why?
- Important 5 — Does
enable.idempotence=trueprotect you when your pod restarts and resends the last batch? - Must-know 6 — Your consumer sometimes takes 8 minutes for one batch. What breaks and how do you fix it?
- Good to know 7 — What is the difference between eager, cooperative and KIP-848 rebalancing?
- Good to know 8 — When would you choose a share group over a consumer group?
- Important 9 — Which metric tells you
acks=allwrites are being rejected right now? - Must-know 10 — Why is a compacted topic a good source for rebuilding a cache, and what must every record have?
- Important 11 — What does KRaft replace, and what still does not use Raft?
- Must-know 12 — Name three situations where Kafka is the wrong choice.
Redis Streams & Pub/Sub
Open the chapter · 11 questions
- Must-know 1 — A Laravel app publishes jobs with
Redis::publishand one worker subscribes. The worker is redeployed for 20 seconds. What happens to jobs published meanwhile, and what doespublishreturn? - Must-know 2 — Why does
BRPOPlose a job when a worker crashes, and what doesBLMOVEchange? - Important 3 — Which keys does Laravel's redis driver use for queue
default, and what happens when a job runs longer thanretry_after? - Important 4 — What is the difference between
XREADGROUP ... STREAMS k >andXREADGROUP ... STREAMS k 0? - Important 5 — Consumer C1 died with 30 entries pending. Does Redis give them to C2 automatically? What do you run?
- Important 6 — Why can two consumers in one group process events of the same order out of sequence, and how do you prevent it?
- Good to know 7 — You run
XADD ... MAXLEN ~ 10000and one group is 50,000 entries behind. What happens? - Good to know 8 — Your consumer acked an entry, then the primary failed over. Why might the entry be processed again?
- Important 9 — Why must a messaging Redis use
maxmemory-policy noeviction? - Important 10 — Group lag is 0 but pending is 5,000 and growing. What is wrong?
- Must-know 11 — Name three situations where Kafka or RabbitMQ is the better choice than Redis Streams.
Broker Comparison & Decision Guide
Open the chapter · 10 questions
- Must-know 1 — A teammate proposes Kafka for 80 jobs/s of image resizing. What do you say, and what do you propose?
- Must-know 2 — Why can "RabbitMQ can replay" be wrong?
- Important 3 — What does a returned Kafka offset prove, and what does it not?
- Must-know 4 — Give the ordering unit for Kafka, SQS FIFO, Pub/Sub and RabbitMQ.
- Must-know 5 — Why is pub/sub unsuitable for a payment event?
- Important 6 — How do you move one consumer group from RabbitMQ to Kafka safely?
- Good to know 7 — What is the retention of SQS by default, and the maximum?
- Important 8 — Why does the Go Kafka adapter stop at a failing record?
- Must-know 9 — When do you add a broker to a Laravel app?
- Important 10 — Compute the stored volume for 1,000 msg/s of 1 KB retained 7 days with replication factor 3.
Other Brokers: NATS, Pulsar, SQS/SNS & Pub/Sub
Open the chapter · 12 questions
- Must-know 1 — Why does an SQS message come back even though a worker received it?
- Important 2 — What does
MessageGroupIddo on a FIFO queue, and what does it do on a standard queue? - Must-know 3 — Why put an SQS queue behind each SNS subscriber?
- Good to know 4 — In Pub/Sub, what happens to ordered delivery if a publish for an ordering key fails?
- Must-know 5 — What is the difference between a JetStream stream and a consumer?
- Important 6 — What happens to a JetStream message when
MaxDeliveris reached? - Important 7 — Which Pulsar subscription type lets many consumers share one topic as a queue, and which preserves per-key order?
- Good to know 8 — Why is Pulsar geo-replication not an active-active consumer setup?
- Good to know 9 — When would you pick Service Bus sessions over SQS FIFO?
- Must-know 10 — What does MQTT QoS 1 actually guarantee, and what does it not?
- Must-know 11 — Why is ZeroMQ not a replacement for RabbitMQ?
- Important 12 — How should Laravel's
timeoutrelate toretry_afterand the SQS visibility timeout?
Routing Topologies: Fan-out, Topic & Content-Based
Open the chapter · 10 questions
- Must-know 1 — A queue is bound to a topic exchange with
sales.order.*andsales.#. A message with keysales.order.placedarrives. How many copies does the queue get? - Must-know 2 — Which keys does
audit.events.#match amongaudit.events,audit.events.orders.placed,audit.users? - Good to know 3 — Why does an alternate exchange on
sales.eventsnever fire in the worked example? - Important 4 — You need SMS for VIP customers and email for everyone else, chosen by two attributes. Which exchange type and which
x-match? - Must-know 5 — Why should
customer.createdandcustomer.address-changedshare a Kafka topic? - Important 6 — Your Kafka topic
sales.order.events.v1has 6 partitions and you need 24 consumers in one group. What happens if you raise partitions to 24? - Important 7 — Name three ways to stop a typo from creating a Kafka topic or reaching the wrong tenant.
- Important 8 — Two streams
t:{acme}:sales.order.eventsandt:{acme}:notifications.sms.events: can a Redis ClusterMULTItouch both? Andsales.order.eventswithbilling.invoice.events? - Important 9 — In Laravel with laravel-queue-rabbitmq and
exchange => 'sales.events', what doesonQueue('sales.order.placed.v1')mean, and which queue does Fulfilment's worker read? - Must-know 10 — When is a consumer-side filter on Kafka acceptable, and when should you split the topic?
Advanced Routing: Splitter, Aggregator, Resequencer, Scatter-Gather, Routing Slip, Process Manager
Open the chapter · 10 questions
- Good to know 1 — Name the three design items Hohpe & Woolf list for an Aggregator and the two you must add in production.
- Important 2 — Why must the Splitter derive part ids from the element instead of generating random UUIDs?
- Important 3 — Two aggregator instances process the last two parts of order 42 at the same moment. What prevents two
OrderShippedevents? - Important 4 — A part arrives after the aggregate timed out and was published as failed. What should happen?
- Important 5 — Why is
errgroup.WithContexta poor fit for Scatter-Gather? - Important 6 — When does a Resequencer give up on a missing sequence number, and what must it do when it does?
- Good to know 7 — Which RabbitMQ feature implements a Recipient List without N publishes, and what does BCC add?
- Important 8 — Why is the correlation id also the Kafka record key in the shipment example?
- Important 9 — What makes Laravel's
Bus::chaina Routing Slip, and what does it lack compared to a Process Manager? - Must-know 10 — In the fulfilment example, which features make it a Process Manager, and which make it a Saga too?
Consumer & Endpoint Patterns: Polling vs Event-Driven, Selective, Durable Subscriber, Transactional Client
Open the chapter · 10 questions
- Good to know 1 — Why does the EIP say an Event-Driven Consumer "may or may not" be event-driven underneath?
- Must-know 2 — Which RabbitMQ call is the polling form, and what do the docs recommend?
- Important 3 — What exactly makes a Kafka subscriber "durable", and how can that durability end silently?
- Must-know 4 — A RabbitMQ queue is durable but messages disappear after a broker restart. Why?
- Important 5 — Why is a client-side Selective Consumer a smell at scale, and what is the alternative?
- Good to know 6 — What does RabbitMQ's
txclass cover, and what does it not? - Must-know 7 — How does Laravel make dispatch-inside-a-transaction safe, and what gap remains?
- Good to know 8 — Is Laravel Horizon an EIP Message Dispatcher?
- Important 9 — Why should the shutdown path cancel the consumer before closing the channel?
- Important 10 — What is the Redis Streams resume path for a durable subscriber after a crash?
Competing Consumers & Scaling Consumers
Open the chapter · 11 questions
- Important 1 — A RabbitMQ queue has 4 consumers with prefetch 50, and jobs take between 10 ms and 30 s. Two consumers are idle while the queue still has messages. Why, and what do you change?
- Must-know 2 — A Kafka topic has 8 partitions and the group has 12 replicas. What do the extra 4 do?
- Must-know 3 — A consumer takes up to 7 minutes on some batches and keeps getting kicked out of the group. Which setting is involved and what are two fixes?
- Important 4 — What does
group.instance.idchange during a rolling deploy, and what is the price? - Good to know 5 — Under
group.protocol=consumer, you setsession.timeout.ms=120000on the client. What happens? - Good to know 6 — When would you pick a Kafka share group over a consumer group?
- Important 7 — A Redis Streams worker was OOM-killed. Its entries never come back. Why, and how do you fix it permanently?
- Must-know 8 — How many Laravel workers do you need for 900 jobs per minute averaging 2 s, at 70% target utilisation?
- Important 9 — Why is CPU a poor autoscaling signal for consumers, and what do you use per broker?
- Must-know 10 — Write the five steps of a graceful consumer shutdown in order.
- Must-know 11 — A Go Kafka consumer processes records of one partition with 16 goroutines and commits the highest offset seen. What can go wrong?
Request-Reply over Messaging & REST vs AMQP
Open the chapter · 12 questions
- Important 1 — Name the three EIP patterns that together make request-reply work and what each one adds.
- Must-know 2 — A client sends five requests quickly over one reply queue. Why can replies arrive in a different order, and what lets the client cope?
- Good to know 3 — List four documented limits of RabbitMQ Direct Reply-To.
- Important 4 — A caller times out at 2 s and the replier answers at 3 s. What happens, and which two settings reduce the waste?
- Must-know 5 — Why does a duplicate reply appear, and where must it be handled?
- Must-know 6 — Explain why sync over async exhausts a web server even though a queue sits in the middle.
- Must-know 7 — What must a
202response contain, and what must the status resource be able to say? - Important 8 — Why are
correlation_idandtraceparentboth needed? - Important 9 — Give three reasons request-reply on Kafka is awkward.
- Must-know 10 — When is REST or gRPC simply the right answer?
- Important 11 — Why subscribe before publishing when you use Redis Pub/Sub for a reply?
- Important 12 — In Laravel, why use
afterCommit()on the job andShouldDispatchAfterCommiton the event?
Transactional Outbox Pattern
Open the chapter · 10 questions
- Must-know 1 — Why do publish-before-commit and publish-after-commit both fail?
- Important 2 — Which condition is missing if an outbox model uses the default database while the order uses a named connection?
- Must-know 3 — What happens after the broker accepts an event but the relay crashes before marking it?
- Important 4 — Why can a
WHERE id > last_seenpolling cursor lose an event? - Good to know 5 — Does an ownership-checked marker stop an expired relay from publishing?
- Good to know 6 — Why cannot the polling relay update
published_aton a table used by EventRouter unchanged? - Important 7 — Why is Kafka flush success alone insufficient for the PHP adapter?
- Important 8 — What should happen if a Redis transaction appends one event and another command fails with WRONGTYPE?
- Important 9 — Which two retention periods must be coordinated with replay?
- Important 10 — Why might more relay workers fail to reduce the oldest pending age?
Saga Pattern
Open the chapter · 10 questions
- Must-know 1 — Why does a local rollback not undo a remote charge?
- Must-know 2 — Why must compensation release a reservation instead of restoring an old stock count?
- Important 3 — What is different about a declined payment and a timed-out payment?
- Important 4 — Which three fields correlate a reply with the current transition?
- Good to know 5 — Why can an undo need a tombstone even when nothing exists to undo?
- Must-know 6 — Does a Kafka transaction make PostgreSQL state and payment capture atomic?
- Important 7 — What recovers a lost Laravel after-commit send in this example?
- Important 8 — What happens when shipment retries are exhausted after the pivot?
- Important 9 — Why is catching PostgreSQL 23505 and committing the same failed transaction incorrect?
- Good to know 10 — Can compensations always run in exact reverse order?
Dead-Letter Queue (DLQ)
Open the chapter · 10 questions
- Must-know 1 — Why is acknowledging before parking unsafe?
- Important 2 — Why can publish-before-commit still create duplicates?
- Good to know 3 — What does RabbitMQ
x-death.count=3prove? - Good to know 4 — Which settings make quorum DLX transfer at least once?
- Important 5 — Why can committing a later Kafka message lose an earlier failed one?
- Good to know 6 — Why does the Redis script omit
XDEL? - Important 7 — Does an idle Redis claim prove the previous worker stopped?
- Must-know 8 — Why should replay preserve the business event ID?
- Good to know 9 — Can
failed()rely on properties assigned inside Laravelhandle()? - Important 10 — When is parking the wrong response to a failed record?
Retry, Backoff & Delayed Delivery
Open the chapter · 10 questions
- Must-know 1 — A billing POST times out. Why is immediate repetition unsafe even if the error is transient?
- Must-know 2 — Three layers each allow three total attempts. How many calls can reach the final dependency?
- Must-know 3 — What is the difference between cap, attempt budget and deadline?
- Good to know 4 — Why can an expired RabbitMQ message still occupy a mixed-TTL queue?
- Important 5 — A RabbitMQ publish is confirmed but mandatory routing returned the message. May the source be ACKed?
- Important 6 — Why does a retry topic break original per-key completion order even if the key is unchanged?
- Good to know 7 — What goes wrong when Redis uses the whole payload as the ZSET member?
- Important 8 — How should a valid
Retry-Afterbeyond the job deadline be handled? - Important 9 — Does defining Laravel
tries=6andretryUntil()enforce both limits? - Must-know 10 — Why is a successful Lua move not an exactly-once business guarantee?
Durable Workflows & Jobs
Open the chapter · 10 questions
- Must-know 1 — A provider succeeded but the worker died before reporting. What can the engine safely assume?
- Important 2 — Why is
workflow.Nowallowed wheretime.Nowis not? - Important 3 — Which timeout limits all activity attempts together?
- Important 4 — Does a successful Signal call prove that an approval email was sent?
- Important 5 — What survives Continue-As-New, and what must be passed explicitly?
- Good to know 6 — Why can a database reconciler miss a workflow if it scans only step rows?
- Must-know 7 — Does
WithoutOverlappingreplace version checks and idempotency? - Important 8 — Why is retrying a nondeterminism error indefinitely unhelpful?
- Good to know 9 — When may an advisory wake-up for a future wait be acknowledged?
- Good to know 10 — What evidence distinguishes host-only checks from durable integration validation?
Event-Driven Architecture
Open the chapter · 11 questions
- Must-know 1 — A message is named
InvoiceShouldBeCreatedand Orders waits forInvoiceCreated. What is wrong? - Must-know 2 — Why can a thin
OrderChanged {id}lead to a consumer acting on the wrong data? - Must-know 3 — Mail needs the customer's e-mail but
OrderPlacedonly hascustomerId. Should you add the e-mail to the order event? - Must-know 4 — What does
ShouldDispatchAfterCommitguarantee and what does it not? - Important 5 — A new Kafka consumer group shows no historical orders. Name two possible causes.
- Important 6 — Why must the Kafka projection stop and recreate its client after a failed batch?
- Must-know 7 — RabbitMQ acked a publish. Did any subscriber receive it?
- Important 8 — How can a Redis Streams group lose events it never acknowledged?
- Must-know 9 — Shipping receives a valid
OrderPlacedfor an embargoed country. Should it reject the event? - Important 10 — What is the difference between
correlationidandcausationid? - Must-know 11 — A user places an order and the "My orders" list is empty. Give two fixes.
Event Sourcing & CQRS
Open the chapter · 11 questions
- Important 1 — Why does a
bigserialcursor lose events even without rollbacks? - Good to know 2 — What does the allocator lock cost, and what are the alternatives?
- Important 3 — Why is expected version not enough for a client retry?
- Important 4 — When may a snapshot be trusted on load?
- Must-know 5 — Why must a projection update its rows and checkpoint in one transaction?
- Good to know 6 — A projector meets
MoneyWithdrawnv3 but knows v2. What should it do? - Must-know 7 — Is a system that uses separate command and query handlers on one PostgreSQL database CQRS?
- Important 8 — How do you rebuild a read model without showing users a half-empty table?
- Must-know 9 — Why can a compacted Kafka topic not replace the event store?
- Good to know 10 — What does deleting a subject key achieve, and what does it not?
- Good to know 11 — Why does the Redis relay read the entry back after an "equal or smaller" error?
Change Data Capture (CDC)
Open the chapter · 11 questions
- Important 1 — Why can a stopped Debezium connector bring down a PostgreSQL server?
- Good to know 2 — What is the difference between
restart_lsnandconfirmed_flush_lsn? - Important 3 — Why is "skip every event with an LSN at or below the highest one applied" unsafe?
- Good to know 4 — Which Debezium setting must you change to make a consumer fail on truncates?
- Good to know 5 — A RabbitMQ consumer receives the bytes
default. What happened? - Must-know 6 — Why does the sink keep a deleted marker instead of deleting the document?
- Important 7 — When can a compacted Kafka topic not rebuild a projection?
- Good to know 8 — What do the low and high watermarks do in an incremental snapshot?
- Important 9 — Why must the schema history topic have one partition?
- Must-know 10 — Why does the Kafka consumer stop after a failed record instead of continuing?
- Good to know 11 — What does HTTP 409 mean for the Elasticsearch sink?
Stream Processing: Windows, Watermarks & State
Open the chapter · 10 questions
- Must-know 1 — A phone buffers an order placed at 12:04:10 and sends it at 12:08:55. Which minute is it in, by event time and by ingestion time with
LogAppendTime? - Must-know 2 — With 10-minute windows advancing every 5 minutes, which windows contain 12:07?
- Important 3 — Two partitions have maxima 12:05:00 and 12:01:30, out-of-orderness 30 s. What is the watermark, and what happens if the second partition goes silent?
- Good to know 4 — Why does a single eviction rule (end + lateness ≤ watermark) for both state deletion and refusal matter?
- Important 5 — Which accumulation mode suits a sink that upserts by (region, window start), and which suits a counter that can only add?
- Good to know 6 — Why does a session merge need retractions?
- Must-know 7 — What does
exactly_once_v2make atomic, and what does it not cover? - Important 8 — Two topics share the key
customer_id, one has 12 partitions and the other 6. Can Kafka Streams equi-join them? - Good to know 9 — Why can the RabbitMQ hand-rolled window deadlock when prefetch is too small?
- Important 10 — Why are XRANGE time windows on a Redis stream ingestion-time windows?
Backpressure & Flow Control
Open the chapter · 11 questions
- Must-know 1 — Why does a larger buffer not fix sustained overload?
- Must-know 2 — A queue receives 200 messages per second and each message takes 50 ms. How many workers keep it stable?
- Important 3 — With 8 workers in the same case, how fast does the backlog grow and how long does a new message wait after 10 minutes?
- Important 4 — What does RabbitMQ prefetch limit, and what does it not affect?
- Important 5 — What happens when a RabbitMQ node hits
vm_memory_high_watermark? - Important 6 — What is the difference between
drop-headandreject-publish? - Must-know 7 — Why can a Kafka consumer be kicked out of its group even though it is healthy?
- Must-know 8 — Why is
MAXLENon a Redis stream not backpressure? - Important 9 — What does a pause with two thresholds (high and low watermark) prevent?
- Must-know 10 — Why should
--timeoutbe shorter thanretry_afterin Laravel? - Must-know 11 — When is shedding better than scaling?
Messaging Observability & Tracing
Open the chapter · 10 questions
- Important 1 — Why does a consumer trace start fresh when the producer sends no headers?
- Important 2 — Which fields make up
traceparent? - Good to know 3 — When should a consumer span link instead of parenting under the producer span?
- Must-know 4 — Why are trace id and correlation id different identifiers?
- Must-know 5 — Why is queue depth a poor alert?
- Important 6 — What does RabbitMQ's management API return that a plain queue size does not?
- Important 7 — Why can
records-lag-maxmislead when a consumer dies? - Good to know 8 — How does Redis report lag that cannot be determined, and how should a probe handle it?
- Must-know 9 — What should never appear in a message log line?
- Good to know 10 — What burn rate pages for 2 percent of a 30-day budget in one hour?
System Management Patterns: Control Bus, Wire Tap, Detour, Message Store, Test Message
Open the chapter · 10 questions
- Important 1 — Why must a wire tap publish to the main channel before copying?
- Must-know 2 — What distinguishes a Detour from a Wire Tap?
- Important 3 — Why does a control command carry a sequence number and an expiry?
- Good to know 4 — Why keep a true hop count separate from the history trail?
- Important 5 — Why is a magic order id a poor test marker?
- Must-know 6 — What does a RabbitMQ queue purge not remove?
- Important 7 — How do you "purge" a Kafka topic for one consumer group?
- Important 8 — Why is a Message Store not an event store?
- Good to know 9 — What does the Smart Proxy key its table on, and what keeps the table bounded?
- Important 10 — A Redis tap group is created but never acknowledged. What happens?
Laravel Queue Internals
Open the chapter · 11 questions
- Good to know 1 — What does the Redis
popscript do, in order? - Must-know 2 — Why can a job with
#[Timeout(120)]run twice on a connection withretry_after90? - Must-know 3 — What happens to a job when its worker's timeout alarm fires?
- Good to know 4 — Which lock clause does Laravel use on MySQL 5.7, and what is the consequence?
- Important 5 — Why does a rate-limited job with
#[Tries(3)]sometimes fail without running? - Important 6 — When does
ShouldBeUniquerelease its lock, and how can the lock get stuck? - Important 7 — Is
after_commitenough to guarantee the job is queued after the transaction? - Good to know 8 — A batch with
allowFailures()had one failed job. Which callbacks fired? - Important 9 — Why is a failure under the
syncdriver not infailed_jobs? - Important 10 — Why is
mateusjunges/laravel-kafkanot a queue driver? - Must-know 11 — How does Horizon differ from running
queue:workunder Supervisor?
Testing Messaging Systems
Open the chapter · 11 questions
- Must-know 1 — Why prefer a fake to a mock for a publisher?
- Must-know 2 — What does
Queue::fake()not do? - Important 3 — Why create models before
Event::fake()? - Must-know 4 — How do you test a ten-minute backoff quickly?
- Important 5 — What proves a consumer survives a crash before ack?
- Important 6 — Why must a DLQ test cover a failing parking write?
- Must-know 7 — What is the difference between an integration test and a contract test?
- Important 8 — Why would a new Kafka consumer group in a test wait forever?
- Important 9 — How do you isolate tests that share one broker container?
- Important 10 — When is a Redis container needed if miniredis exists?
- Must-know 11 — Name two causes of flaky async tests and a fix for each.
Messaging Security
Open the chapter · 11 questions
- Must-know 1 — Why does TLS alone not satisfy a requirement that broker operators must not read card-holder names?
- Important 2 — A Kafka cluster has SCRAM authentication but no
authorizer.class.name. What can a consumer credential do? - Important 3 — What do
ssl_options.verify = verify_peerandfail_if_no_peer_cert = trueeach contribute in RabbitMQ? - Important 4 — Why is SCRAM preferable to SASL/PLAIN even over TLS?
- Good to know 5 — Write the RabbitMQ permissions for a consumer that may only consume from
orders.billing. - Important 6 — Why can a Redis user with
~tenant1:* +@allstill destroy another tenant's data? - Good to know 7 — Why does the envelope helper generate a new data key for every message?
- Important 8 — Why must a verifier check the HMAC before recording the message id in its replay cache?
- Good to know 9 — How do you honour an erasure request for data in a non-compacted Kafka topic with 90-day retention?
- Important 10 — What does Laravel's
ShouldBeEncryptedleave readable? - Must-know 11 — What is wrong with
kafka-acls --allow-principal User:'*' --operation All --topic '*'as a quick fix?
Go
Toolchain, Modules & Packages: go run/build, go.mod, exports, init, main
Open the chapter · 11 questions
- Important 1 — What does the
goline ingo.modmean since Go 1.21, and how does it differ fromtoolchain? - Must-know 2 — Why does Go not need a lock file?
- Must-know 3 — Which commands fix
no required module provides package ...andmissing go.sum entry ...? - Important 4 — A library tags
v2.0.0. What must change in the repository so users cango getit? - Important 5 — What do
GOPRIVATE,GONOPROXYandGONOSUMDBdo? - Must-know 6 — In which order do package variables,
init()functions andmainrun? - Must-know 7 — What is the difference between a capital letter and
internal/? - Good to know 8 — How do you embed the version into a binary, and why must you give the full import path?
- Important 9 — What two things make a Go build reproducible across directories and machines?
- Important 10 — When should you use a workspace instead of
replace? - Important 11 — Why is
init()discouraged for application code?
Values, Variables, Constants, iota Enums & Zero Values
Open the chapter · 11 questions
- Must-know 1 — What type does
x := 'a'have, and what is its value? - Good to know 2 — Why does
const Four int8 = Huge >> 98compile whenHuge = 1 << 100? - Must-know 3 — What does
var b uint8 = 255; b++do? - Must-know 4 — Why is
err != niltrue whenmayFailreturns a nil*MyErr? - Must-know 5 — What is the difference between
float64(x)andx.(float64)? - Important 6 — What values does
const (A = iota * 10; B; C)produce? - Important 7 — Why should an enum's zero value be
Unknown? - Important 8 — How do you clear a flag bit?
- Important 9 — When are
type A Bandtype A = Binterchangeable? - Good to know 10 — Which tool reports shadowed variables, and is it part of the default
go vet? - Good to know 11 — What is
unsafe.Sizeof("hello")on 64-bit?
Control Flow: if/else, switch, for, labels, break/continue
Open the chapter · 11 questions
- Important 1 — What does
for i := range 3 { }print if the body printsi, and which Go version added it? - Must-know 2 — A loop starts goroutines with
go func() { fmt.Println(i) }(). What do they print on a module withgo 1.21, and withgo 1.24? - Must-know 3 — Why does
breakinside aswitchinside afornot end the loop, and how do you fix it? - Must-know 4 — What are the two values of
for i, r := range "aé"? - Must-know 5 — Why does
for _, it := range items { it.N++ }not change the slice? - Important 6 — A map is ranged and an entry not yet reached is deleted. What happens?
- Must-know 7 — Why is
defer f.Close()inside a loop over 10,000 files a bug? - Good to know 8 — What does an
iter.Seqhave to do whenyieldreturns false? - Good to know 9 — When can
fallthroughnot be used? - Important 10 — Is
time.Ticksafe in a module whose go.mod saysgo 1.22? - Good to know 11 — What does
go build -gcflags=-d=ssa/check_bce/debug=1show?
Functions: Multiple Returns, Variadics, Closures, Recursion, Function Types
Open the chapter · 10 questions
- Must-know 1 — A function receives
s []intand doess = append(s, 1). Does the caller's slice get longer? - Important 2 — What does
DeferDoublesreturn, and why? - Must-know 3 — In a module with
go 1.21, what does a loop that appendsfunc() { print(i) }fori := 0; i < 3; i++print when the functions are run afterwards? And withgo 1.22? - Important 4 — Why can
Sum(xs...)modifyxs[0]whenSum(xs[0], xs[1])cannot? - Must-know 5 — How do you turn a plain function into an
http.Handler? - Important 6 — A closure returned by
Counter()outlives the call. Where does itsnlive? - Good to know 7 — Does Go optimise tail recursion? What happens at a billion levels?
- Important 8 — What is the difference between
g.HelloandGreeter.Hello? - Good to know 9 — Why does vet miss a bad format string in
logf(format string, args ...any) { fmt.Printf(format+"\n", args...) }? - Must-know 10 — A goroutine panics. Can
recoverinmainstop the crash?
Errors, Wrapping, Panic, Recover & Defer
Open the chapter · 11 questions
- Must-know 1 — A repository returns
fmt.Errorf("get user: %v", sql.ErrNoRows)and the handler checkserrors.Is(err, sql.ErrNoRows). What happens, and what are the two correct fixes? - Must-know 2 — What does this print?
for i := 0; i < 3; i++ { defer fmt.Print(i) } - Important 3 — A worker pool's job panics with a nil map write.
mainhasdefer func() { recover() }(). Does the process survive? - Important 4 — Why does
defer func() { logAndRecover() }()fail to recover, whiledefer logAndRecover()works? - Good to know 5 —
errors.Unwrap(errors.Join(a, b))returns what, and how do you check forb? - Must-know 6 — A CLI uses
log.Fatal(err)after opening a temp directory withdefer os.RemoveAll(dir). What goes wrong? - Important 7 — Your API's error rate jumped after you added logging at the handler boundary; most entries are
context canceled. What is going on, and what do you change? - Important 8 — A function
func Validate() error { var e *ValidationErrors; ...; return e }makes every request fail even when valid. Why? - Important 9 — When is panicking acceptable in library code?
- Important 10 — Why is
defer f.Close()fine for a file you read but not for a file you wrote? - Important 11 — Which status should an HTTP API return for
context.DeadlineExceededfrom a downstream call, and what must never be in the body?
Pointers & Memory Model Basics
Open the chapter · 11 questions
- Must-know 1 — What does
p2 := pcopy whenpis a*T? - Must-know 2 — Why does
var p *T; p.Npanic butvar p *T; p.Describe()may not? - Must-know 3 — A function returns
&local. Is that a bug? - Important 4 — Name the two knobs that shape GC behaviour and their defaults.
- Important 5 — What is a write barrier for?
- Important 6 — Why reorder struct fields from large to small?
- Must-know 7 — How do you represent "field not sent" versus "set to empty" in a JSON body?
- Important 8 — Why is
uintptr(unsafe.Pointer(p))stored in a variable dangerous? - Must-know 9 — What does the memory model say about a data race?
- Good to know 10 — When does
runtime.AddCleanuprun, and what must its argument avoid? - Important 11 — What does
atomic.Pointer[T]make atomic?
Arrays, Slices & Maps: make, append, capacity, aliasing, range
Open the chapter · 12 questions
- Must-know 1 —
s := make([]int, 3, 10); t := append(s, 1); u := append(s, 2). What ist[3]? - Must-know 2 — A function receives
s []intand doess = append(s, 99). When does the caller see 99? - Good to know 3 — What capacity does
nextslicecapchoose when a slice of capacity 1024 needs one more element, and why mightcap()show something larger? - Important 4 — Why does
s[2:4:4]protect the caller buts[2:4]does not? - Important 5 — A cache stores
line := data[:80]from a 64 MiB file read. What happens to memory and how do you fix it? - Must-know 6 — Your API returns
{"items": null}for an empty result. Why, and where do you fix it? - Important 7 — Why is
slices.Compact([]string{"b", "a", "b"})still three elements? - Important 8 — Why does
m["acc"].Balance += 5not compile formap[string]Account, and what are the two fixes? - Must-know 9 — Two handlers increment a package-level
map[string]int. What is the failure mode and the fix? - Important 10 — A map grew to 5 million entries during a backfill and then all but 1 000 were deleted. Does the memory come back?
- Good to know 11 — Why is
m[math.NaN()] = 1executed twice a problem? - Important 12 — You sort tickets by priority with
slices.SortFuncand support complains that equal-priority tickets jump around. Two fixes?
Structs, Methods, Constructors, Embedding & Struct Tags
Open the chapter · 10 questions
- Important 1 —
fmt.Println(c)prints{hits 3}butfmt.Println(&c)printshits=3. Why? - Must-know 2 — Why does
m["a"].Inc()not compile whens[0].Inc()does? - Important 3 —
DogembedsAnimaland declaresSound().Animal.Describe()callsa.Sound(). What doesd.Describe()return and why? - Must-know 4 — A struct embeds
AandB, both withClose(). Does it compile? - Must-know 5 — Why should a struct containing
sync.Mutexhave only pointer receivers? - Must-know 6 —
json:nameis on a field and the JSON key is stillName. What happened and what would have caught it? - Important 7 — When should
NewXreturn a value instead of a pointer? - Must-know 8 — Two
Eventstructs hold the same instant but==says they differ. Why, and what should you use? - Good to know 9 — How do you write a generic
DecodeAll[T]that calls a pointer-receiverDecodeon each new element? - Important 10 — Reordering a struct's fields halved its size. When is that worth doing, and when not?
Interfaces, Type Assertions, Type Switches & any
Open the chapter · 11 questions
- Must-know 1 —
func (b *Buffer) Write(p []byte) (int, error)is the only method ofBuffer. Doesvar w io.Writer = Buffer{}compile? - Must-know 2 — A function declared
func check() errordoesvar e *AppErr; return e. What doescheck() != nilgive, and why? - Must-know 3 — What exactly does
var v any = 42; s := v.(string)print when it fails, and how do you avoid the panic? - Important 4 — In
switch x := v.(type) { case int, int64: return x + 1 }, why does this not compile? - Must-know 5 — A webhook sends
{"id": 9007199254740993}and you decode intomap[string]any. What is inm["id"]? - Important 6 — After adding a logging middleware, Server-Sent Events arrive only when the request ends. Why, and what is the modern fix?
- Important 7 — When can
a == bpanic fora, b any? - Important 8 — Where should
type userLookup interface{ Email(ctx context.Context, id int64) (string, error) }live: in theuserspackage or thenotifypackage? - Good to know 9 — Why is
SumIfaceabout four times slower thanSumDirectin the benchmark, and what can remove the difference without changing the API? - Important 10 — You want to retry any error that "knows" its retry delay, whichever package defined it. How?
- Important 11 — When is a type parameter the better choice than an interface?
Generics: Type Parameters, Constraints, Where They Help
Open the chapter · 10 questions
- Important 1 — Why does
Sum([]Cents{1, 2})fail withNumber interface{ int64 | float64 }but work with~int64 | ~float64? - Important 2 — Does
Index([]any{1, "x"}, any("x"))compile? CanIndexon[]anyever panic? - Must-know 3 — Why does
x := Zero()fail whileZero[int]()works? - Good to know 4 — You need a function that creates
[]Tvalues and calls a pointer-receiverSetmethod on each. What is the signature? - Good to know 5 — Why does
slices.Clonehave two type parameters? - Important 6 — Your team proposes changing
func Copy(dst io.Writer, src io.Reader)tofunc Copy[W io.Writer, R io.Reader](dst W, src R)for speed. What do you answer? - Good to know 7 — In Go 1.27, can
func (l L) Map[F any](f func(int) F) []FmakeLimplementinterface{ Map(func(int) int) []int }? - Good to know 8 — Which compiled bodies does gc produce for
Id(1),Id(&A{})andId(new(int))? - Good to know 9 — What must you do after
next, stop := iter.Pull(seq)if you might not read to the end? - Important 10 — Why prefer
atomic.Pointer[Config]overatomic.Valuefor configuration snapshots?
Strings, Runes, fmt Verbs, text/template & regexp
Open the chapter · 12 questions
- Must-know 1 — What are
len("é世")andutf8.RuneCountInString("é世")? - Important 2 — What does
for i, r := range "a\xffb"yield? - Must-know 3 — Why is
s += xin a loop slow, and what replaces it? - Must-know 4 — What does
strconv.Atoi(" 7")return, and how do you inspect the error? - Must-know 5 — What does
fmt.Sprintf("%d", "hi")print, and which tool finds it before production? - Good to know 6 — In what order does
fmtconsiderFormatter,GoStringer,errorandStringer? - Important 7 — Why must
Funcscome beforeParse, and when is a missing struct field detected? - Important 8 — What does
missingkey=errorchange? - Good to know 9 — Why does
regexp.MustCompile("(?=foo)bar")panic, and what is the benefit of that restriction? - Must-know 10 — Where should
MustCompilecalls live? - Important 11 — Why are
علي(Arabic yeh) andعلی(Persian yeh) a problem for unique usernames? - Good to know 12 — When is
unsafe.Stringjustified?
time.Time, Formatting/Parsing, Time Zones, Timers, math/rand & Number Parsing
Open the chapter · 11 questions
- Important 1 — Why can
a == bbe false whilea.Equal(b)is true? - Important 2 — What does
time.Parse(time.DateTime, "2025-03-09 14:05:07")return as its location? - Good to know 3 — Which operations strip the monotonic reading?
- Must-know 4 — How do
AddDate(0, 0, 1)andAdd(24 * time.Hour)differ on 2024-03-10 in New York? - Important 5 — What changed for
Timer.Resetin Go 1.23, and when does it apply? - Must-know 6 — Why is
time.Sleepwrong in a retry loop that must stop on shutdown? - Good to know 7 — When must you import
time/tzdata? - Must-know 8 — Which random package for a password-reset token, and why?
- Important 9 — What does
strconv.ParseInt("128", 10, 8)return? - Must-know 10 — How do you represent 12.34 in a database and in Go code?
- Important 11 — Why does a stale tzdata make a Tehran report wrong in 2023?
Files, Directories, Paths, Temp Files, bufio & embed
Open the chapter · 12 questions
- Must-know 1 — What is the difference between
os.Open,os.Createandos.OpenFile(name, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0o644)? - Important 2 — Why can ignoring the error from
f.Close()lose data? - Important 3 — List the steps of a crash-safe file replace and say what each protects against.
- Must-know 4 — A function does
os.ReadFile(filepath.Join("/srv/public", name))with a name from a URL. Give two attacks and the fix. - Must-know 5 — What does
bufio.Scanner: token too longmean and how do you handle it? - Must-know 6 — Why can a
bufio.Writerlose the last lines of output? - Good to know 7 — Which of these does
go:embedaccept:../shared/x.txt, a symlink,static,all:static? - Important 8 — How do you serve an embedded
static/directory at the site root? - Important 9 — What does
fs.ValidPath("a/../b")return, and why does it matter? - Important 10 — Why must a temp file used for an atomic write be created in the target's directory?
- Good to know 11 — What is the difference between
O_EXCLlock files andflock? - Good to know 12 — Why watch the parent directory with
fsnotifyinstead of the file?
The io Package: Readers, Writers, Pipes & Composition
Open the chapter · 12 questions
- Must-know 1 — A Reader returns
7, io.EOF. What must the caller do? - Important 2 —
io.ReadFull(r, buf[:8])returns5, io.ErrUnexpectedEOF. What happened, and when would it returnio.EOFinstead? - Must-know 3 — Why does
io.Copyreturnniland notio.EOFat the end? - Important 4 — A custom Writer returns
n < len(p), nil. What doesio.Copydo? - Good to know 5 — You wrap an
*os.Filein a counting reader beforeio.Copy(conn, r). What do you lose on Linux, and how do you get it back? - Important 6 — Why does
pr, pw := io.Pipe(); pw.Write(b); pr.Read(p)in one goroutine never finish? - Important 7 — How do you make the reader of a pipe see the producer's failure instead of a clean end?
- Must-know 8 —
io.LimitReader(body, 1<<20)protects memory. What does it not tell you, and how do you fix that? - Must-know 9 — Why must a client drain and close
resp.Body? - Important 10 — A goroutine is blocked in
conn.Read. Your context is cancelled. How does the Read return? - Must-know 11 — You need to send the same in-memory body again on retry.
bytes.Bufferorbytes.Reader? - Good to know 12 — What do
iotest.DataErrReaderandiotest.OneByteReaderfind in your code?
JSON, XML, Struct Tags, Encoder/Decoder, Base64
Open the chapter · 10 questions
- Must-know 1 — A struct has
Age int json:"age,omitempty". A client sends{"age":0}and your service stores it. What does the reply contain, and why can the client not tell the age was received? - Important 2 — Why does
json.Unmarshal([]byte("9007199254740993"), &v)intoanyreturn 9007199254740992, and how do you keep the digits? - Must-know 3 — How do you detect "the key was absent" versus "the key was null" for a PATCH field?
- Important 4 — What does
DisallowUnknownFieldsnot protect against? - Must-know 5 — Write the loop that reads NDJSON from a reader.
- Good to know 6 — A map keyed by an
iotaenum should encode as{"closed":2}. What must the enum type implement? - Must-know 7 — A handler returns a
sql.NullStringfield and the client sees{"String":"","Valid":false}. Why, and what is the fix? - Important 8 — Which base64 encoding do JWT segments use, and what happens if you decode one with
StdEncoding? - Important 9 — Is
encoding/xmlvulnerable to external entity expansion? - Good to know 10 — What changes if you build with
GOEXPERIMENT=jsonv2?
Hashing & Crypto: SHA-256/512, bcrypt, Argon2, crypto/rand
Open the chapter · 10 questions
- Must-know 1 — Why is
sha256.Sum256([]byte(password))a bad password hash even with a salt? - Important 2 — What exactly does
hmac.Equalprotect against thatbytes.Equaldoes not? - Important 3 — You get
bcrypt: password length exceeds 72 bytes. What are your options? - Must-know 4 — Why does reusing a GCM nonce under one key break confidentiality?
- Good to know 5 — What changed about
crypto/rand.Readin Go 1.24? - Important 6 — When is
cipher.NewGCMWithRandomNoncethe better call thanNewGCM? - Important 7 — How do you upgrade stored bcrypt hashes to Argon2id without a password reset?
- Important 8 — Why must ECDH output go through HKDF?
- Important 9 — A function returns
anyfromx509.ParsePKCS8PrivateKey. What must you do next, and why? - Good to know 10 — What does
GODEBUG=fips140=onlydo, and why not in production?
CLI Flags, Subcommands, Environment Variables & Logging (log/slog)
Open the chapter · 12 questions
- Must-know 1 — What is the difference between
os.Getenvandos.LookupEnv, and which one detectsAPP_ADDR=? - Important 2 — Why should a testable CLI use its own
FlagSetwithContinueOnErrorinstead of the globalflag.Parse? - Important 3 — What does
flag.Parsedo withtool in.txt -v? - Must-know 4 — Why does
log.Fatalskip deferred functions? - Important 5 — Which exit code do you return for
tool -nope, which for a failed network call, and which for-h? - Must-know 6 — Where do results, logs and usage text go?
- Good to know 7 — What must a wrapper
slog.Handlerdo inWithAttrsandWithGroup? - Important 8 — How does
slogavoid computing an expensive attribute when the level is disabled? - Important 9 — How do you keep a token out of logs even when someone logs the whole config struct?
- Important 10 — How does the precedence trick avoid special code in the flag layer?
- Must-know 11 — What should a library do instead of calling
log.Printf? - Good to know 12 — Why detect a terminal per stream?
OS Processes, Signals & Graceful Shutdown
Open the chapter · 12 questions
- Must-know 1 — Why is
exec.Command("sh", "-c", "grep "+userInput+" f")dangerous and what is the safe form? - Important 2 — What does
ExitCode()return for a child killed bySIGKILL, and how do you see the signal? - Important 3 — Why can
cmd.Wait()hang after the context deadline fires, and what fixes it? - Important 4 — Why must the stdin writer run in its own goroutine when you also read the child's stdout?
- Must-know 5 — Which signals can a Go program not catch, and what are the consequences?
- Important 6 — Why is
signal.Notifywith an unbuffered channel a bug? - Must-know 7 — After
srv.Shutdown(ctx)is called, what doListenAndServeandServereturn and why does it matter? - Important 8 — Why does a Kubernetes service need a
preStopsleep or drain delay even though it handlesSIGTERM? - Must-know 9 — What is the relationship between
terminationGracePeriodSeconds,preStopand your shutdown timeouts? - Good to know 10 — Why does
flockbeat a plain PID file for single-instance checks? - Good to know 11 — What changed in Go 1.25 about
GOMAXPROCS, and what did it not change? - Must-know 12 — A Go program panics; which exit status does the shell see and do deferred calls run?
reflect: When and How
Open the chapter · 11 questions
- Important 1 —
x := 3.4; v := reflect.ValueOf(x); v.SetFloat(7.1)panics. What is the exact text, and what is the one-line fix? - Must-know 2 —
type Celsius float64. What areTypeOf(Celsius(1)).Kind()andTypeOf(Celsius(1)) == TypeOf(float64(1))? - Important 3 — A struct has a lower-case field
secret int. Which ofType().Field(i),Value.Field(i).Int(),Value.Field(i).Interface()andValue.Field(i).SetInt(1)work? - Important 4 — When must you use
Tag.Lookupinstead ofTag.Get? - Important 5 —
reflect.DeepEqual([]int(nil), []int{})andreflect.DeepEqual(math.NaN(), math.NaN()): results and why? - Important 6 — Why does
reflect.TypeFor[Handle]().Implements(stringerType)return false whilereflect.TypeFor[*Handle]()returns true whenStringhas a pointer receiver? - Must-know 7 — A service does
reflect.ValueOf(svc).MethodByName(r.URL.Query().Get("cmd")).Call(nil). What is wrong and what replaces it? - Good to know 8 — What does a type cache key on, and why does it fix most of the cost?
- Important 9 — Name two situations where generics or
go generateare better than reflection and one where they cannot be used. - Important 10 —
go vetacceptsreflect.ValueOf("x").SetString("y"). What catches it? - Good to know 11 — What does
StructOfrefuse, and what check should you do before calling it with names from a schema?
Goroutines & Channels: Unbuffered, Buffered, Directions, Closing, range
Open the chapter · 11 questions
- Must-know 1 — A function starts five goroutines that each send a result on an unbuffered channel, reads the first result and returns. What happens to the other four, and give two fixes.
- Must-know 2 — What does
v, ok := <-chreturn on a closed channel that still has two buffered values? - Must-know 3 — Why is
wg.Add(1)inside the goroutine wrong, and what reports it? - Important 4 —
go log(time.Now())runs 200 ms later. Which time does it log? - Must-know 5 — Your program prints
fatal error: all goroutines are asleep - deadlock!withgoroutine 1 [chan receive (nil chan)]. What is the likely bug? - Must-know 6 — Who should close a channel that three worker goroutines send on?
- Important 7 — A sender does
ch <- pand then modifiesp.Total. The receiver readsp.Totalafter receiving. Is this safe? - Must-know 8 — You need at most 10 concurrent calls to a provider. Show the smallest mechanism.
- Important 9 — What does
GOMAXPROCScontrol, and what changed in Go 1.25? - Important 10 — When is a mutex a better choice than an owner goroutine with a request channel?
- Important 11 — Does
time.Afterinside afor/selectloop leak?
select: Multiplexing, Non-Blocking Ops, Timeouts, for-select
Open the chapter · 12 questions
- Must-know 1 — Two cases are ready and there is a
default. Which runs? - Important 2 — In
case out <- compute():, iscompute()called when another case wins? - Must-know 3 — What does a receive case on a nil channel do, and why is that useful?
- Must-know 4 — A loop handles
ok == falsefrom a closed input withcontinue. What happens? - Must-know 5 — Why does
case <-time.After(30 * time.Second):inside a for-select fail as a 30-second overall limit? - Good to know 6 — On a module with
go 1.24, do you need to draint.Caftert.Stop()beforet.Reset(d)? - Must-know 7 — You call
cancel()but a goroutine never exits. What is the likely cause? - Important 8 — How do you make channel
highwin overlowwhenever it has data? - Must-know 9 — When is drop-on-full the right policy, and when is backpressure?
- Important 10 — Why can
sync.Condnot replace adonechannel in a worker loop? - Must-know 11 — What does
fatal error: all goroutines are asleep - deadlock!tell you, and why do servers rarely print it? - Important 12 — Why does errgroup's first error not stop a producer blocked on
in <- v?
context: Cancellation, Deadlines, Values
Open the chapter · 12 questions
- Must-know 1 — What do
Done()andErr()return oncontext.Background()? - Must-know 2 — A handler has 800 ms left. It calls
context.WithTimeout(ctx, 5*time.Second)for a query. How long can the query run? - Must-know 3 — Why does vet complain about
ctx, _ := context.WithTimeout(parent, d)even if the code works? - Good to know 4 — You call
cancel(ErrShutdown)on aWithCancelCausecontext. What doctx.Err()andcontext.Cause(ctx)return, and for a grandchild? - Must-know 5 — Your worker receives a canceled context but still processes all 10,000 items. Why?
- Important 6 — When exactly is
r.Context()canceled in anet/httphandler, and what doesServer.Shutdowndo to it? - Important 7 — Why does gRPC send a timeout rather than an absolute deadline to the next server?
- Good to know 8 — With pgx v5 defaults, what happens to the connection when the ctx of a running query is canceled?
- Important 9 — Why is
type key string; ctx = context.WithValue(ctx, key("user"), u)still weaker thantype userKey struct{}? - Important 10 — You need to write an audit row after the response. Why not
go audit(r.Context()), and why notgo audit(context.Background())? - Important 11 — A retry wrapper sees
context.DeadlineExceeded. How does it decide whether to retry? - Good to know 12 — What changed in Go 1.24 for tests, and why does it matter for goroutines started by a test?
sync & atomic: WaitGroup, Mutex, RWMutex, Cond, Once, Pool, Atomic Counters
Open the chapter · 12 questions
- Must-know 1 — A method holding
c.mucallsc.Len(), which also locksc.mu. What happens and how do you fix it? - Must-know 2 — Why does
go vetcomplain aboutfunc (c Counter) Get() intwhenCounterhas async.Mutex? - Good to know 3 — Readers hold an
RWMutexand a writer is waiting. A reader callsRLockagain. What happens? - Must-know 4 — Why must
wg.Add(1)come before thegostatement? - Important 5 —
sync.OnceValues(load)returned an error the first time. What happens on the second call? - Important 6 — Go's
Cond.Waitcannot wake spuriously. Why is theforloop still required? - Important 7 — Name two mistakes that make
sync.Poolslower or wrong. - Important 8 — When is
sync.Mapthe right choice? - Important 9 — Two goroutines update
minLatencyandmaxLatencywith two separate atomics. A reader sees min greater than max. Why? - Important 10 — Why can padding a struct field to 128 bytes make a counter faster?
- Important 11 — CPU usage is 30% but latency is high under load. Which profile do you turn on?
- Must-know 12 — What does
errgroup.Waitreturn when three tasks fail?
Worker Pools, Pipelines, Fan-Out/Fan-In, errgroup, Bounded Concurrency
Open the chapter · 12 questions
- Must-know 1 — A pool has 8 workers and one results channel. Each worker calls
close(results)when itsrange jobsloop ends. What happens, and what is the fix? - Good to know 2 — Why does
after.LoadAllwriteout[i] = pfrom many goroutines without a mutex, and why is that not a data race? - Must-know 3 — You use
g, ctx := errgroup.WithContext(parent)but passparentinto each fetch. What changes? - Important 4 —
g.SetLimit(0)followed byg.Go(f). What happens? - Important 5 — A function starts one goroutine per item that sends its error on an unbuffered channel and returns on the first non-nil error. What is the bug and two fixes?
- Must-know 6 — Your pipeline has a 1 ms source, a 10 ms parse stage and a 2 ms sink. Where do you add goroutines and what throughput do you expect with 5 parsers?
- Important 7 — You need to upload files totalling 3 GB with at most 512 MB in memory at once; sizes vary from 1 MB to 400 MB. Which primitive, and what edge case do you guard?
- Important 8 — Eight workers each create
rate.NewLimiter(10, 1)for a partner limited to 10 requests per second. What rate does the partner see? - Important 9 — A CPU-bound pool uses
runtime.NumCPU()workers in a pod with a 2-CPU limit on a 32-core node, and the module saysgo 1.24. What goes wrong? - Good to know 10 — When is a reorder buffer the wrong choice for ordering?
- Important 11 — What does a graceful drain do differently from canceling the pool's context?
- Important 12 — Name the three metrics every pool should export and what a rising queue depth with constant in-flight at the limit means.
Race Conditions, the Race Detector, Deadlocks, Concurrency vs Parallelism
Open the chapter · 11 questions
- Important 1 — Two goroutines write
cfg.Nameandcfg.Port(different fields of one struct) without locks; a third reads both. Which pairs race? - Must-know 2 —
go test -race ./...passes, yet production double-books seats. Name two reasons. - Important 3 — What do the four sections of a race report tell you, and where is the fix usually?
- Important 4 — A service with an HTTP server hangs. Two goroutines are in
[sync.Mutex.Lock, 40 minutes]. Why did Go not print "all goroutines are asleep"? - Must-know 5 — Why is
if once == false { mu.Lock(); if !once { init(); once = true }; mu.Unlock() }wrong in Go? - Must-know 6 —
Transfer(from, to)locksfromthento. Give the deadlocking schedule and two fixes. - Must-know 7 — A worker pool sometimes finishes "too early" and sometimes hangs at
wg.Wait(). What two mistakes cause each? - Important 8 — An HTTP client starts timing out after a few hundred requests, while the upstream is healthy. What do you look for in the code and in a goroutine dump?
- Must-know 9 — Does
GOMAXPROCS=1maken++from 1000 goroutines safe? What did the lab show? - Good to know 10 — In a
synctest.Test, a test reads a plainboolbefore callingtime.Sleepand the code under test writes it after the fake time advances. Why does-racecomplain even though the blog uses a plain bool? - Must-know 11 — Which of these are race-free: (a) workers write
results[i]andmainreads afterwg.Wait(); (b) workersappendtoresultsunder no lock; (c) workers send on a channel and one collector appends?
Rate Limiting in Go: Token Bucket, Fixed Window, Leaky Bucket, x/time/rate
Open the chapter · 11 questions
- Must-know 1 — What is the maximum number of events
rate.NewLimiter(10, 5)admits in the first second? - Important 2 — Why can
Allowreturning false be called repeatedly without changing the limiter? - Important 3 — What error does
WaitN(ctx, 4)return on a limiter with burst 3, and does it consume tokens? - Important 4 — How do you test
Waitsemantics without sleeping? - Important 5 — A request arrives with
X-Forwarded-For: 1.2.3.4, 198.51.100.9from the proxy10.0.0.2, and10.0.0.0/8is trusted. Which address is the client? - Must-know 6 — Why can a fixed window admit twice the limit?
- Good to know 7 — When is evicting an idle per-key limiter invisible to the client?
- Must-know 8 — What is the difference between
AcquireandTryAcquirefor overload? - Important 9 — Which header wins if a response has both
RateLimitandRetry-After? - Important 10 — Why does the Redis limiter read
redis.call('TIME')instead of passing the client'stime.Now()? - Must-know 11 — Which gRPC code signals a rate limit?
Testing & Benchmarking: Table-Driven Tests, Subtests, Coverage, httptest
Open the chapter · 13 questions
- Must-know 1 — What is the difference between
t.Errorandt.Fatal, and when do you use each? - Must-know 2 — Why write table-driven tests with
t.Runinstead of one function per case? - Important 3 — A parent test calls
t.Runwith parallel subtests and then closes a shared server withdefer. What goes wrong? - Must-know 4 — What does
t.Helper()change, and why taketesting.TBinstead of*testing.T? - Important 5 — Why can a test that calls
t.Setenvnot callt.Parallel? - Important 6 — When is
TestMainthe right tool, and what are the two mistakes people make in it? - Must-know 7 — How do
httptest.NewRecorderandhttptest.NewServerdiffer, and when do you use each? - Must-know 8 — Why is
for b.Loop()preferred overfor range b.Nsince Go 1.24? - Important 9 — Your benchmark is 4 % faster after a change. Is it?
- Important 10 — What does
-covermode=atomicdo, and how do you measure coverage of an integration test that runs a built binary? - Must-know 11 — What happens to a fuzz test in a plain
go testrun, and what do you do with an input the fuzzer finds? - Good to know 12 — How do you test code that expires sessions after 30 minutes without waiting 30 minutes?
- Good to know 13 — What usually makes a test flaky, and which
go testflags help expose it?
Mocking with Interfaces, Dependency Injection for Testability, testify
Open the chapter · 12 questions
- Must-know 1 — Who should declare the interface a function takes, and what should the implementing package return?
- Must-know 2 — What is the difference between a stub, a spy, a fake and a mock?
- Must-know 3 — How do you test code that depends on
time.Now()? - Important 4 — Why can
err != nilbe true when a function "returns nil"? - Important 5 — What does
sqlmockprove and what does it not? - Must-know 6 — Why does Go culture warn against defining interfaces "for mocking"?
- Must-know 7 — What is a composition root and where is it in a Go program?
- Important 8 — When would you choose
wireoverfx, and when neither? - Must-know 9 — What is wrong with a package-level variable assigned in
init()as a dependency? - Important 10 — How do you keep an in-memory fake honest?
- Good to know 11 — Why use testify's
requirefor setup errors andassertfor value checks? - Good to know 12 — How does a service locator differ from dependency injection in failure behaviour?
Project Layout, golangci-lint, Makefile, Docker & Multi-Binary Builds
Open the chapter · 13 questions
- Must-know 1 — What does
internal/do, and who can importmodule/internal/x? - Must-know 2 — Do you need
pkg/in a Go service? - Must-know 3 — Is golang-standards/project-layout an official standard?
- Important 4 — Why keep
maintiny and put logic behind arunfunction? - Important 5 — A teammate sets
-ldflags "-X main.version=v1"and nothing changes. Why? - Must-know 6 — What do
-trimpathandCGO_ENABLED=0buy you? - Must-know 7 — What is the difference between the
goline and thetoolchainline, and what doesGOTOOLCHAIN=localdo? - Important 8 — How do you make golangci-lint adoptable in a large legacy repository?
- Important 9 — Why does
go build ./cmd/...leave no files behind, and how do you fix it? - Important 10 — When would you use
go mod vendor, and what doesgo mod verifycheck? - Must-know 11 — Why a multi-stage Dockerfile, and
scratchor distroless? - Important 12 — What does
govulncheckadd over a CVE list? - Good to know 13 — How do you make a release build reproducible?
net/http: Server, Client, 1.22 Routing, Path & Query Params
Open the chapter · 14 questions
- Must-know 1 — Why is
http.ListenAndServe(":8080", mux)unsafe on the internet, and what do you write instead? - Must-know 2 — You register
GET /posts/{id}andGET /posts/latest. Which handlesGET /posts/latest, and does registration order matter? - Must-know 3 — What does the pattern
/match, and how do you serve a home page only at/? - Important 4 — A POST has
?name=qin the URL andname=bin a url-encoded body. What dor.FormValue("name")andr.URL.Query().Get("name")return? - Must-know 5 — How do you stop a client from posting a 2 GB JSON body, and what status do you answer?
- Important 6 — A handler calls
w.WriteHeader(201)and thenw.Header().Set("Location", "/users/7"). What does the client get? - Must-know 7 — What happens to in-flight requests and to
ListenAndServewhen you callsrv.Shutdown(ctx)? - Important 8 — Why does an SSE endpoint die after exactly
WriteTimeout, and how do you fix it without removing the timeout for every route? - Must-know 9 — Your service builds
&http.Client{Transport: &http.Transport{...}}inside every handler and never closes response bodies on error paths. What do you see under load? - Important 10 —
http.Client.Timeoutvs a context fromNewRequestWithContext: what does each cover and why use both? - Important 11 —
client.Doreturnederr == nilandresp.StatusCode == 500. Is that an error, and what must you still do? - Good to know 12 — When is chi worth adding to a Go 1.22+ project, and why are gin and echo a bigger step?
- Good to know 13 — What does
http.CrossOriginProtection(Go 1.25) check, and what does it not protect? - Important 14 — Which
httptesttool do you use to test a handler's status codes, and which to prove connection reuse?
Middlewares: Chaining, Security Headers, CORS, Compression, Response Time, Rate Limiter, Logging, Recover
Open the chapter · 14 questions
- Must-know 1 — What is the type of a Go HTTP middleware, and what three things can it do?
- Must-know 2 —
Chain(a, b, c)(h): in what order do the "before" and "after" parts run? - Must-know 3 — Why does the logging middleware go outside the recover middleware?
- Important 4 — How does a logging middleware learn the status code, and what are the two rules for getting it right?
- Important 5 — After adding a metrics middleware, server-sent events stop streaming. Why, and what is the fix?
- Important 6 — Why must a recover middleware re-panic
http.ErrAbortHandler? - Must-know 7 — A browser call with cookies fails although the API sends
Access-Control-Allow-Origin: *. What is wrong, and what must the response contain instead? - Important 8 — Why does an authentication middleware placed before CORS break the SPA?
- Important 9 — What must a gzip middleware do with
Content-Length,VaryandContent-Encoding, and when should it not compress? - Must-know 10 — Your per-IP rate limiter reads the first address of
X-Forwarded-For. How is it bypassed, and what is correct? - Important 11 — What should the rate limiter middleware answer when a client's bucket is empty, and why not
Wait? - Must-know 12 — How should an auth middleware pass the principal to handlers?
- Good to know 13 — What does
http.CrossOriginProtectioncheck, and which requests does it always allow? - Good to know 14 — What is request coalescing and when is it unsafe?
A REST API in Go: Planning, CRUD, Validation, Repository Pattern, DI, Pagination, Swagger
Open the chapter · 13 questions
- Must-know 1 — Why should a validation failure not return 200 with an error field, and which status and body does this API return instead?
- Must-know 2 — What is the difference between 400, 422 and 409 in this API?
- Must-know 3 — Why decode into a DTO instead of the domain type, and what does
DisallowUnknownFieldsadd? - Must-know 4 — Explain why
OFFSETpagination shows a row twice when a new row is inserted, and how keyset pagination avoids it. - Important 5 — Why must the cursor include a tie-breaker and be opaque?
- Must-know 6 — How does
ETag+If-Matchprevent a lost update, and when does the API return 412 vs 428? - Important 7 — Why does PATCH apply RFC 7396 to the JSON document instead of decoding the patch into a struct?
- Must-know 8 — A client times out on
POST /v1/productsand retries. What makes the retry safe, and what are the 409 and 422 cases? - Important 9 — What is the run function pattern, and why does it help testing?
- Important 10 — Where should the
Repositoryinterface be declared in Go, and why one per aggregate rather than a generic one? - Important 11 — Compare swaggo/swag, oapi-codegen and ogen in one sentence each.
- Good to know 12 — Describe a graceful shutdown that loses no requests behind a load balancer.
- Good to know 13 — Why does this API keep the
ServeMux405 behaviour instead of registering a catch-all"/"handler for JSON 404s?
Authentication in Go: Argon2/bcrypt, Sessions, JWT, Middleware, CSRF, Sanitization, Password Reset
Open the chapter · 14 questions
- Must-know 1 — Why is
sha256(salt + password)not an acceptable password hash, and what do you use in Go instead? - Good to know 2 — What does the PHC string
$argon2id$v=19$m=19456,t=2,p=1$<salt>$<hash>let you do that a bare hash column does not? - Must-know 3 — Your login answers "no such user" in 1 ms and "wrong password" in 15 ms with the same message. What is wrong and how do you fix it?
- Important 4 — What does NIST SP 800-63B-4 require of a password policy, and what does it forbid?
- Must-know 5 — Why must the session ID change at login, and how do you do it with scs and with the hand-written store?
- Important 6 — Which cookie attributes does a session cookie need, and what does the
__Host-prefix add? - Must-know 7 — Explain the RS256-to-HS256 alg confusion attack and the golang-jwt v5 option that prevents it.
- Important 8 — golang-jwt v5 accepted a token minted for another service. Which checks were missing?
- Important 9 — How does refresh token rotation detect theft, and what happens to the legitimate user?
- Must-know 10 — An authenticated user can read
/invoices/1002that belongs to someone else. Where is the bug, and what should the response be? - Important 11 — With
SameSite=Laxsession cookies, why do you still need CSRF protection, and what does Go 1.25 add? - Must-know 12 — List the properties of a safe password reset flow.
- Good to know 13 — Why does
totp.Validatealone not satisfy RFC 6238, and how do you fix it? - Good to know 14 — What does a secure logout do for a cookie session and for a token-based mobile client?
html/template: Layouts, Caching, Forms, Flash Messages
Open the chapter · 13 questions
- Must-know 1 — Why must a page-rendering handler import
html/templaterather thantext/template? - Important 2 — A page shows
#ZgotmplZwhere a link should be. What happened? - Must-know 3 — Two page files both define
content, and every URL shows the same page. Why, and what is the fix? - Important 4 —
Parsesucceeded, but the first request returnsappears in an ambiguous context within a URL. Why so late? - Must-know 5 — Why render into a
bytes.Bufferinstead of executing straight into theResponseWriter? - Must-know 6 — A user submits a form with an invalid e-mail. What status and body do you return, and what do you return on success?
- Must-know 7 — How does a hidden CSRF token stop a cross-site POST, and what does Go 1.25 add?
- Important 8 — How does a flash message survive a redirect and still show only once?
- Must-know 9 — Why is
template.HTML(r.FormValue("bio"))dangerous, and when istemplate.HTMLacceptable? - Good to know 10 — How does content-hash cache busting let you cache CSS for a year safely?
- Important 11 — How should a handler serve an htmx request and a plain request on the same URL?
- Important 12 — What is a CSP nonce, why must it be new for every response, and why does it conflict with full-page caching?
- Good to know 13 — What is the difference between
template,blockanddefine?
HTTP/2, HTTPS, TLS & mTLS in Go; Benchmarking with wrk and h2load
Open the chapter · 12 questions
- Must-know 1 — Your Go client works against the staging API but fails in production with
x509: certificate signed by unknown authority. The quick fix on the team chat isInsecureSkipVerify: true. What do you do instead? - Must-know 2 — Why does a custom
http.Transportwith aTLSClientConfigtalk HTTP/1.1 to an HTTP/2 server, and how do you fix it? - Must-know 3 — What exactly is ALPN, and how do you see which protocol a Go server negotiated?
- Important 4 — A server sets
ClientAuth: tls.RequestClientCertand expects it to behave like mTLS. Why is that unsafe, and what should it use? - Important 5 — Where do you put an identity allow list:
VerifyPeerCertificateorVerifyConnection, and why? - Must-know 6 — How do you serve a renewed certificate without restarting, and what happens to connections that are already open?
- Important 7 — Is 0-RTT available in Go's TLS server, and what is the risk where it is available?
- Important 8 — Your
http.Serverhas noReadTimeout,WriteTimeoutorReadHeaderTimeout. How does that affect TLS handshakes? - Must-know 9 — You run
wrk -t4 -c200against an HTTP/2 API and compare withh2load -c 20 -m 10. What is each tool actually doing, and why are the numbers not comparable? - Important 10 — What is coordinated omission, and which load tools avoid it?
- Good to know 11 — Can a Go program serve HTTP/3 with the standard library?
- Good to know 12 — Why did a Kubernetes pod with a 2-CPU limit on a 64-core node show latency spikes before Go 1.25, and what changed?
gRPC & Protobuf in Go: proto files, codegen, streaming, metadata, interceptors, TLS, validation, gRPC-gateway
Open the chapter · 12 questions
- Must-know 1 — A handler returns
errors.New("not found"). What does the client see, and what should the handler return instead? - Must-know 2 — Why must you never reuse a field number, even with the same type?
- Must-know 3 — What is the difference between
grpc.NewClientandgrpc.Dial, and why does a bufconn test needpassthrough:///? - Must-know 4 — Why embed
UnimplementedOrderServiceServer, and why by value? - Must-know 5 — A client sets no deadline and the server hangs. What happens, and what is the fix on both sides?
- Important 6 — In what order do
ChainUnaryInterceptor(logging, auth, recovery)run, and why put recovery last? - Important 7 — How do headers and trailers differ, and how does a Go client read each?
- Important 8 — Your gRPC clients in Kubernetes all hit one pod of three. Why, and what are the fixes?
- Important 9 — What does protovalidate do differently from protoc-gen-validate, and what does the client get on a violation?
- Important 10 — A 5 MiB request fails even with gzip. Why, and what are the options?
- Good to know 11 — How does grpc-gateway map a
PATCHwith a partial JSON body to an RPC with aFieldMask? - Good to know 12 — When would you choose connect-go or gRPC-Web over plain grpc-go?
GraphQL in Go with gqlgen: Schema, Resolvers, DI, Testing
Open the chapter · 12 questions
- Must-know 1 — Why does a nested GraphQL query often cause N+1 queries, and how do you fix it?
- Must-know 2 — What is the difference between a field that is a struct field and one with a resolver?
- Must-know 3 — A resolver for a nullable field returns an error. What does the client receive?
- Must-know 4 — Where should authorization live, and why not only in a directive?
- Must-know 5 — How do you stop one client from sending a query that costs a thousand times more than normal?
- Important 6 — Why are Relay cursors opaque, and what do they encode here?
- Important 7 — Why must the WebSocket transport be registered first, and what must you configure on it?
- Important 8 — Is automatic persisted queries a security feature?
- Important 9 — How do you disable introspection and the playground in production, and does that secure the API?
- Important 10 — Why does gqlgen's generated resolver method
Booksbreak aResolver.Booksfield, and what is the fix? - Good to know 11 — Why does the dataloader's cache have to be per request?
- Good to know 12 — What do
client.NewandRawPostgive you in tests thatPostdoes not?
database/sql & pgx: Connections, Prepared Statements, Transactions, Repository Pattern
Open the chapter · 12 questions
- Must-know 1 — What does
sql.Open("pgx", dsn)do, and how do you make startup fail on a wrong password? - Must-know 2 — Your service has
SetMaxOpenConns(10)and requests start timing out withcontext deadline exceededwhile the database is idle. What do you look at first? - Must-know 3 — Why must you call
rows.Err()after thefor rows.Next()loop? - Must-know 4 — Show the defer-Rollback pattern and explain why the deferred Rollback is harmless after a successful Commit.
- Must-know 5 — A transaction fails with SQLSTATE 40001. What does your code do, and what must be true of the transaction function?
- Important 6 — How do you scan a nullable
phonecolumn, and what happens if you scan it into astring? - Important 7 — What does
db.PrepareContextreally do with a pool of 20 connections? - Important 8 — Your pgx service moves behind PgBouncer in transaction mode and logs
prepared statement "stmtcache_..." does not exist. Why, and what are the fixes? - Important 9 — How do you turn a unique violation on
users.emailinto a 409 without matching message text? - Important 10 — Two repositories must write in one transaction. Name two ways to share the transaction and one risk of each.
- Good to know 11 — When is
CopyFromthe wrong tool for inserting 10,000 rows? - Good to know 12 — With pgx defaults, what happens on the server when the ctx of a running query is canceled, and what backstop do you add?
MongoDB with Go: CRUD, Filters, Generics Helpers, Relationships
Open the chapter · 13 questions
- Must-know 1 —
mongo.Connectreturned no error. Is the database reachable? - Must-know 2 — Why must a sort document be a
bson.Dand not abson.M? - Must-know 3 — A user posts
{"password": {"$ne": ""}}to your login endpoint. How does this become a bug, and how do you prevent it? - Important 4 — What does
omitemptydo forbson.ObjectID,time.Time, a nil pointer and a plain struct value? - Must-know 5 —
FindOnefound nothing. What do you get, and what doesFindgive for the same filter? - Good to know 6 — When must you call
cursor.Close, and what doesAlldo about it? - Must-know 7 — Why is range pagination on
_idfaster thanlimit/skipat page 10,000, and what do you give up? - Important 8 — Why use
$incinstead of reading a counter, adding one and saving it? - Important 9 — When do you embed and when do you reference?
- Must-know 10 — What must be true of a
WithTransactioncallback, and which deployments allow it? - Important 11 — A unique index rejects a second insert. Which code and which helper do you use, and what does the caller see?
- Good to know 12 — How do you test code that uses the driver when no MongoDB server is available?
- Good to know 13 — What is a change stream's resume token for?
Event-Driven Go: Watermill, RabbitMQ Emitters/Consumers, SQS, RPC between Services
Open the chapter · 12 questions
- Must-know 1 — A consumer finishes its work, and the process dies before the ack. What happens, and how do you make that safe?
- Must-know 2 — What does a publisher confirm tell you, and what does it not?
- Must-know 3 — Why is
Nackwithrequeue=truea poor retry, and what replaces it in RabbitMQ? - Important 4 — In Watermill, why does
PoisonQueuereturn a nil error, and what is the middleware order? - Important 5 —
Retry{MaxRetries: 3}is configured. How many times does the handler run for a message that always fails? - Must-know 6 — What problem does the transactional outbox solve, and why must the relay tolerate duplicates?
- Important 7 — In SQS, you receive a message and your handler takes longer than the visibility timeout. What happens?
- Important 8 — How do you keep events of one order in sequence while processing many orders in parallel?
- Important 9 — How does request-reply over messaging match a reply to the right caller, and what happens on timeout?
- Must-know 10 — When should you choose gRPC over messaging RPC?
- Must-know 11 — How do you shut a consumer down without dropping or duplicating in-flight work?
- Good to know 12 — How do you connect a producer's trace to the consumer's trace across a broker?
File Uploads, S3 & Serving from a CDN
Open the chapter · 13 questions
- Must-know 1 — What does the argument of
r.ParseMultipartFormlimit? - Must-know 2 — Why is
io.LimitReaderthe wrong tool for an upload size limit? - Must-know 3 — A client sends
filename="..\..\evil.exe"to a Go server on Linux. What doesPart.FileName()return, and what should you do? - Must-know 4 — Why compare the extension, the declared
Content-Typeand the sniffed type? - Important 5 — How can a 74-byte file exhaust memory, and how do you stop it?
- Important 6 — What is the difference between a presigned PUT URL and a POST policy for size control?
- Must-know 7 — A browser upload to a presigned URL fails with a CORS error but
curlworks. Why? - Important 8 — What happens to the parts of a multipart upload that is never completed?
- Good to know 9 — Which AWS SDK package should new code use for large uploads, and what is the status of
manager.Uploader? - Important 10 — Why do immutable, content-addressed keys beat cache invalidation for uploads?
- Important 11 — How do you serve a private file through a CDN without making the bucket public?
- Good to know 12 — A client says
If-None-Match: "p1"and the object is unchanged. What does the origin return and why does it matter? - Important 13 — How do you keep uploads, database rows and objects consistent when no transaction spans them?
Project: Broker, Auth, Logger & Mailer Microservices with REST, RPC, gRPC and RabbitMQ
Open the chapter · 13 questions
- Must-know 1 — Why does the front end talk only to the broker, and what does the broker own besides routing?
- Must-know 2 — A user types the wrong password while Postgres is also down for another user. What does each see, and why must the two differ?
- Must-know 3 — Name four limits of net/rpc that this project works around, and how.
- Must-know 4 — What happens if the broker calls the gRPC logger without a deadline and the logger hangs?
- Must-know 5 — The listener writes a log entry, then crashes before acking. What happens next, and why is the result still one entry?
- Important 6 — Why is the poison routing key
poison.logand notlog.poisonin this topology? - Important 7 — In what order are the Watermill
RetryandPoisonQueueWithFiltermiddlewares added, and what goes wrong with the other order? - Important 8 — Why do 401 and 422 count as successes for the mailer's circuit breaker, and why is
context.Canceledexcluded? - Important 9 — How does one request ID reach a MongoDB document written by the listener minutes later?
- Important 10 — The logger runs HTTP, net/rpc and gRPC in one process. What does a correct SIGTERM look like?
- Good to know 11 — One
contractspackage, a tagged module withgo.work, or duplicated structs: how do you choose? - Good to know 12 — What does the all-in-one test prove that unit tests per service cannot, and what does it still not prove?
- Good to know 13 — Sketch the monolith version of this project. What disappears and what stays?
Project: E-Commerce API — Services, Handlers, Cart, Orders, SMTP, Events, Swagger
Open the chapter · 14 questions
- Must-know 1 — Why does the cart not store prices, and where does the checkout get them?
- Must-know 2 — Two customers buy the last unit at the same moment under PostgreSQL READ COMMITTED. What stops both from succeeding in this project, and what is the database's last line of defence?
- Must-know 3 — List what happens inside the checkout transaction, in order.
- Important 4 — A client times out on
POST /v1/ordersand retries with the same Idempotency-Key while the first request is still committing. What does it get, and why not a 409? - Must-know 5 — Why is the order status not simply set from the latest webhook?
- Important 6 — The stock release timeout cancels an unpaid order, and one second later the PSP reports the payment succeeded. What does the system do?
- Must-know 7 — Why write events to an outbox table instead of publishing to RabbitMQ after commit, and what does a consumer need?
- Important 8 — How does the confirmation mail avoid being sent twice, or never?
- Must-know 9 — Bob is logged in and requests
GET /v1/orders/ord_alice. Walk through the checks and the answer. - Important 10 — Why keyset pagination for the catalogue, and what must the cursor contain?
- Important 11 — When do you choose
SELECT ... FOR UPDATEand when an optimistic version column in this project? - Good to know 12 — How are the services tested without a database, and what does that not prove?
- Good to know 13 — swag or oapi-codegen for this API, and how do you keep the contract true either way?
- Good to know 14 — What happens on SIGTERM, step by step?
Project: An MCP Server in Go (JSON-RPC, stdio, tools, inspector)
Open the chapter · 12 questions
- Must-know 1 — What distinguishes a JSON-RPC request from a notification in MCP, and what must the receiver do with each?
- Must-know 2 — Why does a
fmt.Printlnin a tool handler break a stdio MCP server, and where should the output go instead? - Must-know 3 — Walk through the handshake-era lifecycle of a stdio session.
- Must-know 4 — A tool cannot find the requested record. Should it return a JSON-RPC error or an
isErrorresult, and how do you produce each with go-sdk'smcp.AddTool? - Must-know 5 — How does
mcp.AddToolbuild the tool'sinputSchema, and how do you add bounds such as a maximum? - Important 6 — What does the Streamable HTTP transport require of a server for security, and which part does go-sdk v1.4.0 not do for you?
- Important 7 — How do you test an MCP server in Go without starting a subprocess or a network listener?
- Important 8 — What is prompt injection via tool results, and what can a server do about it?
- Important 9 — What is token passthrough, and why is it forbidden for an MCP server acting as an OAuth 2.1 resource server?
- Important 10 — Your server's tool should ask the user to confirm a deletion. What happens if the client did not announce
elicitation, and what should the tool do? - Good to know 11 — Which go-sdk version can a module with
go 1.24in itsgo.moduse, and which MCP revisions does it speak? - Good to know 12 — Name four things revision 2026-07-28 removes or replaces compared with 2025-06-18.
Project: RAG & LLM Apps in Go — Ollama, pgvector, Embeddings, Chunking, Retrieval, Vision, Prompt-Injection Defense
Open the chapter · 14 questions
- Must-know 1 — Why must retrieved chunks never be placed in the system prompt?
- Must-know 2 — Ollama answered 200 and your client printed half an answer as if it were complete. What did it miss?
- Important 3 — Why do cosine similarity and inner product give the same ranking for
/api/embedvectors, and which pgvector operator is faster? - Must-know 4 — A query with
WHERE tenant_id = 'small'and an HNSW index returns 3 rows instead of 10. Why, and what is the fix? - Important 5 — Why fuse vector and keyword results with RRF instead of adding their scores?
- Must-know 6 — You switched from nomic-embed-text to mxbai-embed-large. What breaks and what is the safe migration?
- Important 7 — How does the ingestion pipeline avoid re-embedding an unchanged site every night?
- Must-know 8 — How do you stream tokens to a browser, and what stops generation when the user closes the tab?
- Important 9 — The model replies with a
refund_ordertool call after reading a support ticket. What should your code do? - Good to know 10 — What does a JSON schema in
formatguarantee, and what does it not? - Important 11 — How do you budget a prompt against
num_ctx, and what is dropped first? - Good to know 12 — What is recall@k, and why measure it separately from answer quality?
- Important 13 — Why bound model calls with a rate limit, a concurrency cap and a per-call timeout, if Ollama already queues requests?
- Good to know 14 — Why does this module call the REST API instead of importing
github.com/ollama/ollama/api?
Foundations
Bits, Bytes & Text Encoding: ASCII, Unicode, UTF-8/16, Normalization, Endianness
Open the chapter · 11 questions
- Must-know 1 — How many bytes, code points and graphemes does the Persian word سلام have in UTF-8?
- Must-know 2 — Why is
0.1 + 0.2 == 0.3false in Go, PHP and JavaScript? - Important 3 — Which bytes does
binary.BigEndian.PutUint32write for 0x0A0B0C0D and what does reading them as little-endian give? - Must-know 4 — Why can
substr($s, 0, 3)on UTF-8 text breakjson_encode? - Important 5 — What is the difference between NFC and NFKC, and which do you store?
- Good to know 6 — Do NFC or NFKC make Arabic yeh (U+064A) equal to Persian yeh (U+06CC)?
- Important 7 — Why keep ZWNJ in stored Persian text but remove it from a search key?
- Important 8 — What does
VARCHAR(10)limit in PostgreSQL, MySQL, Oracle (default) and SQL Servernvarchar(10)? - Good to know 9 — How do you recognise UTF-16LE with BOM in a hex dump, and how is U+1F600 written in it?
- Must-know 10 — Why is MySQL
utf8unsafe for emoji, and what is the symptom? - Important 11 — Where does a middleware belong that canonicalizes input, and what must it skip?
Binary-to-Text Encoding: Base64, Base32, Hex, Percent-Encoding, Data URIs
Open the chapter · 12 questions
- Must-know 1 — Why does Base64 output grow by about 33%, and what is the exact length for 10 input bytes?
- Important 2 — A signed token works in JSON but fails in a link from e-mail. Which two bytes are the first suspects?
- Important 3 — What is the difference between
urlencodeandrawurlencodein PHP and betweenQueryEscapeandPathEscapein Go? - Must-know 4 — Why does
btoa('سلام')throw, and how do you fix it? - Must-know 5 — Is a JWT payload secret? Why or why not?
- Must-know 6 — How does a Kubernetes Secret value
cEBzcy93K3Jkrelate to the real secret and who can read it? - Important 7 — What is double encoding and how does it turn into a security bug?
- Good to know 8 — Why is
aGl=accepted by some decoders and rejected by GoStrict()? - Good to know 9 — When is a
data:URI a good idea and when is it a bad one? - Important 10 — What encoding does the host
مثال.ایرانtake on the wire, and the path/مقاله? - Must-know 11 — How do you accept a base64 avatar from an untrusted client safely?
- Must-know 12 — Why does
echo hello | base64give a different value fromprintf hello | base64?
Serialization Formats: JSON, Protobuf, MessagePack, Avro, CBOR, XML
Open the chapter · 11 questions
- Must-know 1 — A Go service sends
{"id": 9007199254740993}. What does a React frontend show, and how do you fix the contract? - Good to know 2 — Decode the Protobuf bytes
08 96 01by hand. - Important 3 — Why does
int32 adjustment = -2cost 10 bytes in Protobuf, and what should you use? - Important 4 — An old service (v1 schema) receives a v2 Protobuf message with a new field 8, then forwards it. Is field 8 lost? What if it forwards it as JSON?
- Important 5 — You add
"channel": "string"(no default) to an Avro reader schema. What happens to existing data? - Must-know 6 — Two services parse
{"user":"alice","user":"mallory"}. Why is this a security bug, and name two fixes. - Must-know 7 — Why must a webhook signature be verified against the raw body and not against
json_encode(json_decode($body))? - Must-know 8 — Your Laravel app reads a
statecookie withunserialize()after validating it is a string. Is['allowed_classes' => false]enough? - Good to know 9 — Why did our Order take 195 bytes in MessagePack but 48 bytes in another MessagePack run?
- Important 10 — A YAML config sets
country: NOandmode: 0644. What can a YAML 1.1 parser return, and how do you prevent it? - Important 11 — Which format would you choose for Kafka events read by Go, PHP and Spark consumers for two years, and why?
Compression: Entropy, Huffman, LZ77, gzip/zlib/deflate, Brotli, zstd, lz4, snappy
Open the chapter · 12 questions
- Good to know 1 — Order-0 entropy of our JSON logs is 5.1 bits/byte, which bounds an order-0 coder at 1.57x. How did gzip reach 5.5x?
- Must-know 2 — Why does a 4 MB file from
/dev/urandomget larger under every codec? - Good to know 3 — Build the Huffman code for
abracadabra. How many bits, and why is that above the entropy? - Important 4 — A client sends
Content-Encoding: deflateand your zlib reader fails. What happened? - Must-know 5 — Name the three headers involved in HTTP compression and what each does.
- Important 6 — Your page shows a CSRF token and echoes
?q=. Why is enabling gzip on it dangerous, and name two fixes. - Must-know 7 — Your ingestion endpoint limits bodies to 1 MiB. Is it safe against bombs?
- Important 8 — You compress each 200-byte Kafka event with zstd in the application and get 1.2x. What two changes help most?
- Important 9 — Why do Cassandra and MongoDB default to lz4/snappy rather than gzip or zstd -19?
- Important 10 — You ran
ALTER TABLE ... SET COMPRESSION lz4but the table did not shrink. Why? - Good to know 11 — When is
tar.gzthe wrong choice compared to zip or seekable zstd? - Must-know 12 — Your Go client sets
Accept-Encoding: gzipitself and nowjson.Decoderfails. Why?
Checksums & Hashing: Parity, CRC32/CRC32C, xxHash, Murmur, SHA-2/3, BLAKE3, Content Addressing
Open the chapter · 12 questions
- Must-know 1 — Why can a CRC-32 not protect a webhook payload, even though it detects every 1-bit error?
- Good to know 2 — Kafka, iSCSI and ext4 chose CRC-32C over the Ethernet CRC-32. Give two reasons.
- Important 3 — You store 10^9 objects keyed by a 64-bit XXH3. Roughly what is the chance of at least one collision, and what would you change?
- Important 4 — What is the difference between a collision attack and a second-preimage attack, and which one is practical against SHA-1?
- Must-know 5 — Why is
sha256($secret . $query)an unsafe signature, and what are two safe alternatives? - Important 6 — A user says the S3 ETag of their 2 GB upload does not equal
md5sum. Is the file corrupt? - Good to know 7 — Why does Go give every map its own random seed, and why must you not use
hash/maphashto pick a shard? - Important 8 — TLS 1.3 authenticates every record. Why do you still add
x-amz-checksum-sha256to an S3 upload? - Good to know 9 — On your laptop BLAKE3 measured slower than SHA-256. Is the BLAKE3 README wrong?
- Good to know 10 — What does a Docker image's layer digest hash, and what does its
diff_idhash? - Important 11 — Your PostgreSQL log shows
page verification failed, calculated checksum … but expected …. What happened and what do you do? - Important 12 — Why should you add a size check before hashing content from an untrusted registry, as the OCI spec suggests?
Cryptography Fundamentals: AES-GCM, ChaCha20, RSA/ECC/Ed25519, ECDH, KDFs, HMAC, Signatures, Randomness
Open the chapter · 11 questions
- Must-know 1 — Which of confidentiality, integrity, authenticity and non-repudiation does HMAC-SHA256 give, and which does it not?
- Must-know 2 — Why does an ECB-encrypted bitmap still show the picture?
- Must-know 3 — Two messages were encrypted with AES-GCM under the same key and the same nonce. What can an attacker do?
- Important 4 — A service uses random 96-bit nonces with one AES-GCM key and encrypts 50,000 messages per second. What should you plan?
- Must-know 5 — Why is AES-CBC without a MAC dangerous even with a random IV?
- Important 6 — What goes into AAD for an encrypted database column, and what does it protect against?
- Important 7 — Why should the X25519 shared secret go through HKDF, and what belongs in
info? - Must-know 8 — Ten microservices must verify tokens from one identity service. HMAC or signatures?
- Good to know 9 — What does ECDSA nonce reuse reveal, and how does Ed25519 avoid it?
- Important 10 — Your Laravel app sets a new
APP_KEY. What happens to sessions and encrypted columns, and how do you avoid an outage? - Must-know 11 — Why is
$sig === $expecteda vulnerability in a webhook handler?
Password Hashing & Signed Tokens: bcrypt, Argon2, Salts & Peppers, HMAC-Signed URLs, JWT/PASETO Signing
Open the chapter · 12 questions
- Must-know 1 — Why is encrypting passwords worse than hashing them?
- Must-know 2 — A leaked table shows two users with the same hash. What was missing?
- Important 3 — Who should know the pepper, and where should it live?
- Good to know 4 — You measure bcrypt cost 12 at 185 ms. What do you expect for cost 13, and why?
- Good to know 5 — Decode
$argon2id$v=19$m=65536,t=3,p=4$<salt>$<tag>. - Important 6 — How should a login handle a hash that uses weaker parameters than today's policy?
- Important 7 — Why SHA-256 and not bcrypt for API keys?
- Must-know 8 — What exactly does a Laravel signed URL sign, and what does it not protect?
- Must-know 9 — Explain the RS256 to HS256 key-confusion attack and its fix.
- Must-know 10 — Why is
alg: nonedangerous, and how do you prevent it? - Good to know 11 — Give two reasons PASETO exists.
- Must-know 12 — A token's payload contains an email address; is it private?
TLS in Practice: Handshake on the Wire, Certificates & Chains, SNI/ALPN, mkcert, openssl s_client, Certs in Docker & Kubernetes
Open the chapter · 11 questions
- Good to know 1 — Which TLS 1.3 messages are sent in plaintext, and which are encrypted?
- Important 2 — Why does a server need SNI to choose a certificate, and what is served when the client sends none?
- Good to know 3 — Decode
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256and say what is different inTLS_AES_128_GCM_SHA256. - Must-know 4 — A site works in Chrome but
curlsaysunable to get local issuer certificate. What is the likely cause and the test? - Important 5 — Why does
openssl s_clientprintVerification: OKfor a wrong hostname, and how do you make it check? - Important 6 — A static Go binary in
FROM scratchfails every HTTPS call. Why, and what are two fixes? - Important 7 — Which ACME challenge do you need for
*.example.com, and which port does HTTP-01 use? - Good to know 8 — What does 0-RTT risk, and what must the server do?
- Must-know 9 — Your Laravel app behind an ALB generates
http://links. What do you configure, and what doesURL::forceSchemenot fix? - Important 10 — Why must a Kubernetes TLS Secret not be mounted with
subPathif you rely on rotation, and how does the app notice a new file? - Good to know 11 — Which Let's Encrypt limit do you hit by redeploying and re-requesting the same certificate six times in a week?
Network Models: OSI vs TCP/IP, Encapsulation, What Happens When You Open a URL
Open the chapter · 11 questions
- Good to know 1 — Which two OSI layers have no separate software in a real TCP/IP stack, and where does their work happen?
- Important 2 — A TCP segment carries 56 bytes of HTTP. How many bytes is the Ethernet frame (without FCS), and why?
- Must-know 3 — Why is the MSS 1460 on Ethernet?
- Good to know 4 — In the SYN dump, the Data Offset nibble is 8. What does that tell you?
- Must-know 5 — Which MAC is the destination in the frame that carries your request to a server in another country?
- Must-know 6 — What does a router do to a packet it forwards?
- Important 7 —
ping -D -s 1472succeeds and-s 1473fails on an Ethernet link. Why? - Important 8 — Name the three delays that make up packet latency and which one bandwidth reduces.
- Must-know 9 — Why does a gRPC client often hit only one pod behind a Kubernetes Service?
- Must-know 10 — Explain "connection refused" versus "timed out" in layer terms.
- Good to know 11 — Why can a TUN-mode proxy make a 150 ms path look like 0.3 ms?
IP Addressing: IPv4/IPv6, Private Ranges, CIDR & Subnet Math, Gateways, Routing Tables, ARP/NDP
Open the chapter · 12 questions
- Must-know 1 — What are the network, broadcast and usable range of
10.4.77.130/26? - Must-know 2 — Is
172.32.5.4private? - Must-know 3 — Your laptop has
default via 192.168.1.1and a VPN route10.0.0.0/8 dev utun4. Which interface carries10.84.0.5, and which carries8.8.8.8? - Must-know 4 — When you ping
1.1.1.1, whose MAC address does your laptop ARP for? - Must-know 5 — Why does a container whose app listens on
127.0.0.1:8080not answerdocker run -p 8080:8080? - Important 6 — How many /24 node CIDRs fit in a
/18cluster CIDR, and how many pods can the cluster hold at the default max-pods? - Important 7 — Write
2001:0db8:0000:0000:0001:0000:0000:0001in canonical form. - Important 8 — Which messages does IPv6 use instead of ARP, and where are they sent?
- Important 9 — A request reaches your app from
10.0.5.20withX-Forwarded-For: 6.6.6.6, 198.51.100.7, 10.0.9.1. Trusted:10.0.0.0/8. What is the client IP? - Good to know 10 — Why can PostgreSQL store
10.0.12.7/20asinetbut not ascidr? - Important 11 — Why key an IPv6 rate limit by /64?
- Important 12 — Two VPCs are
10.0.0.0/16and10.0.128.0/17. Can you peer them?
NAT, PAT & Port Forwarding; DHCP Lease Flow; CGNAT; Hairpin NAT
Open the chapter · 12 questions
- Must-know 1 — Why does a home router need a translation table, and what happens to an inbound packet with no row?
- Must-know 2 — What is the difference between SNAT, masquerade and DNAT, and which chain does each use?
- Important 3 — In
conntrack -Loutput, what do the twosrc= dst= sport= dport=groups mean? - Important 4 — What happens when
nf_conntrack_maxis reached, and how would you notice? - Important 5 — A container cannot reach
http://host-ip:8080, its own published port, but others can. Why, and what is the fix? - Important 6 — Your router's WAN IP is
100.72.4.9. Does port forwarding work? - Important 7 — Why does WireGuard need
PersistentKeepalivebehind NAT? - Must-know 8 — How do you read the real client IP from
X-Forwarded-Forsafely? - Important 9 — What does
externalTrafficPolicy: Localchange, and what is the downside? - Good to know 10 — Name the four DHCP messages, their ports and when T1 and T2 happen.
- Good to know 11 — Why did the lab's DHCP client not get the MTU the server was configured with?
- Must-know 12 — Why verify a webhook signature instead of trusting the source IP when using a tunnel?
DNS Resolution for Developers: Resolvers, Records, TTL & Caching, /etc/hosts, resolv.conf, Split DNS, DNS in Containers
Open the chapter · 10 questions
- Must-know 1 — Why can
digandcurlreturn different addresses for the same host? - Good to know 2 — With
ndots:5, how many queries doesapi.example.comcost in a pod with three search suffixes? - Important 3 — Why can't you put a CNAME at
example.com? - Must-know 4 — You lowered the TTL to 30 s and failed over, but the app still hits the old IP. Why?
- Good to know 5 — What does
--dnsdo on a user-defined Docker network? - Must-know 6 — How does
paymentsresolve in Kubernetes? - Important 7 — What does a headless Service return?
- Important 8 — NXDOMAIN keeps appearing after you created the record. Why?
- Important 9 — Why must TCP 53 be allowed?
- Important 10 — Does Go cache DNS answers?
Ports, Sockets & Connections: Ephemeral Ports, TIME_WAIT, Keepalive, Backlog, conntrack; ss, lsof, tcpdump, nc, curl, dig
Open the chapter · 11 questions
- Must-know 1 — A Go service logs
dial tcp 10.0.1.9:5432: connect: cannot assign requested address. What is exhausted, and what is the first fix? - Important 2 —
ss -son an API server shows 30 000 TIME_WAIT. Is the server or the client misbehaving? - Important 3 — Why does CLOSE_WAIT never time out, and how do you find who owns it?
- Good to know 4 —
ss -ltnshowsLISTEN 129 128 *:8080. What does it mean? - Important 5 — A worker's first query after a quiet night fails with "server closed the connection unexpectedly". Name the mechanism and two fixes.
- Must-know 6 — What is the difference between
ECONNRESETandEPIPE? - Good to know 7 — Why did the Go
fdlimitprogram need--ulimit nofile=256:256rather than256:4096to fail at 256? - Important 8 — Laravel's
Http::get()in a loop under Octane: does it reuse connections? How do you make it? - Good to know 9 — When is
SO_REUSEPORTuseful and what doesSO_REUSEADDRactually do on Linux? - Important 10 — A UDP metrics receiver shows fewer events than were sent and no errors in the sender. Where do you look?
- Must-know 11 — Why prefer a Unix socket between nginx and php-fpm on the same host?
Firewalls: iptables/nftables, Security Groups, Network ACLs, Egress Control
Open the chapter · 12 questions
- Must-know 1 — Which five fields make up the 5-tuple, and name three other things a rule can match that are not in it.
- Must-know 2 — Why does a stateful firewall need no rule for the reply to a web request, and what does a NACL need instead?
- Must-know 3 — Decode
iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT. - Must-know 4 — A Docker host runs
ufw deny 5432and a container published with-p 5432:5432answers from the internet. Why, and name two fixes. - Important 5 — What does
inetmean intable inet filter, and why does it matter for IPv6? - Important 6 — You applied a NetworkPolicy and traffic is unchanged. Give two causes.
- Important 7 — Why is blocking all ICMP harmful, and which messages must pass?
- Important 8 — A request is
ACCEPTin flow logs and its reply isREJECT. What is the likely cause and how do you fix it? - Good to know 9 — Why must the ping rate limit sit before
ct state established accept? - Important 10 — Give three reasons to control egress, and two ways to do it for a Kubernetes pod.
- Important 11 — Why is a Unix-socket admin listener better than "an admin port restricted by firewall rule"?
- Must-know 12 — What is the first thing to check when
Request::ip()in Laravel returns the load balancer's address?
Docker Networking: bridge, host, none, overlay, macvlan; Port Publishing, Embedded DNS, Compose Networks, the iptables Rules Docker Writes, MTU
Open the chapter · 12 questions
- Must-know 1 — Two containers started with plain
docker runcannotpingeach other by name. Why, and what are two fixes? - Must-know 2 — A Compose file publishes
"6379:6379"for Redis on a VPS with ufw denying 6379. Is Redis reachable from the internet? - Must-know 3 — What exactly does
EXPOSE 8080change? - Important 4 — Your Go service logs
lookup example.com on 127.0.0.11:53: server misbehavingbutredisresolves. What network setting explains it? - Important 5 — Where do you put a rule that only lets
192.0.2.0/24reach published ports, and why there? - Good to know 6 — A download through a container works on Wi-Fi and hangs when the laptop is on the company VPN;
/healthworks in both cases. Diagnosis and fix? - Important 7 — On a Mac, why can you not reach
172.22.0.2from the terminal, and what do you use instead? - Important 8 — After
docker compose uprecreatedapi, nginx returns 502 until it is restarted. Why, and how do you prevent it? - Good to know 9 — Your corporate GitLab at 172.20.4.10 became unreachable after starting a new Compose project. What happened?
- Must-know 10 — A Laravel app in Compose uses
DB_HOST=127.0.0.1and fails with "Connection refused". Explain and fix. - Good to know 11 — What is the difference between
--network hoston Linux Engine and on Docker Desktop 4.34+ with host networking enabled? - Good to know 12 — Which chains replaced
DOCKER-ISOLATION-STAGE-1/2, and where is cross-network traffic dropped now?
Kubernetes Networking: Pod Network & CNI, ClusterIP/NodePort/LoadBalancer, kube-proxy (iptables/IPVS), CoreDNS, Ingress & Gateway API, NetworkPolicy, Egress NAT
Open the chapter · 12 questions
- Must-know 1 — A Service has
port: 80andtargetPort: 8080, butcurl whoamifrom a pod is refused immediately. What do you check first, and why "refused" rather than a timeout? - Must-know 2 — Why can a pod reach
10.96.84.19:80although no interface on any machine has that address? - Important 3 — In iptables mode, how are three endpoints given equal shares, and when is the choice made?
- Important 4 — Your gRPC client always talks to the same pod after a scale-up. Why, and what are two fixes?
- Important 5 — What does
ndots:5do to a lookup ofapi.stripe.comfrom namespacelab, and how do you avoid it? - Important 6 — Logs show every client as
10.244.0.1. Name two causes and their fixes. - Important 7 — A Service of type LoadBalancer on kind shows
<pending>. Is the network broken? - Must-know 8 — You applied a default-deny NetworkPolicy and now nothing resolves names, but liveness probes still pass. Explain both.
- Important 9 — What does
externalTrafficPolicy: Localchange on a node that runs no pod of the Service, and how does a cloud LB cope? - Good to know 10 — Why does
kubectl port-forward svc/whoami 8080:80succeed while in-cluster calls towhoamitime out? - Good to know 11 — Small responses work, large ones hang between nodes on a VXLAN cluster. What is happening?
- Good to know 12 — Name the four stable Gateway API kinds and who owns each in a typical company.
VPNs & Tunnels: SSH Port Forwarding, Bastions, WireGuard, Site-to-Site vs Client VPN, Zero-Trust Access
Open the chapter · 12 questions
- Must-know 1 — In
ssh -L 5433:db.internal:5432 bastion, who resolvesdb.internal, and who connects to it? - Important 2 — A
-Llistener accepts connections but every one is reset. Name two server-side causes and the client message that confirms it. - Important 3 — You run
ssh -R 0.0.0.0:9000:localhost:8080 serverand colleagues cannot reach port 9000. Why? - Must-know 4 — Why is
ProxyJumpsafer thanssh -Athrough a bastion? - Important 5 — What does
AllowedIPs = 10.200.0.2/32on the hub for a spoke do in each direction? - Important 6 —
pingthrough WireGuard saysRequired key not available. What is wrong? - Must-know 7 — Small requests work through the tunnel and large ones hang. Name the cause and two fixes.
- Important 8 — Which side of a WireGuard link needs
PersistentKeepalive, and why 25? - Good to know 9 — Tailscale shows a connection as relayed through DERP. What does that mean for privacy and for latency?
- Important 10 — When do you choose VPC peering, Transit Gateway, PrivateLink and Site-to-Site VPN?
- Must-know 11 — How is a zero-trust access proxy different from a VPN for a contractor who needs one internal web app?
- Must-know 12 — Why can a webhook developed through cloudflared not be authenticated by source IP, and what do you verify instead?
Network Troubleshooting Playbook: Connection Refused vs Timeout, DNS Failures, MTU/Fragmentation, conntrack & Ephemeral Port Exhaustion, Packet Capture
Open the chapter · 11 questions
- Must-know 1 — A client gets
connection refusedin 1 ms and another getsi/o timeoutafter 3 s to the same IP and port. What does each prove? - Must-know 2 — A container publishes
-p 8080:8080butcurl localhost:8080from the host fails, whiledocker exec app curl localhost:8080works. Most likely cause? - Important 3 — Why does
connection reset by peerappear mostly on the first request after a quiet period? - Important 4 — Small API responses work through the VPN; a 2 MB export hangs. What do you test and what are the fixes?
- Important 5 — What does
EADDRNOTAVAILfromconnect()mean, and why can closing connections quickly make it worse? - Important 6 — What happens when the conntrack table is full, and how would you see it?
- Must-know 7 — mtr shows 40 % loss at hop 3 and 0 % at the destination. Is there packet loss?
- Good to know 8 — Which tcpdump filter shows only resets, and which Wireshark filter shows every TCP problem?
- Must-know 9 — A Kubernetes pod cannot reach
orders:8080.kubectl port-forward pod/orders-x 8080works. What next? - Important 10 — Why separate the connect timeout from the request timeout in Laravel's HTTP client?
- Important 11 — What makes a timeline "postmortem-ready"?
Python & FastAPI
Python Project Tooling: uv, Virtual Environments, Ruff, pyproject, Dependency Locking
Open the chapter · 12 questions
- Must-know 1 — What is a virtual environment, and what does
pyvenv.cfgcontain? - Must-know 2 — Why does
python3 -c "import inventory"fail outside the environment even though the project exists? - Must-know 3 — What is the difference between
[project.optional-dependencies]and[dependency-groups]? - Must-know 4 — What do
~=1.4.2,>=1.0,<2andtomli>=2.0; python_version < '3.11'mean? - Must-know 5 —
pyproject.tomlalready lists dependencies. Why commituv.locktoo? - Important 6 — What is the difference between
uv sync,uv runanduv lock? - Important 7 — How do you keep pytest and ruff out of the production image?
- Important 8 — Which Ruff rule families does this chapter select, and what does each do?
- Important 9 — Why did
ruff checknot flagOptional[str]in the demo file, and what changes withtarget-version = "py310"? - Important 10 — A teammate runs
uv addoffline and editspyproject.tomlby hand elsewhere. How does CI notice a stale lock? - Good to know 11 — When would you choose a
srclayout over a flat layout? - Good to know 12 — How should configuration reach a Python service in development and in production?
Typing & Pydantic v2: Annotated, Models, Validators, Serialization, Settings
Open the chapter · 12 questions
- Must-know 1 — What does Python do with a type hint at runtime, and who actually checks it?
- Must-know 2 — Is
coupon: Optional[str]required in a Pydantic model? What aboutcoupon: str | None = None? - Must-know 3 — What is the difference between lax mode and strict mode, and why does strict JSON still accept
"2026-11-29T10:00:00Z"for adatetime? - Must-know 4 — In which order do validators run, and which one would you use to turn
""intoNone, to enforce "end after start", and to replace type checking completely? - Must-know 5 — How do you accept
customerEmailon the wire, usecustomer_emailin Python, and return camelCase in responses? - Important 6 — Why prefer a discriminated union over a plain
Union[Card, BankTransfer, Wallet]? - Important 7 — What does
from __future__ import annotationschange, and how can it break a Pydantic model or a FastAPI route? - Important 8 — When would you use
TypeAdapter, and what is the most common performance mistake with it? - Important 9 — A PATCH endpoint must update only the fields the client sent, including setting
coupontonull. Which dump option do you use and why not the other? - Important 10 — What is the priority order of pydantic-settings sources, and what does
env_nested_delimiter="__"do? - Good to know 11 — Why keep a domain object separate from the Pydantic DTOs, and when is it fine not to?
- Good to know 12 — Name four v1 patterns you would find in an old codebase and their v2 replacements.
Async Python: asyncio, Event Loop, await, Tasks, Blocking Calls, Thread Pools
Open the chapter · 12 questions
- Must-know 1 — What is the difference between concurrency and parallelism, and which one does asyncio give you?
- Must-know 2 — An
async defroute callsrequests.get(orhttpx.Client.get). What happens to the other requests, and how do you fix it? - Must-know 3 — What does
asyncio.create_task()do, and why must you keep its return value? - Must-know 4 —
gather(a(), b()):afails after 10 ms. What happens tob? How doreturn_exceptions=TrueandTaskGroupchange that? - Must-know 5 — How does cancellation work in asyncio, and what is wrong with
except asyncio.CancelledError: pass? - Important 6 — How do you put a timeout on one call and on a whole block, on Python 3.9 and on 3.12?
- Important 7 — Why can a coroutine-only program still have a race condition, and how do you fix it?
- Important 8 — What is back-pressure and how does
asyncio.Queue(maxsize=...)provide it? - Important 9 — When do you use
asyncio.to_thread, when aProcessPoolExecutor, and how big is the default thread pool? - Important 10 — How do you test async code with pytest, and why does this project use strict mode?
- Good to know 11 — What does
contextvarssolve thatthreading.localcannot? - Good to know 12 — What do the GIL and the free-threaded build change for asyncio code?
FastAPI Fundamentals: ASGI, Routes, Path & Query Parameters, Status Codes, OpenAPI Docs
Open the chapter · 12 questions
- Must-know 1 — What are Uvicorn, Starlette and FastAPI each responsible for when a request arrives?
- Must-know 2 — You register
GET /users/{user_id}and thenGET /users/me. What doesGET /users/medo, and how do you fix it? - Must-know 3 — When do you write
async defand whendeffor a path operation, and what happens to each? - Must-know 4 —
q: Optional[str]with no default: isqrequired? What aboutq: str | None = None? - Must-know 5 — What does a 422 response from FastAPI contain, and which exception produces it?
- Important 6 — How do you return 201 with a
Locationheader from a create endpoint, and 204 from a delete? - Important 7 — Your function returns a dict containing
password_hash. The decorator hasresponse_model=UserOutwithout that field. What does the client receive? - Important 8 — Why does
PUT /products/1returnAllow: GETeven thoughDELETE /products/{product_id}exists, and why doesHEAD /healthreturn 405? - Important 9 — What is the lifespan, when does it run, and what changes with
--workers 4? - Important 10 — How do you run a FastAPI app in development, on a VM and on Kubernetes?
- Good to know 11 — What do
/docs,/redocand/openapi.jsonserve, and how do you turn them off? - Good to know 12 — Where does your
@app.middleware("http")sit, and why can it miss headers on a 500?
Request Validation: Pydantic Query/Body Models, Cookies, Headers, Custom Validators, Error Responses
Open the chapter · 12 questions
- Must-know 1 — How does FastAPI decide whether a function parameter comes from the path, the query string or the body?
- Must-know 2 —
q: str | Nonewithout a default: isqrequired? What about?q=null? - Must-know 3 — When do you use
AfterValidator,BeforeValidator,field_validator,model_validatorand a dependency? - Must-know 4 — What does
extra="forbid"do on a query model, a body model and a header model? - Must-know 5 — Show the default 422 body and explain each member. Which exception produces it?
- Important 6 — How do you return RFC 9457 Problem Details for validation errors, and what must the handler not do?
- Important 7 — Which attributes should a session cookie have, and how do you set them in FastAPI?
- Important 8 — How are header names mapped from Python, and how do you receive a header that appears twice?
- Important 9 — What is the difference between
exclude_unset,exclude_defaultsandexclude_none, and which one does PATCH need? - Important 10 — How do you accept an uploaded image safely?
- Good to know 11 — What is the difference between lax and strict mode, and where should strict mode not be used?
- Good to know 12 — How would you validate a national postcode such as an Indian PIN code, and where does "do we deliver there?" belong?
Dependency Injection with Depends: Sub-dependencies, Caching, Global & Router Dependencies, Overrides
Open the chapter · 12 questions
- Must-know 1 — What does FastAPI do with
session: Annotated[Session, Depends(get_session)]on every request? - Must-know 2 — Two dependencies both need
get_current_user. How many times does it run, and when could it run twice? - Must-know 3 — Where should
session.commit()go: afteryieldin the dependency or in the route? Why? - Must-know 4 — What is the difference between a parameter dependency, a decorator dependency, a router dependency and a global dependency?
- Must-know 5 — How do you replace the real user lookup in a test, and what exactly stops running?
- Important 6 — You override
RoleCheckerbut the admin check still returns 403. Why? - Important 7 — A yield dependency catches
ValueErrorand does not re-raise. What does the client see, and what is logged? - Important 8 — What belongs in the lifespan and what in a dependency? Give the engine/session example.
- Important 9 — When does the code after
yieldrun on current FastAPI, and how has that changed? - Important 10 — Your global dependency sets
X-Request-IDon the injectedResponse, but 401 and 404 responses lack it. Why, and what is the fix? - Good to know 11 — How do Laravel's
bind,singletonandscopedmap to FastAPI? - Good to know 12 — How does a Go service do the same without a framework, and what are wire and fx?
APIRouter & Project Structure: Layers vs Features, Prefixes, Tags, Lifespan, Settings
Open the chapter · 12 questions
- Must-know 1 — What is the difference between
app.include_router(router)andapp.mount("/x", other_app)? - Must-know 2 — You include a
/users/{user_id}router and then a/users/merouter. What happens onGET /users/me, and how do you fix it? - Must-know 3 — How do you require an admin token for every route of a router you are not allowed to edit?
- Must-know 4 — Why use an app factory instead of a module-level
app = FastAPI()? - Must-know 5 — Where do you open a database engine and an HTTP client, and how does a route reach them?
- Important 6 —
SHOP_APP_NAMEis set in the environment, in.envand in/run/secrets/shop_app_name. Which value doesSettings()use? - Important 7 — Why wrap
get_settings()in@lru_cache, and what does that mean for tests? - Important 8 — Layer-based or feature-based layout: when do you choose which?
- Important 9 — Your SDK has methods called
getProductApiV1ProductsProductIdGet. How do you fix that without breaking uniqueness? - Important 10 —
orders/service.pyimportscatalog/service.py, andcatalog/service.pyimportsorders/service.py. What fails and how do you fix it? - Good to know 11 — You call
@router.get("/late")afterapp.include_router(router). Why does/latereturn 404 on FastAPI 0.128.8 but 200 on 0.140? - Good to know 12 — How should the tests of a feature-based package be laid out, and where do the fixtures go?
Exceptions & Responses: HTTPException, Custom Handlers, Problem Details, Response Models, StreamingResponse & SSE, Static Files
Open the chapter · 12 questions
- Must-know 1 — Why should you
raiseanHTTPExceptioninstead of returning it, and what happens if you return it? - Must-know 2 — You registered
@app.exception_handler(HTTPException)with the class imported fromfastapi, but typos in URLs still return{"detail":"Not Found"}. Why, and what is the fix? - Must-know 3 — What exactly happens when a route raises
RuntimeErrorand you have a handler forException? - Must-know 4 — How do you map a service's
OrderNotFoundandOutOfStockto HTTP without the service importing FastAPI? - Must-know 5 — A client streams a large CSV export but reads very slowly. Does the server buffer the whole file in memory?
- Important 6 — Write the bytes of an SSE event of type
orderwith id 7 and JSON data, and explain how a browser resumes after a disconnect. - Important 7 — Your SSE endpoint works locally but behind Nginx all events arrive at the end, and quiet streams die after a minute. What do you change?
- Important 8 — How does a streaming endpoint notice that the client left, and what must the generator do?
- Important 9 — What does the client see if an exception happens after the first chunk of a stream, and how do you report such errors?
- Important 10 —
response_model, return annotation,response_model_exclude_unset,response_model_exclude_none: what does each do, and which wins if both model declarations are present? - Good to know 11 — Which status, body and headers do 201, 204 and 304 need, and how does FastAPI produce each?
- Good to know 12 — When is
StaticFilesthe right tool, and what must you add yourself?
SQLAlchemy 2 & SQLModel: Engine, Sessions, Models, Relationships, Eager Loading, Async Sessions
Open the chapter · 12 questions
- Must-know 1 — What is the difference between
flush()andcommit(), and what happens to your objects aftercommit()? - Must-know 2 — A list endpoint returns 100 rooms with their bookings and sends 101 queries. Why, and what are two fixes?
- Must-know 3 — Why does a SQLModel app usually have
RoomBase,Room,RoomCreate,RoomPublicandRoomUpdate? - Must-know 4 — How do you implement PATCH correctly with SQLModel?
- Must-know 5 — What is the identity map, and what does it buy you?
- Important 6 — Deleting a room should delete its bookings. What are the two ways, and which does the snippet use for what?
- Important 7 — How do you find rooms that are free between two dates in one query, and why is the check still not enough to prevent double bookings?
- Important 8 — What is
MissingGreenlet, and how do you avoid it? - Important 9 — Two admins edit the same room at the same time. How does the snippet prevent the lost update?
- Important 10 — Why does the snippet attach a
connectevent listener and useStaticPoolin tests? - Good to know 11 — How do Eloquent's
with(),preventLazyLoading()and$fillablemap to SQLAlchemy/SQLModel? - Good to know 12 — What does a Go service with pgx or sqlc do instead of an ORM session?
Queries in Practice: Filtering, Pagination, exists, Counts, Date Ranges, Cascade Rules
Open the chapter · 12 questions
- Must-know 1 — Why does OFFSET pagination get slower on deep pages, and what replaces it?
- Must-know 2 — Your keyset predicate is
price > ? OR (price = ? AND id > ?)and the page is still slow. Why, and how do you fix it? - Must-know 3 — Why must every paginated
order_byend with a unique column? - Must-know 4 — What is the difference between
exists(),func.count()andlen()for "does this room have bookings"? - Must-know 5 — How do you find rooms that are free between two dates, and why not
between? - Important 6 — A filter
?amenity=wifi&amenity=kitchenmust return rooms with both. How do you write it, and what goes wrong with a join? - Important 7 — You filter rooms with a join on Alice's bookings and add
selectinload(Room.bookings). What is inroom.bookings? - Important 8 — What does
synchronize_sessioncontrol in a bulkupdate(), and which value do you use? - Important 9 — When do you use
cascade_delete=True,ondelete="CASCADE"andpassive_deletes, and what happens on SQLite without the pragma? - Important 10 — Why does
DateTime(timezone=True)not protect you on SQLite, and what does the snippet do instead? - Good to know 11 — How do you prove in CI that a list endpoint has no N+1?
- Good to know 12 — How do Laravel's
paginate(),cursorPaginate(),whereHasandwithCountmap to this page, and what does a Go service use?
Alembic Migrations, Transactions & Indexes from the ORM
Open the chapter · 12 questions
- Must-know 1 — Why is
SQLModel.metadata.create_all()not a migration tool, and where is it still the right choice? - Must-know 2 — Autogenerate produced
op.add_column("room", sa.Column("floor", sa.Integer(), nullable=False)). What is wrong with it, and what do you ship instead? - Must-know 3 — What can autogenerate not detect, and how do you protect against it?
- Must-know 4 — A revision fails on its third statement. What state is the database in on PostgreSQL, MySQL and SQLite?
- Must-know 5 — Where should
alembic upgrade headrun in a Kubernetes deployment with five replicas, and why not in the FastAPI lifespan? - Important 6 — How do you add an index to a 200-million-row PostgreSQL table with Alembic without blocking writes?
- Important 7 — Why does the snippet's
env.pynot enablePRAGMA foreign_keys=ON, although the application does? - Important 8 — Two developers each added a revision on top of
0006. What happens onalembic upgrade head, and how do you fix it? - Important 9 — Commit in the route or commit in a dependency? What exactly goes wrong with a commit after
yield? - Important 10 — How do you import 10,000 bookings so that bad rows are skipped but good rows are kept, all in one transaction?
- Good to know 11 — Two requests try to book the last free night of room 12. What does
with_for_update()do, and why does your SQLite test suite not prove it? - Good to know 12 — How do goose and Laravel express what Alembic does with
autocommit_block()and--sql?
Authentication in FastAPI: Password Hashing, OAuth2PasswordBearer, JWT, Refresh Tokens, Password Reset, API-Key Headers
Open the chapter · 12 questions
- Must-know 1 — Walk through what happens when a client calls GET /users/me with a Bearer token in this chapter's app.
- Must-know 2 — How should passwords be stored, and how do you move old bcrypt hashes to argon2id without a reset campaign?
- Must-know 3 — Why is the login response for an unknown e-mail identical to the one for a wrong password, and what else must be identical?
- Must-know 4 — 401 or 403: which for a missing token, an expired token, and a valid token without the admin role?
- Must-know 5 — Explain refresh token rotation with reuse detection, and why the legitimate user is logged out too.
- Important 6 — Two refresh requests with the same token arrive at the same millisecond. What goes wrong with a naive implementation, and what is the fix?
- Important 7 — Why choose PyJWT over python-jose, and which decode arguments are mandatory?
- Important 8 — How does logout work when access tokens are stateless JWTs?
- Important 9 — Where should a browser app keep the refresh token, and what does that force you to add?
- Important 10 — Design a password reset flow. What are the properties of the token?
- Good to know 11 — When do you move from HS256 to EdDSA or RS256, and how do you rotate keys?
- Good to know 12 — How do Laravel Sanctum, Passport and Fortify map onto this chapter, and what does Go use?
Testing FastAPI: TestClient, Fixtures, Database Fixtures, Dependency Overrides, Mocking HTTP Clients
Open the chapter · 12 questions
- Must-know 1 — What does
with TestClient(app) as client:do thatclient = TestClient(app)does not, and how do you see the difference in a test? - Must-know 2 — How does the transaction-per-test fixture survive the route calling
session.commit()? - Must-know 3 — Why does the snippet's engine set
isolation_level = Noneand emit its ownBEGIN, and what happens without it? - Must-know 4 — How do you test a route that needs a logged-in user, and when do you override
get_current_userinstead? - Must-know 5 — Your booking route calls a payment API with httpx. How do you test success, decline and timeout without the network, and what proves no test reaches it?
- Important 6 — Rollback per test or schema recreate per test: what did you measure, and when would you pick recreate?
- Important 7 — When must you use
httpx.AsyncClientwithASGITransportinstead ofTestClient, and what extra step does the lifespan need? - Important 8 — How do
conftest.pyfiles combine, and how does the snippet run the same API tests under three database strategies? - Important 9 — A test fails only when run after another test. List the usual causes in a FastAPI suite and the fix for each.
- Important 10 — Why assert on the
(loc, type)pairs of a 422, and why didPOST /roomswith no token and an invalid body return 401? - Good to know 11 — What does an OpenAPI snapshot test protect, and what makes it useless?
- Good to know 12 — How do Laravel's
RefreshDatabase,actingAsandHttp::fakeand Go'shttptestmap to this chapter?
FastAPI in Production: Uvicorn/Gunicorn Workers, Lifespan, Settings, Logging, Docker Image, Performance
Open the chapter · 12 questions
- Must-know 1 — Your async API runs with one Uvicorn worker on a 4-core VM. Will
--workers 4make it four times faster? - Must-know 2 — What exactly happens between SIGTERM and process exit in Uvicorn, and what does
--timeout-graceful-shutdownchange? - Must-know 3 — Why must the Dockerfile use exec-form
CMD, and what doestiniadd? - Must-know 4 — What is the difference between a liveness and a readiness probe, and what should each check?
- Must-know 5 — In what order does pydantic-settings resolve a value, and why is
get_settings()wrapped in@lru_cache? - Important 6 — Four workers,
pool_size=5,max_overflow=5, three replicas, rolling deploy withmaxSurge: 1. How many PostgreSQL connections can the service open? - Important 7 — A
defendpoint and anasync defendpoint both wait 100 ms. Why did thedefone top out at about 355 req/s with 100 users, and what fixed it? - Important 8 — How do you make every log line of a request carry the same request ID, including lines from
defendpoints and libraries? - Important 9 — Behind Nginx,
request.client.hostis always10.0.3.17. What do you change, and what must you not do? - Important 10 — Gunicorn with
UvicornWorkeroruvicorn --workers: what does each give you, and what did the boot-failure run show? - Good to know 11 — How does Laravel Octane relate to Uvicorn workers, and what is the Laravel equivalent of
@lru_cache get_settings()? - Good to know 12 — What does Go do instead of worker processes, and how does
Shutdown(ctx)compare with Uvicorn's shutdown?
Background Tasks, Caching & External APIs: BackgroundTasks, httpx, Retries, In-Memory & Redis Caching
Open the chapter · 13 questions
- Must-know 1 — When does a FastAPI background task run, and why does your
TestClienttest seem to say otherwise? - Must-know 2 — Your team wants to move order-confirmation e-mails and invoice generation into
BackgroundTasks. What do you say? - Must-know 3 — Which timeouts does httpx have, what are the defaults, and what does none of them cover?
- Must-know 4 — Why one
AsyncClientper app, and how do you create and close it in FastAPI? - Must-know 5 — Which requests may you retry automatically, and how does an idempotency key change the answer for a POST?
- Important 6 — What are exponential backoff, jitter and a retry budget, and why do you need all three?
- Important 7 — Describe the circuit breaker's states and where it sits relative to retries and the rate limiter.
- Important 8 — Why is
@lru_cachewrong on anasync def, and what do you use instead? - Important 9 — How do you design Redis cache keys and values, and how do you invalidate?
- Must-know 10 — What is a cache stampede and which defences do you know?
- Important 11 — How do you receive a webhook safely?
- Good to know 12 — How do you test code that calls external APIs and Redis without the real services?
- Good to know 13 — What do Laravel and Go offer for the same problems?
Platform
Linux for Developers: Processes, Users & Permissions, Filesystems, Packages, systemd, Monitoring
Open the chapter · 13 questions
- Must-know 1 —
systemctl stop orders-apitakes 15 seconds every time and the journal shows exit status 137. What happened and what do you change? - Must-know 2 — A file is
rw-rw-rw-but you get "Permission denied" opening it. List three causes. - Must-know 3 —
df -hsays/varis 100% full butdufinds only 2 GB on a 50 GB volume. Why, and how do you recover? - Must-know 4 — What is the difference between SIGTERM and SIGKILL, and why can a process in
Dstate ignore both? - Must-know 5 — Why does a service started by systemd ignore the
nofilelimit you put in/etc/security/limits.conf, and where do you set it? - Important 6 — A Go service binds
:443as userorders. What are three ways to make that work without running as root? - Important 7 — What does
Type=notifychange compared withType=simple, and what happens if the program never sendsREADY=1? - Important 8 — Why is a systemd timer with
Persistent=truebetter than a cron line for a nightly backup, and when is cron still fine? - Important 9 — How do
availablememory,oom_score_adjandMemoryMaxrelate, and what does exit 137 after a memory spike tell you? - Important 10 — Load average is 12 on a 4-CPU box but
topshows the CPUs mostly idle. What do you look at? - Important 11 — Why should SSH password logins be off, and how do you change
sshd_configwithout locking yourself out? - Good to know 12 — A hard link and a symbolic link to the same file: what happens to each when the original name is removed?
- Good to know 13 — Why run servers in UTC, and what does chrony's
makestep 1.0 3do?
Shell Scripting & Text Processing: Bash, Pipes, grep, sed, awk, jq, Safe Scripts
Open the chapter · 14 questions
- Must-know 1 — A script runs
rm -rf $BUILD_DIR/cacheand one day deletes far more than intended. What happened and what three habits prevent it? - Must-know 2 — Why does
set -enot stop the script aftergrep -q ERROR log || true; false | true, and what doespipefailchange? - Must-know 3 — What is the difference between
cmd > out 2>&1andcmd 2>&1 > out? - Must-know 4 — Why is
ls | xargs rmwrong, and what is the safe form? - Must-know 5 — How do you make a cron job that must never run twice at the same time? Compare
flockandmkdir. - Important 6 — A script uses
sed -i 's/a/b/' fileand works on Ubuntu CI but fails on a developer's Mac. Why, and what is the portable fix? - Important 7 —
curl https://api/xreturns an HTML 500 page but the script continues as if it worked. What do you add? - Important 8 — Explain why
trap 'rm -rf "$tmp"' EXITis not enough for a robust cleanup, and what you add. - Must-know 9 — When is it time to rewrite a shell script in Go or Python?
- Important 10 — What is the difference between
[ ]and[[ ]], and why does[ $x = y ]sometimes fail with "unary operator expected"? - Important 11 — Why do you pipe
sortbeforeuniq -c, and how do you list the top five client IPs in an access log? - Must-know 12 — Why must a Docker entrypoint script end with
exec "$@", and what happens without it? - Good to know 13 —
artisan migrate --isolatedreturns 0 on a host, yet the migration did not run there. Is that a bug? - Good to know 14 — Why parse a
.envfile with a loop instead ofsource .env, and where should production secrets live?
Git & Version Control: Object Model, Branching Strategies, Rebase vs Merge, PRs, Hosting
Open the chapter · 14 questions
- Must-know 1 — What exactly is a commit in Git, and what makes its id change?
- Must-know 2 — What is the difference between
git diff,git diff --stagedandgit diff HEAD? - Must-know 3 — When does
git mergefast-forward, and why would a team pass--no-ff? - Must-know 4 — You rebased your feature branch and
git pushis rejected. What do you run, and why not--force? - Must-know 5 — You ran
git reset --hard HEAD~3by mistake. How do you get the commits back, and what is truly lost? - Important 6 — Merge, rebase merge or squash merge for pull requests: how do you choose?
- Must-know 7 — A Stripe live key was pushed to
mainten minutes ago. Walk through the response. - Important 8 — What do the three parts of
v1.2.3-2-g5f0f15bfromgit describemean, and how would Go name the same commit? - Important 9 — Compare trunk-based development, GitHub Flow, GitLab Flow and git-flow in one sentence each.
- Important 10 — Why do hooks not enforce anything, and what does?
- Good to know 11 — Your monorepo clone is 8 GB and takes 20 minutes. What do you change for developers and for CI?
- Good to know 12 — Submodule or subtree for sharing a library between two applications?
- Important 13 — Why must
composer.lockbe committed while.envmust not be? - Good to know 14 — What do the GitHub "Verified" badge and
git log --format=%G?tell you, and what do they not?
Containers Under the Hood: Namespaces, cgroups v2, OverlayFS, OCI, containerd, runc, LXC
Open the chapter · 14 questions
- Must-know 1 — What is a container, in terms of kernel features, and why is it not a VM?
- Must-know 2 — Your app runs as PID 1 and
docker stopalways takes 10 seconds. Explain the kernel rule and two fixes. - Must-know 3 — What is the difference between cgroups v1 and v2, and how do you tell which one a host uses?
- Must-know 4 — A Go service with
limits.cpu: 2on 64-core nodes has p99 spikes of ~100 ms. What is happening and how do you fix it? - Must-know 5 — What happens, step by step, when a container's memory reaches
memory.max? - Important 6 — Explain lowerdir, upperdir, workdir, copy-up and whiteouts in OverlayFS.
- Must-know 7 — Who does what in
docker run: dockerd, containerd, the shim and runc? - Important 8 — Why did Kubernetes remove dockershim, and what runs containers on a node now?
- Important 9 — How do user namespaces make rootless containers possible, and what are their typical limitations?
- Important 10 — Why does
chrootnot isolate a process, and what do runtimes use instead? - Important 11 — When would you choose gVisor, Kata Containers or Firecracker over runc?
- Important 12 — How do you size
pm.max_childrenfor a php-fpm container with a 512 MiB limit? - Good to know 13 — What does
GOMEMLIMITdo, and why set it belowmemory.max? - Good to know 14 — What is the difference between a system container (LXC/Incus) and an application container (Docker/Podman)?
Images & Dockerfiles: Layers, Caching, Multi-Stage, Multi-Arch, Tagging, Registries, Artifacts
Open the chapter · 13 questions
- Must-know 1 — A Dockerfile downloads a 400 MB archive in one
RUN, extracts it in a second and deletes the archive in a third. Why is the image still large, and what are two fixes? - Must-know 2 — You edit one Go source file and CI re-downloads every module. What is wrong in the Dockerfile and how do you fix it?
- Must-know 3 —
docker stopon your container always takes 10 seconds and the app logs no shutdown. Why, and what do you change? - Must-know 4 — What is the difference between
ENVandARG, and why is neither acceptable for an npm or Composer token? - Must-know 5 — Why deploy
image@sha256:...instead ofimage:1.4, and what does Kubernetes do differently for:latest? - Important 6 — Your Go image is
FROM scratchand HTTPS calls fail withx509: certificate signed by unknown authority. Explain and give two fixes. - Important 7 — How does a cross-compiled multi-arch Go build avoid QEMU, and which Dockerfile lines make it work?
- Important 8 — Why should the php-fpm container's port 9000 never be published, and what serves HTTP instead?
- Important 9 — Why does running
php artisan config:cachein the Dockerfile cause production bugs, and where should it run? - Important 10 — What do
--provenance=mode=min,mode=maxand--sbom=trueattach, and what is the risk ofmode=max? - Good to know 11 — Is
docker build --squasha good way to shrink images today? - Good to know 12 — Two builds of the same commit produce different digests. Name three causes and the fix for each.
- Must-know 13 — A Compose stack marks the distroless Go container unhealthy forever although the service works. What is the likely HEALTHCHECK, and what is the fix?
Running Containers: docker run, Runtime Options, Volumes & Bind Mounts, Compose, Dev Workflow
Open the chapter · 13 questions
- Must-know 1 — A container started with
docker run -d my-nginx service nginx startexits immediately. Why, and what is the fix? - Must-know 2 — You ran
docker compose downandupand your Postgres data is gone, although "it is in a volume". Name three ways this happens. - Must-know 3 —
docker stop apialways takes exactly 10 seconds and the logs show no shutdown message. What is going on? - Must-know 4 — Your app container cannot connect to
db:5432although both containers run. They were started with plaindocker run. Why? - Must-know 5 — On a Linux CI runner the Laravel dev stack fails with "Permission denied" writing
storage/logs, while it works on every developer's Mac. Explain and fix. - Important 6 — Your
compose.yamlhasdepends_on: [mysql]and the app crashes on first boot with a connection error. What two changes make start-up reliable? - Important 7 — After a week on a small VM the disk is full and
/var/lib/docker/containersis huge. What happened and what do you change? - Important 8 — What is the difference between the project
.envfile andenv_file:in Compose? - Important 9 — A distroless service running as UID 65532 fails to read
/run/secrets/db_password, and settingmode: 0444on the secret changes nothing. Why? - Important 10 — Why should a production host never auto-load
compose.override.yaml, and how do you prevent it? - Good to know 11 — You set
--cpus=1on a Go service running on a 16-core host. What does Go 1.25+ do with that, when, and what should you still set yourself? - Good to know 12 — When would you choose Compose Watch
rebuildover a bind mount with air for Go development? - Good to know 13 — Your team is over Docker Desktop's free-use threshold. What are the alternatives on macOS and what changes for the Compose files?
Container Security: Rootless, Capabilities, seccomp, AppArmor/SELinux, Image Scanning, Pod Security
Open the chapter · 14 questions
- Must-know 1 — An attacker gets code execution in a container started with plain
docker run image. List what limits them by default and the three biggest gaps. - Must-know 2 — Why does
--cap-add NET_BIND_SERVICEnot let a non-root process bind port 80, and what is the right fix? - Must-know 3 — What exactly does
--privilegedchange, and what would you grant instead for a container that needs to configure network interfaces? - Must-know 4 — Explain the difference between rootless Docker,
userns-remapand KuberneteshostUsers: false. - Must-know 5 — A namespace enforces restricted Pod Security. Which fields must every Pod set, and which important controls are still missing?
- Important 6 — Your Deployment applies cleanly in a restricted namespace, but no Pods appear. Why, and how do you find out?
- Must-know 7 — Why is mounting
/var/run/docker.sockinto a CI job equivalent to giving it root on the host, even with:ro? - Important 8 — Why does Kubernetes need the kubelet's
--seccomp-default, and what doesRuntimeDefaultmean? - Important 9 — Your scanner reports a Critical CVE in a Go module inside a distroless image. Walk through the decision.
- Important 10 — What does a keyless cosign signature prove, and what must the verifier check besides "valid signature"?
- Important 11 — How do you give a Laravel container a read-only root filesystem without breaking it?
- Good to know 12 — Why are PID limits a security control, and where do you set them in Docker and Kubernetes?
- Good to know 13 — What is dependency confusion and how do Composer and Go defend against it?
- Good to know 14 — What does SELinux MCS add on top of type enforcement for containers?
Kubernetes Architecture & Setup: Control Plane, Nodes, kubectl, Local & Managed Clusters, kubeadm
Open the chapter · 13 questions
- Must-know 1 — Walk through what happens between
kubectl apply -f deployment.yamlreturning and the Pods serving traffic. Which components are involved, and which of them talk to etcd? - Must-know 2 — The control plane of your cluster is unreachable for 20 minutes. What keeps working, what stops, and why?
- Must-know 3 — Why does etcd run with 3 or 5 members and not 4? What happens when 2 of 3 members fail?
- Must-know 4 — A colleague says "Kubernetes removed Docker support in 1.24, so our Docker images no longer work". Correct them.
- Must-know 5 — What is the difference between
kubectl create -f,kubectl apply -fandkubectl apply --server-side -f? When would you see a conflict? - Important 6 — Your controller logs
410 Goneafter a network blip and stops seeing changes. Explain the mechanism and the fix. - Must-know 7 — A Service has zero endpoints although the Deployment's Pods are Running and Ready. What do you check first, and why does Kubernetes not report an error?
- Important 8 — Your cluster runs kube-apiserver 1.36 on three instances, controllers 1.36 and node pools at 1.35 and 1.33. Can you upgrade the control plane to 1.37 today? To 1.38?
- Important 9 — What does EKS (or GKE, AKS) manage for you, and what do you still own on day 2?
- Important 10 — You built
ghcr.io/acme/orders-api:1.4.2locally and applied the Deployment to a kind cluster. The Pods are inImagePullBackOff. Why, and what are two fixes? - Important 11 — Why does the Laravel Pod's Nginx config say
fastcgi_pass 127.0.0.1:9000when the Compose version saidapp:9000, and where do the PHP files and the public assets live? - Good to know 12 — When is
kubectl apply --dry-run=serverbetter than--dry-run=client, and what can it still not catch? - Good to know 13 — Name three situations in which you would not put a service on Kubernetes.
Kubernetes Workloads: Pods, Probes, Deployments, StatefulSets, DaemonSets, Jobs, Rollouts
Open the chapter · 12 questions
- Must-know 1 — Your Go service returns a burst of 502s from the Ingress on every rollout, although it handles SIGTERM with
http.Server.Shutdown. Explain the cause and the fix. - Must-know 2 — Why must a liveness probe not check the database, and where does that check go instead?
- Must-know 3 — A JVM or Laravel app takes up to 90 s to start on a busy node and keeps restarting during start. Which probe settings fix it without slowing failure detection later?
- Must-know 4 — With 10 replicas and the default rolling-update parameters, how many Pods can exist and how many must be available during a rollout? What changes with
maxSurge: 0? - Must-know 5 — Why can you not change
spec.selector.matchLabelsof a Deployment, and how should labels be designed so you never need to? - Important 6 — A Laravel queue worker Deployment loses jobs mid-way on every deploy. Which three settings must agree, and how?
- Important 7 — When should Nginx be a native sidecar of php-fpm, and what goes wrong with two regular containers?
- Important 8 — A Job should fail immediately when its container exits with code 42, ignore Pods lost to node drains, and retry other failures. Write the relevant fields.
- Important 9 — How do you roll a new version out to one member of a 3-replica StatefulSet first, and what must you do if that member never becomes Ready?
- Important 10 — A node drain hangs for an hour on "Cannot evict pod as it would violate the pod's disruption budget". Give two causes and fixes.
- Good to know 11 — Two options for the Laravel scheduler in Kubernetes: compare them and name the setting that prevents double runs in each.
- Good to know 12 — Your manifest uses
image: orders-api:1.4and the tag was re-pushed. Why do Pods now run two versions, and what reference should CI write instead?
Kubernetes Config, Secrets & Storage: ConfigMaps, Secrets, ESO, PV/PVC, CSI, Database Operators
Open the chapter · 14 questions
- Must-know 1 — You changed
LOG_LEVELin a ConfigMap that the Deployment loads withenvFrom, and an hour later the Pods still log at the old level. Why, and what are two ways to fix it? - Must-know 2 — A mounted ConfigMap is updated, but the file the app reads at
/etc/nginx/conf.d/tuning.confnever changes. What is the likely cause? - Must-know 3 — Are Kubernetes Secrets encrypted? What would you check and change on a self-managed cluster?
- Must-know 4 — A developer has no
getpermission on Secrets inprodbut can create Deployments there. Can they read the database password? - Must-know 5 — Why prefer mounted secret files over
secretKeyRefenvironment variables for a database password? - Important 6 — What is the difference between External Secrets Operator and the Secrets Store CSI Driver, and when would you choose each?
- Important 7 — How do Sealed Secrets and SOPS keep secrets safe in a GitOps repository, and what does each cost?
- Important 8 — A Deployment with one replica and a ReadWriteOnce PVC hangs on every rollout with a Multi-Attach error. Explain and fix.
- Important 9 — Why should StorageClasses for zonal cloud disks use
volumeBindingMode: WaitForFirstConsumer? - Must-know 10 — Someone deleted a PVC by mistake. When is the data gone, and how do you make this survivable?
- Important 11 — What does a CloudNativePG cluster give you that a hand-written PostgreSQL StatefulSet does not?
- Important 12 — In a Laravel app on Kubernetes, why must
php artisan config:cacherun at container start rather than in the Dockerfile, and what follows for Secret rotation? - Good to know 13 — Why does the Go watcher in this chapter watch the directory and ignore event types, instead of watching
log_level? - Good to know 14 — Where should Laravel user uploads live on Kubernetes, and why not on a PersistentVolumeClaim?
Resources, Scheduling & Autoscaling: Requests/Limits, QoS, Quotas, Taints, Spread, Priorities, HPA/VPA
Open the chapter · 13 questions
- Must-know 1 — A node shows 15 % CPU usage, yet a new Pod requesting 1 CPU stays Pending with
Insufficient cpu. Explain and give two fixes. - Must-know 2 — What is the difference between hitting the CPU limit and hitting the memory limit?
- Must-know 3 — Which QoS class does a Pod get if its app container has requests equal to limits but its sidecar has no resources, and why does it matter?
- Must-know 4 — Your HPA targets 70 % CPU but never scales. The Pods are busy. What do you check?
- Important 5 — Why do many teams run without CPU limits but with memory limit equal to request?
- Important 6 — A Go service with
limits.cpu: "1"on 32-core nodes has bad p99 latency under load. What is happening and what changes in Go 1.25? - Important 7 — How do you dedicate a spot node pool to batch jobs so nothing else lands there and the jobs land nowhere else?
- Important 8 — What does
maxSkew: 1withwhenUnsatisfiable: DoNotScheduleontopology.kubernetes.io/zoneguarantee, and what does it not? - Important 9 — Why should a VPA not run in
Recreatemode on a Deployment whose HPA scales on CPU? - Must-know 10 — How does KEDA scale a Laravel Redis queue worker, and why is scaling it to zero risky?
- Good to know 11 — Cluster Autoscaler or Karpenter: how do they decide to add and remove nodes?
- Must-know 12 — How do you size
pm.max_childrenfor a php-fpm container with a 1Gi memory limit? - Good to know 13 — Does a PodDisruptionBudget protect against HPA scale-down, node drains and preemption?
Kubernetes Security: RBAC, ServiceAccounts, Pod Security Admission, Policy Engines, Audit
Open the chapter · 13 questions
- Must-know 1 — A pipeline gets
deployments.apps "orders-api" is forbidden: User "system:serviceaccount:ci:deployer" cannot patch resource "deployments". Which gate failed, and what do you change? - Must-know 2 — Why is
createon Pods in a namespace effectively access to all its Secrets and ServiceAccounts, and what limits the damage? - Must-know 3 — What is the difference between a Role bound with a RoleBinding, a ClusterRole bound with a RoleBinding, and a ClusterRole bound with a ClusterRoleBinding?
- Must-know 4 — Your Laravel app never calls the Kubernetes API. Which three settings make sure a code-execution bug in it cannot use the API either?
- Must-know 5 — How do bound, projected ServiceAccount tokens differ from the old token Secrets, and what does
--service-account-extend-token-expirationchange? - Important 6 — You label a namespace
pod-security.kubernetes.io/enforce: restrictedand a team's Deployment applies cleanly, but no Pods appear. Why, and how should the label have been rolled out? - Important 7 — A Kyverno upgrade goes wrong and every
kubectl applyin the cluster now hangs for ten seconds and fails. Explain the mechanism and the two-level fix. - Important 8 — When would you write a ValidatingAdmissionPolicy instead of a Kyverno or Gatekeeper policy, and when not?
- Important 9 — Write down an audit policy strategy that lets you alert on exec and Secret reads without leaking Secret values into the log.
- Important 10 — After applying
default-deny-allinshop, every Pod logs "could not resolve host". What is missing, and what is the one-dash YAML trap to avoid when you fix the ingress rules? - Good to know 11 — How does IRSA let a Pod call S3 without access keys, and what still needs blocking?
- Good to know 12 — Which kube-apiserver and kubelet settings would you check first on a self-managed cluster, and what tool reports them against the CIS Kubernetes Benchmark?
- Must-know 13 — A developer says "I have no Secrets access, but
kubectl auth can-i create pods/exec -n paymentssays yes." Why does that matter, and what would you grant instead?
Packaging for Kubernetes: Helm Charts, Values, Releases, Kustomize Overlays
Open the chapter · 13 questions
- Must-know 1 — A pipeline runs
helm upgrade orders-api ./orders-api --set image.tag=$SHAand production suddenly has 2 replicas and the dev database host. What happened, and how do you fix the pipeline? - Must-know 2 — Why does a chart need separate
selectorLabelsandlabelshelpers, and what breaks if the version label goes into the selector? - Must-know 3 — Explain the three-way strategic merge with the "kubectl scale to zero, then helm rollback" example, and what Helm 4 changes.
- Must-know 4 — Where does Helm keep release state, what is in it, and why does that matter for security?
- Must-know 5 — Design the Laravel migration step for a Helm chart. Which annotations, what may the Job reference, and what must the migration itself guarantee?
- Important 6 —
helm lint --strictpasses in CI, buthelm installfails with "config.databaseHost is required". How is that possible, and what should CI run instead? - Important 7 — When would you choose Kustomize over Helm, and when both?
- Important 8 — What does
configMapGeneratordo that a hand-written ConfigMap does not, and what is the Helm equivalent? - Important 9 — Your Deployment has an HPA, and after every
helm upgradethe pod count drops to 2 for a minute. Why, and what are the chart and Kustomize fixes? - Important 10 — How do you publish a chart to an OCI registry, install it, and make the installation verifiable?
- Good to know 11 — Why are
commonLabels,bases,patchesStrategicMergeandpatchesJson6902still accepted by Kustomize, and what should a new kustomization use? - Good to know 12 — A chart ships a CRD in
crds/. Version 2 of the chart adds a field to the CRD, and afterhelm upgradethe field is rejected. Explain and give two fixes. - Must-know 13 — Argo CD syncs your Helm chart, and the migration hook runs on every sync, even when nothing changed. Why, and is it a problem?
Kubernetes Observability & Troubleshooting: Events, Logs, kube-state-metrics, CrashLoopBackOff, OOMKilled
Open the chapter · 13 questions
- Must-know 1 — A Pod shows
RESTARTS 7andCrashLoopBackOff.kubectl logsprints a normal startup line. Where is the error, and what else do you read? - Must-know 2 — A Pod has been
Pendingfor 20 minutes. What do you run first, and name three reasons the answer might give. - Must-know 3 — What is the difference between metrics-server, kube-state-metrics, node-exporter and cAdvisor?
- Must-know 4 — A container's last state is
OOMKilledwith exit code 137. What happened, and how do you prevent the next one? - Must-know 5 — Every Pod of a Deployment is
RunningandReady, but the Ingress returns 503. Walk through your checks. - Important 6 — You applied a ServiceMonitor, but Prometheus (installed with kube-prometheus-stack) shows no target. Name the likely causes.
- Important 7 — Why can an OpenTelemetry Collector that collects logs not run as a 3-replica Deployment, and why can the one that collects Events not run as a DaemonSet?
- Important 8 — How do you get a shell-like view into a distroless container, and what permission does it need?
- Important 9 — Your on-call engineer is paged at 09:00 for a crash at 03:00 and finds no Events. Why, and what platform change fixes it?
- Important 10 — An external API call from a Pod takes several extra DNS round trips. Explain
ndots:5and give two fixes. - Good to know 11 — Why does the Go service label requests with the route pattern and serve
/metricson a separate port? - Good to know 12 — How does a Laravel app on php-fpm expose RED metrics and JSON logs that a Kubernetes log pipeline can use?
- Must-know 13 — A namespace has been
Terminatingfor an hour. What is going on, and what is the risk of the quick fix?
CI/CD Pipelines: Stages, GitHub Actions in Depth, GitLab CI, Jenkins, Caching, Environments, OIDC
Open the chapter · 12 questions
- Must-know 1 — What is the difference between continuous delivery and continuous deployment, and which pipeline element implements the difference?
- Must-know 2 — Why does
permissions: packages: writeon its own breakactions/checkoutin a private repository? - Must-know 3 — A workflow step checks the PR title with the title expression inside a quoted shell variable assignment. Why is it exploitable, and what is the fix?
- Must-know 4 — When is
pull_request_targetdangerous, and what should you use instead? - Must-know 5 — How should a deploy job get AWS credentials, and what must the role's trust policy check?
- Important 6 — What is the difference between a cache and an artifact, and which one carries the image digest to the deploy job?
- Important 7 — Design the cache key for Go modules and for Composer. Why a lock-file hash with a prefix restore key?
- Important 8 — Two merges reach staging within a minute. How do you make sure deployments and migrations never overlap or get cancelled halfway, on GitHub and on GitLab?
- Important 9 — A digest was signed with cosign keyless inside a reusable workflow. Which identity do you verify, and why not the caller workflow?
- Important 10 — Why test a Laravel app against a database service container of the production engine instead of SQLite, and where do migrations run in the pipeline?
- Good to know 11 — Why pin actions by full commit SHA, and how do you avoid pinned actions going stale?
- Good to know 12 — A 36-minute test suite is split into three shards and the PR verdict still takes 25 minutes. What went wrong and what does it cost to fix?
Deployment Strategies: Rolling, Blue-Green, Canary, Progressive Delivery, Rollbacks
Open the chapter · 14 questions
- Must-know 1 — What is the difference between deploying and releasing, and why does it matter for rollback?
- Must-know 2 — A release renamed a column in one migration and the new code fails. Why is
kubectl rollout undonot the fix, and how should the change have been shipped? - Must-know 3 — How does a blue-green switch work on plain Kubernetes, and what makes it safe?
- Important 4 — With Ingress-NGINX, a request has
X-Canary: neverand the cookiecanary=always. Where does it go, and why? - Important 5 — An HTTPRoute rule lists backends with weights 3 and 1. What split results, and what if only one backend is listed with weight 0?
- Must-know 6 — An Argo Rollouts AnalysisRun fails at 20 %. What happens in the cluster and in Git, and what must the on-call do?
- Important 7 — Flagger runs with
interval: 1m,stepWeight: 10,maxWeight: 50,threshold: 5. How long at least until promotion, and how long until rollback when checks fail? - Important 8 — Your canary analysis query returns no data because the new version renamed its metric. What happens with
result[0] >= 0.99, and how do you make the gate safe? - Must-know 9 — How do you choose the default value of a feature flag, and what does OpenFeature do when the provider is down?
- Important 10 — Why does a percentage rollout hash the user ID with the flag key, and why must raising 10 % to 50 % never remove users?
- Must-know 11 — Pods return 502 for a second every time they are replaced. What is missing?
- Must-know 12 — After a symlink deploy of a Laravel app, some requests still run old code and queue jobs fail. Which steps are missing and in what order?
- Good to know 13 — When is
php artisan down --with-secretthe right tool? - Good to know 14 — Which DORA metrics does a deployment strategy influence, and what was MTTR renamed to?
GitOps: Principles, Argo CD, Flux, Drift, Image Automation
Open the chapter · 13 questions
- Must-know 1 — What are the four OpenGitOps principles, and which two does a CI job running
kubectl apply -kon every push violate? - Must-know 2 — Your Argo CD Application has
automated: {}. Someone deletes a Deployment manifest from Git and someone else scales another Deployment by hand. What happens to each, and what do you change? - Must-know 3 — Why is one branch per environment considered an anti-pattern, and what replaces it?
- Must-know 4 — An app is Synced but Degraded. What does each word tell you, and where do you look?
- Must-know 5 — How do you run Laravel migrations exactly once per release under Argo CD, and why must they be backwards compatible anyway?
- Must-know 6 — Why does a rollback in GitOps mean
git revert, and when doesargocd app rollbackfail? - Important 7 — Walk through Flux image automation of the Laravel tag from registry push to running pods.
- Important 8 — Why are ApplicationSets and app-of-apps repositories admin-only?
- Important 9 — An HPA scales a Deployment and Argo CD shows it OutOfSync every few minutes. Give two fixes and say which you prefer.
- Important 10 — How do Argo CD and Flux differ in the way they deploy a Helm chart?
- Important 11 — During an incident you must change a live Deployment by hand. How do you do it safely under GitOps?
- Good to know 12 — What does Kargo add on top of Argo CD, in its own words?
- Good to know 13 — Why would you deliver config to production clusters as a signed OCI artifact instead of a Git clone?
Infrastructure as Code: Terraform State, Modules, Plan/Apply, Pulumi, CDK, CloudFormation
Open the chapter · 12 questions
- Must-know 1 — What exactly is in the Terraform state file, and why does a "sensitive" output not keep a password safe?
- Must-know 2 — Two engineers run
terraform applyon the same S3 state at the same time. What prevents damage, and how do you configure it today? - Must-know 3 — You rename
aws_db_instance.dbtoaws_db_instance.postgres. What does the next plan do, and what is the right fix? - Must-know 4 — Why should CI apply a saved plan file, and what happens if the state changed after the plan?
- Must-know 5 — Design plan-on-PR / apply-on-merge for two environments in GitHub Actions without long-lived AWS keys.
- Important 6 —
countorfor_eachfor one subnet per availability zone, and why? - Important 7 — What is drift, how do you detect it, and when should you not "fix" it?
- Important 8 — Directory per environment or CLI workspaces?
- Important 9 — How do you test a Terraform module that creates AWS resources without an AWS account, and what are the limits?
- Important 10 — When would you choose Pulumi, AWS CDK or CloudFormation instead of Terraform?
- Good to know 11 — What changed with Terraform's license in 2023, and what does OpenTofu offer that Terraform does not?
- Good to know 12 — Should Terraform manage the Kubernetes workloads on an EKS cluster it creates?
Configuration Management: Ansible Playbooks & Roles, Chef, Puppet, Salt
Open the chapter · 13 questions
- Must-know 1 — What is the difference between provisioning, configuration management, image baking and GitOps, and which tool owns each?
- Must-know 2 — What does "agentless" mean for Ansible, and what does a managed node still need?
- Must-know 3 — Why does a
commandtask break idempotence, and what are the three ways to fix it? - Must-know 4 — Three tasks notify the same restart handler and a fourth task fails on host 3. What runs where?
- Must-know 5 — A role sets
nginx_workers: 4and the team setsnginx_workers: 16ingroup_vars/web.yml, but hosts keep 4. Why? - Must-know 6 — Where must secrets live in an Ansible repository, and how do they still leak?
- Important 7 — How do you roll a config change to 40 web servers so a mistake breaks at most one?
- Important 8 — Why can
--checkfail on a fresh host while the real run succeeds? - Important 9 — Why is
run_oncethe wrong way to run Laravel migrations in a play withserial? - Important 10 — How does the Go role restart the service without refusing connections?
- Important 11 — How should a CI pipeline get SSH access and the vault password for a production run?
- Good to know 12 — How do Puppet, Chef and Salt differ from Ansible in model and in how they fix drift?
- Good to know 13 — When should you not use configuration management at all?
Product
Requirements: PRDs, User Stories, Job Stories & Agent Specs
Open the chapter · 13 questions
- Must-know 1 — What is the difference between a functional and a non-functional requirement? Give one of each for the reorder feature.
- Must-know 2 — Name the sections of a one-page PRD and say which one you write first and why.
- Must-know 3 — What does INVEST stand for, and what do you do when a story scores 0 on Valuable?
- Must-know 4 — Rewrite this criterion so that it is a good acceptance criterion: "Then the reorder is saved in the database".
- Must-know 5 — How do acceptance criteria differ from the definition of done?
- Important 6 — How would you write acceptance criteria for an AI support assistant whose answers vary from run to run?
- Important 7 — A stakeholder asks to add subscriptions to Buy again in week four. What do you do, using the PRD?
- Important 8 — Split "Buy again" (13 points) into vertical slices using SPIDR.
- Important 9 — When would you write a job story instead of a user story? Write one for the reorder feature.
- Important 10 — What goes in a PRD, what in a technical design doc, an ADR and an API contract?
- Good to know 11 — What is requirement traceability, and what are a gap and an orphan?
- Good to know 12 — What are Amazon's PR/FAQ size rules, and when would you use one instead of a PRD?
- Must-know 13 — Why is a strict definition of ready risky, and what does a good one look like?