Loading…
0+ curated questions with the same answer shape every time: quick recap, deep dive, pitfalls, and follow-ups. Coverage includes .
The select statement and context package are the two tools that make Go concurrency production-grade. This module covers the select statement as the multiplexer for channel operations (how to wait on multiple channels, how the default case makes a non-blocking receive, the random selection when multiple channels are ready), context.Background and context.TODO for root contexts, context.WithCancel to propagate cancellation signals down a call chain, context.WithTimeout and context.WithDeadline for deadline-driven cancellation, context.WithValue for request-scoped metadata (and the type-key pattern to avoid collisions), and how to wire context through an entire Go service (HTTP handler → service layer → repository → database query). The classic interview question is 'what happens if you call cancel() twice?' and 'why does context.WithValue use interface{} for keys?'. Every answer shows the full cancellation propagation pattern interviewers look for in production-grade Go code.
Full catalog
Topics are ordered for learning. Within each topic, rows are numbered 1–0 globally so you always know where you are. Collapse topics if you want a lighter view — use Expand all when you need the full list again.
Numbers 1–0 follow the order we recommend — click any row to open the full answer, or use the sticky Next link at the bottom of each page to go Q1 → Q0.