Prices shown are a USD base. Your local-market price is calculated at checkout in your own currency, plus any local sales tax.
What is inside
20 chapters, in the order the interviews tend to ask them:
Module layout and dependency direction
Types, interfaces and zero values
Structs, embedding and composition
Pointers, allocation and escape analysis
Errors, wrapping and sentinels
Goroutines, channels and select
Cancellation, bounded concurrency and shared state
HTTP servers, routing and middleware
JSON encoding and API contracts
database/sql, drivers and code generation
Connection pooling and Postgres limits
Postgres types and null handling
Schema design and constraints
Indexes and access paths
Query plans and EXPLAIN
Transactions, isolation and MVCC
Locks, deadlocks and contention
Migrations and schema evolution
Query efficiency and batch patterns
Testing and observability for data services
How the answers are built
Each chapter opens with the checklist the question is really testing. A few from this pack:
A module has one go.mod at its root, and every import resolves through the module graph, so a build is reproducible from go.mod and go.sum alone.
An interface is a set of methods, so any type with those methods satisfies it without declaring anything, which is why the interface is declared where it is consumed.
Go adds no padding between unlike fields, but every field is aligned to its own alignment, so ordering fields from widest to narrowest shrinks the struct and shrinks the stride of a slice of it.
Returning the address of a local variable is safe because the compiler relocates the value to wherever it can outlive the frame, and the language makes no promise about where a value lives.
An error is an interface with one method, Error() string, so any type you write can be an error and the compiler checks nothing else about it.
A goroutine is a cheap function with its own stack, and the runtime multiplexes many of them onto each OS thread.
Questions this pack covers
Where should a Go service draw its package boundaries?
What does the internal directory actually enforce for you?
What does an interface actually promise about a type?
Why is the empty interface a design smell in application code?
How do you shrink a struct by reordering its fields
What does embedding a struct do to its method set
Why is returning a pointer to a local variable safe
What does the escape analysis compiler flag tell you
Each one is answered in full in the pack, with the reasoning written out rather than a bullet list.