Go's concurrency model — goroutines, channels, and the select statement — is one of its defining features. These exercises cover the core concurrency primitives and patterns every Go developer uses to write safe, efficient concurrent programs.
0 / 5 completed
1 / 5
At standup, a colleague asks what a goroutine is in Go. What is the correct answer?
Goroutines are Go's lightweight concurrency primitive. Unlike OS threads, goroutines start with a small stack (~2KB) that grows as needed, and the Go runtime schedules thousands or millions of them across a pool of OS threads using the M:N scheduler. You launch a goroutine with the go keyword: go myFunc(). The low overhead makes goroutines practical for per-connection or per-request concurrency.
2 / 5
During a PR review, a teammate asks how channels enable safe communication between goroutines. Which answer is correct?
Go channels are typed, concurrent-safe conduits. An unbuffered channel (make(chan T)) blocks the sender until the receiver reads — providing synchronisation. A buffered channel (make(chan T, n)) allows up to n values to be buffered before blocking. The Go proverb is: 'Do not communicate by sharing memory; share memory by communicating' — channels prevent data races by design.
3 / 5
In a design review, the team discusses the select statement in Go. A junior engineer asks what it does. What is correct?
Go's select statement listens on multiple channels simultaneously and executes the first case whose channel operation can proceed. If multiple cases are ready at the same time, Go picks one at random — ensuring fairness. Adding a default case makes select non-blocking (it executes immediately if no channel is ready). select is the idiomatic way to handle timeouts (time.After), cancellation, and fan-in patterns.
4 / 5
An incident report shows goroutines leaking because they never terminate after their context is cancelled. A senior engineer asks how context cancellation is correctly used in Go. What is correct?
Go's context.Context is the standard cancellation mechanism. You create a cancellable context with context.WithCancel(parent), pass it to goroutines, and call cancel() when done. The goroutine uses select { case <-ctx.Done(): return } to detect cancellation and exit cleanly. Without this pattern, goroutines block indefinitely on channel operations and leak. The defer cancel() pattern ensures cancellation is always called even on early returns.
5 / 5
During a code review, a senior engineer asks what sync.WaitGroup is used for. What is accurate?
sync.WaitGroup is the idiomatic way to wait for a set of goroutines to complete. Call wg.Add(1) before spawning each goroutine (or wg.Add(n) before a loop), and have each goroutine call defer wg.Done() before returning. The main goroutine (or coordinator) calls wg.Wait(), which blocks until the internal counter reaches zero. This is commonly used for fan-out patterns: spawn N worker goroutines, wait for all to finish, then aggregate results.
What does the "Go Concurrency Patterns Vocabulary" vocabulary exercise cover?
This exercise tests real IT vocabulary related to go concurrency patterns vocabulary through 5 multiple-choice questions, each built from realistic workplace sentences rather than abstract definitions.
Is this vocabulary exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is completely free — no account, sign-up, or payment required.
How many questions does this exercise have?
This exercise has 5 questions. Each one shows a real-world sentence or scenario with multiple-choice options and an explanation once you answer.
What happens after I answer a question?
You'll see immediate feedback showing whether your answer was correct, along with a short explanation of why — then a button to move to the next question, and a full results screen at the end.
Can I retry the exercise if I get questions wrong?
Yes. Once you reach the results screen, click "Try again" to reset your answers and go through the exercise from the start as many times as you like.
Do I need to create an account to take this exercise?
No account is needed. Your answers are scored in your browser during the session — nothing is saved to a server, so you can jump straight in.
Is my progress saved if I leave the page?
No — progress within an exercise resets if you navigate away or reload. Each exercise is short enough to complete in a few minutes in one sitting.
Are these vocabulary exercises connected to other topics?
Yes — browse the full vocabulary exercises hub to find related modules covering adjacent IT topics and roles.
How is this different from reading a glossary or blog article?
Exercises like this one are active recall drills — you have to choose the correct term or phrasing yourself, which builds retention faster than passively reading a definition.
Where can I find more vocabulary exercises?
Browse the full Vocabulary exercises hub for hundreds of modules covering Agile, DevOps, security, databases, architecture, and more — organised by IT role and skill.