These Go concurrency patterns questions cover worker pools, pipelines, fan-out, fan-in, semaphores, rate limits, errgroup and cancellation. We gathered them from public interview lists, coding rounds and community threads. Then we rewrote them in plain words and grouped them by pattern.
This post is questions only, so answer each one in your own words first. When you need help, read Go worker pool pattern, Go pipeline pattern with fan-out and fan-in and Go rate limiting. Also, finish Part 17 on context first, because every good pattern needs a clean way to stop.
How to Use These Go Concurrency Patterns Questions
Answer each of these Go concurrency patterns questions out loud, then sketch the goroutines and channels on paper. Most pattern bugs come from a missing close or a goroutine that never exits. Finally, try the scenario questions, since they come from real backend systems.
The table below lists each section and its number of questions.
| Section | What it tests | Questions |
|---|---|---|
| Pattern basics | Why patterns exist and how to pick one | 14 |
| Worker pools | Jobs, workers and results | 15 |
| Pipelines | Stages, fan-out and fan-in | 15 |
| Limits and backpressure | Semaphores, rate limits and bounded work | 15 |
| Errors and cancellation | errgroup, context and first result | 14 |
| Pattern coding tasks | Classic interview programs | 14 |

Go Concurrency Patterns Questions on the Basics
Before you answer, study Go goroutines for beginners and Go channels with examples. These Go concurrency patterns questions check why patterns exist before you write any of them.
- What is a concurrency pattern, and why do teams reuse the same few patterns?
- Which patterns appear most often in Go backends?
- How do you decide between a worker pool and a goroutine per task?
- What is the generator pattern, and why does it return a receive-only channel?
- Why should the goroutine that creates a channel usually also close it?
- What does ownership of a channel mean in a pattern?
- How do you make sure every goroutine in a pattern can exit?
- When is a simple loop faster than any concurrency pattern?
- How do CPU-bound and IO-bound tasks change your pattern choice?
- What is the or-done pattern, and when do you need it?
- How does the tee pattern copy one stream into two?
- Why do many senior developers prefer plain code over clever patterns?
- Scenario: when a service starts one goroutine per request and crashes under load, which pattern would you add?
- Scenario: when a teammate builds a five stage pipeline for a tiny task, what would you say in the review?
Go Concurrency Patterns Questions on Worker Pools
Before you answer, study Go worker pool pattern. Worker pools are the most common pattern in interviews, so these Go concurrency patterns questions cover them in detail.
- What is a worker pool, and which three parts does it have?
- How do you choose the number of workers for CPU work and for network work?
- Who should close the jobs channel, and who should close the results channel?
- Why do you often need a separate goroutine that waits and then closes results?
- How do you keep track of which job produced which result?
- How do you return results in the same order as the jobs?
- What happens when a worker panics, and how do you protect the pool?
- How do you stop a worker pool early when the caller gives up?
- Should the jobs channel have a buffer, and how large?
- How do you report progress from a worker pool?
- How do you resize a worker pool at run time, and is it worth it?
- Why is a worker pool safer than unlimited goroutines for database calls?
- How do you test a worker pool for leaks and races?
- Scenario: when a pool of ten workers processes one million rows but memory keeps growing, what would you check?
- Scenario: when results must keep the input order for a report, how would you change the pool?
Go Concurrency Patterns Questions on Pipelines
Before you answer, study Go pipeline pattern with fan-out and fan-in. These Go concurrency patterns questions test how you join stages with channels and stop them all together.
- What is a pipeline, and what does each stage receive and return?
- How do you connect three stages so that each runs in its own goroutine?
- What is fan-out, and when does it speed up a pipeline?
- What is fan-in, and how does a merge function use a WaitGroup?
- Why does fan-out break the order of values, and how can you restore it?
- How do you stop every stage when the last stage stops reading?
- How does a done channel or a context flow through all stages?
- What is backpressure in a pipeline, and how do unbuffered channels give it to you?
- Where should you add buffers in a pipeline, and why?
- What should happen when the middle stage of a pipeline hits an error?
- How do you measure which stage is the slowest?
- How would you batch values in a stage, for example 100 rows per insert?
- What is the bridge pattern for a channel of channels?
- Scenario: when a pipeline hangs after the consumer returns early, how would you fix the leak?
- Scenario: when one slow stage holds back the whole pipeline, how would you scale only that stage?
Go Concurrency Patterns Questions on Limits
Before you answer, study Go rate limiting and Go circuit breaker pattern. Limits protect your service and others, so these Go concurrency patterns questions focus on safety under load.
- How does a buffered channel work as a counting semaphore?
- What does the semaphore package in golang.org/x/sync add?
- How does errgroup.SetLimit bound the number of running goroutines?
- What is the difference between a concurrency limit and a rate limit?
- Why does a token bucket allow short bursts?
- How do you use golang.org/x/time/rate to limit calls per second?
- How do you limit requests per user instead of per server?
- What is load shedding, and when should a service reject work early?
- How does a circuit breaker stop a slow dependency from pulling you down?
- What does singleflight do, and how does it stop a cache stampede?
- How do you pick a timeout for each call in a fan-out?
- Why can an unbounded queue hide a slow consumer until memory runs out?
- How do you test that a limit really holds under load?
- Scenario: when a partner API allows only 50 calls per second, how would you design the client?
- Scenario: when a cache expires and a thousand requests hit the database at once, which pattern would you use?
Errors and Cancellation in Patterns
Before you answer, study Go context for beginners and Go error wrapping. These Go concurrency patterns questions check that your patterns fail cleanly instead of hanging.
- How does errgroup.Group collect the first error from many goroutines?
- What does errgroup.WithContext cancel, and when?
- Can you collect all errors instead of only the first one, and how?
- How do you return the first successful result and cancel the rest?
- How do you add a timeout to a whole fan-out at once?
- Why should each worker check ctx.Done between jobs?
- How do you pass errors through a pipeline, inside the value or on a separate channel?
- What happens to in-flight jobs when someone cancels the context?
- How do you retry a failed job without blocking the other workers?
- How do you shut down a pattern gracefully on SIGTERM?
- Why should you drain a results channel after cancelling?
- How do you log errors from many workers without flooding the logs?
- Scenario: when one of five parallel calls fails, how would you cancel the other four and return a clear error?
- Scenario: when a shutdown takes minutes because workers ignore cancellation, how would you fix them?
Go Concurrency Patterns Questions for Coding Rounds
Before you answer, write each program by hand and run it with -race. Interviewers watch who closes each channel and how the program ends.
- Build a worker pool with three workers that squares ten numbers.
- Write a generator that yields the first N Fibonacci numbers on a channel.
- Build a three stage pipeline that reads lines, filters blanks and counts words.
- Write a generic merge function that fans in any number of channels.
- Fan out URL checks to five workers and fan in the status codes.
- Limit parallel downloads to four with a semaphore channel.
- Call three mirrors and return the first answer, then cancel the others.
- Write a rate limited loop that sends at most ten requests per second.
- Run tasks with errgroup and stop on the first error.
- Batch incoming events into groups of 100 or every second, whichever comes first.
- Build a tiny pub-sub with subscribe and publish methods.
- Keep results in input order while using five workers.
- Scenario: when an interviewer asks you to crawl a site with at most ten requests at once, how would you design it?
- Scenario: when a log processor must handle bursts without dropping lines, how would you add backpressure?
Code Reading Questions
Read each program carefully and predict the output before you run it. Then explain the result in your own words.
package main
import "fmt"
func gen(nums ...int) <-chan int {
out := make(chan int)
go func() {
defer close(out)
for _, n := range nums {
out <- n
}
}()
return out
}
func square(in <-chan int) <-chan int {
out := make(chan int)
go func() {
defer close(out)
for n := range in {
out <- n * n
}
}()
return out
}
func main() {
for v := range square(square(gen(1, 2, 3))) {
fmt.Print(v, " ")
}
fmt.Println()
total := 0
for v := range square(gen(4, 5)) {
total += v
}
fmt.Println("total:", total)
}
- What does each line print, and why do the values keep their order?
- What would happen if square forgot to close its out channel?
The second program is a small worker pool with a closer goroutine.
package main
import (
"fmt"
"slices"
"sync"
)
type result struct {
job, value int
}
func main() {
jobs := make(chan int)
results := make(chan result)
var wg sync.WaitGroup
for w := 1; w <= 3; w++ {
wg.Add(1)
go func() {
defer wg.Done()
for j := range jobs {
results <- result{job: j, value: j * 10}
}
}()
}
go func() {
for j := 1; j <= 5; j++ {
jobs <- j
}
close(jobs)
}()
go func() {
wg.Wait()
close(results)
}()
var got []int
for r := range results {
got = append(got, r.value)
}
slices.Sort(got)
fmt.Println(got, len(got))
}
- What does the program print, and why does it need slices.Sort?
- Why does the WaitGroup wait inside its own goroutine instead of in main?
Quick Revision Table for Concurrency Patterns
Use the table below as a final check before your interview. It maps each pattern to the problem it solves.
| Pattern | Solves | Main tool |
|---|---|---|
| Worker pool | Too many goroutines | Job channel and WaitGroup |
| Pipeline | Work in clear steps | One channel per stage |
| Fan-out, fan-in | One slow stage | Many workers and a merge |
| Semaphore | Too many calls at once | Buffered channel |
| Rate limiter | Too many calls per second | Token bucket |
| errgroup | Errors from many goroutines | Group with context |
Also, many interviewers ask you to compare worker pools and pipelines directly. The diagram below shows the difference side by side.

Official Resources
These official pages explain the rules behind these questions.
- Go blog: Pipelines and cancellation
- Go talk: Go Concurrency Patterns
- Package errgroup documentation
- Go wiki: Rate Limiting
Quick Recap
- These Go concurrency patterns questions cover basics, worker pools, pipelines, limits, errors and coding tasks.
- A worker pool caps the number of goroutines and shares one job channel.
- A pipeline links stages with channels, and fan-in merges many channels into one.
- Semaphores limit how many calls run at once, while rate limiters limit calls per second.
- Use errgroup with a context, so one failure stops the rest.
- Every goroutine in a pattern needs a clear owner and a clear way to exit.
What’s Next?
By now, you have Go concurrency patterns questions for every common pattern. Study the answers in your own notes, then check them against the Go interview topics study guide.


