Loading…
40+ curated questions with the same answer shape every time: quick recap, deep dive, pitfalls, and follow-ups. Coverage includes goroutine basics, goroutine vs thread, channel creation, buffered vs unbuffered, and more.
Suggested path
Topics follow a teaching order. Each answer ends with a clear Next question control so you can move forward without hunting the list.
Goroutines and channels are the two features that make Go famous for concurrency, and they come up in every Go fresher interview. This module covers goroutine creation (the go keyword before a function call — that is all you need to start a new goroutine), why goroutines are lightweight (they start at about 2 KB of stack, grow dynamically, and are scheduled by the Go runtime — not the OS), the channel data type (typed conduits for communicating between goroutines), creating channels with make(chan T) for unbuffered and make(chan T, n) for buffered, sending and receiving (ch <- value to send, value := <-ch to receive), how unbuffered channels synchronise sender and receiver (both block until the other is ready), buffered channels (sender only blocks when buffer is full, receiver only blocks when buffer is empty), closing a channel (signals no more values will be sent; receiving from a closed channel returns the zero value), and ranging over a channel until it's closed. Every answer uses a runnable example and addresses the comparison: 'goroutines vs threads.'
Full catalog
Topics are ordered for learning. Within each topic, rows are numbered 1–40 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–40 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 → Q40.