Skip to Content
Skip to content
Go Intermediate: Interfaces, Concurrency, and Services
Intermediate
Courses
Go Intermediate: Interfaces, Concurrency, and Services

Check Yourself

Five scenario questions on sync.WaitGroup, data races, channel closing, and select with ctx.Done().

Course content

Sign in to save your progress.

Course Home
1. In `SquareAll`, 4 goroutines write `out[i] = n * n` into a pre-allocated slice `out := make([]int, len(nums))`. Why does `go test -race` pass without a mutex?
4. A producer goroutine tries to send `ch <- msg` on an unbuffered channel, but the receiver already timed out and returned. How do you prevent the producer from leaking forever?
5. Which channel type uses zero bytes per element when you only need to broadcast a "stop" signal by calling `close(done)`?

About

Five scenario questions on sync.WaitGroup, data races, channel closing, and select with ctx.Done().

Duration
5 min
Last update
11/27/2026
Was this helpful?
​ 0 ​ 0

Comments

Sign in to comment

No comments yet.