These Go channels interview questions cover unbuffered and buffered channels, close, range, the ok flag, select, nil channels and deadlocks. We gathered them from public interview lists, coding rounds and community threads. Then we rewrote them in plain words and grouped them by idea.
This post is questions only, so answer each one in your own words first. When you need help, read Go channels explained with examples and Go select statement. Also, finish Part 14 on goroutines first, because every channel needs goroutines on both ends.
How to Use These Go Channels Interview Questions
Answer each of these Go channels interview questions out loud, then write a tiny program to prove your answer. Channel bugs often end in a deadlock or a panic, so run every example. Finally, try the scenario questions, since they come from real production code.
The table below lists each section and its number of questions.
| Section | What it tests | Questions |
|---|---|---|
| Channel basics | make, send and receive | 15 |
| Buffered channels | Capacity, len and bursts | 14 |
| Close and range | The ok flag and closing panics | 15 |
| The select statement | default, timeouts and fairness | 15 |
| Deadlocks and nil channels | Blocking, nil and directions | 15 |
| Channel coding tasks | Classic interview programs | 14 |

Go Channels Interview Questions on the Basics
Before you answer, study Go channels explained with examples. These Go channels interview questions check the core rules of sending and receiving.
- What is a channel in Go, and what problem does it solve?
- How do you create a channel, and what is its zero value?
- What does the arrow mean in ch <- v and in v := <-ch?
- When does a send on an unbuffered channel block?
- When does a receive block, and what wakes it up?
- Can many goroutines send on the same channel safely?
- What does the Go proverb about sharing memory by communicating mean?
- Which types can a channel carry, for example a struct or another channel?
- Why is a chan struct{} a common choice for signals?
- How do you pass a channel to a function, and does Go copy it?
- What are send-only and receive-only channel types?
- Why do function signatures often use directional channels?
- Can you compare two channels with ==, and when are they equal?
- Scenario: when a function must return results as they are ready, how would you design it with a channel?
- Scenario: when a goroutine must tell main that setup has finished, what kind of channel would you use?
Go Channels Interview Questions on Buffers
Before you answer, study Go worker pool pattern. Buffer size is a design choice, so these Go channels interview questions test your reasons, not only the syntax.
- What is a buffered channel, and how do you create one?
- When does a send on a buffered channel block?
- What do len and cap return for a channel?
- Why is checking len before a send not a safe way to avoid blocking?
- How do you choose a buffer size, and why is one a special case?
- When can a large buffer hide a real problem?
- How does a buffered channel work as a semaphore?
- Does a buffered channel keep the order of values?
- What is the difference in guarantees between buffered and unbuffered sends?
- Why can a buffered channel of size one prevent a goroutine leak?
- How does a buffered channel help with a fixed pool of tokens?
- Can you resize a channel after you create it?
- Scenario: when a producer is fast and a consumer is slow, what happens with a buffer of 1000?
- Scenario: when a team adds a buffer to fix a deadlock, how would you check if the fix is real?
Go Channels Interview Questions on Close and Range
Before you answer, study Go pipeline pattern. Closing rules cause many panics, so these Go channels interview questions come up in most concurrency rounds.
- What does close do to a channel?
- What does a receive from a closed channel return?
- How does the v, ok := <-ch form tell you that the sender closed the channel?
- What happens when you send on a closed channel?
- What happens when you close a channel twice, or close a nil channel?
- Who should close a channel, the sender or the receiver, and why?
- How does for range over a channel know when to stop?
- Do you always need to close a channel, for example before it gets garbage collected?
- How do you close a channel safely when many goroutines send on it?
- How does sync.Once help you close a channel only once?
- Why does closing a channel act as a broadcast to all receivers?
- Can you check if a channel is closed without receiving from it?
- How do you drain a channel before you shut down?
- Scenario: when a worker pool panics with send on closed channel during shutdown, how would you fix the order?
- Scenario: when a for range loop never ends, what would you check about the sender?
Go Channels Interview Questions on select
Before you answer, study Go select statement. The select statement joins channels with timeouts and cancellation, so it fills many Go channels interview questions.
- What does a select statement do?
- How does select choose when two cases are ready at the same time?
- What does a default case change in a select?
- How do you write a non-blocking send or receive?
- How do you add a timeout with time.After?
- Why should a long loop use a single timer instead of time.After on every pass?
- How do you stop a loop with a done channel inside select?
- How does ctx.Done work in a select case?
- What does an empty select{} do?
- Can you give one case priority over another, and how?
- What happens in a select when every channel is nil?
- How does a ticker work with select in a polling loop?
- Why can a busy loop with select and default burn CPU?
- Scenario: when a service must stop reading from a queue as soon as shutdown starts, how would you write the select?
- Scenario: when a call must give up after two seconds, how would you combine select with context?
Deadlocks, nil Channels and Directions
Before you answer, study Go rate limiting for a real channel design. These Go channels interview questions check how you avoid programs that stop forever.
- What does the error all goroutines are asleep mean?
- Why does a send on an unbuffered channel in main with no receiver deadlock?
- Can the runtime detect every deadlock, for example one inside a server?
- What does a nil channel do on send and on receive?
- How can setting a channel to nil turn off a case in select?
- What is a partial deadlock, and why is it hard to find?
- How do lock order and channel order both cause deadlocks?
- When should you use a mutex instead of a channel?
- How do you convert a bidirectional channel to a receive-only one?
- Can you close a receive-only channel, and what does the compiler say?
- How do you find a stuck goroutine with a goroutine dump?
- What does SIGQUIT print for a running Go program?
- How do channels help with backpressure in a pipeline?
- Scenario: when a program hangs with no error, how would you find which channel it waits on?
- Scenario: when merging two channels, one closes early, how would you keep reading from the other?
Go Channels Interview Questions for Coding Rounds
Before you answer, write each program by hand and run it with -race. Interviewers watch who closes the channel and how the program ends, not only the output.
- Print numbers 1 to 10 with two goroutines that take turns.
- Write a ping-pong program with two goroutines and one channel.
- Build a generator function that returns a receive-only channel.
- Merge two channels into one, and close it when both are done.
- Build a three stage pipeline that squares and then sums numbers.
- Write a fan-out, fan-in program with three workers.
- Limit concurrency with a buffered channel as a semaphore.
- Write a function that returns the first result from three mirrors.
- Write a timeout wrapper around a slow function with select.
- Build a simple pub-sub with one publisher and many subscribers.
- Implement a ticker that prints every 100 ms and stops after one second.
- Write a bounded queue with a buffered channel and non-blocking sends.
- Scenario: when an interviewer asks for a rate limiter of five requests per second, how would you build it with a ticker?
- Scenario: when a pipeline stage fails, how would you stop all stages without leaks?
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 main() {
ch := make(chan int, 3)
ch <- 1
ch <- 2
fmt.Println(len(ch), cap(ch))
close(ch)
for v := range ch {
fmt.Print(v, " ")
}
fmt.Println()
v, ok := <-ch
fmt.Println(v, ok)
defer func() {
fmt.Println("recovered:", recover())
}()
ch <- 3
}
- What do the first three print lines show, and why does range still read values after close?
- What message does the deferred function print, and why does the last send panic?
The second program uses nil channels to switch off cases and a timeout case.
package main
import (
"fmt"
"time"
)
func main() {
a := make(chan string)
b := make(chan string)
go func() { a <- "from a"; close(a) }()
go func() { b <- "from b"; close(b) }()
got := 0
for a != nil || b != nil {
select {
case v, ok := <-a:
if !ok {
a = nil
continue
}
fmt.Println(v)
got++
case v, ok := <-b:
if !ok {
b = nil
continue
}
fmt.Println(v)
got++
}
}
fmt.Println("messages:", got)
idle := make(chan int)
select {
case n := <-idle:
fmt.Println(n)
case <-time.After(20 * time.Millisecond):
fmt.Println("timeout")
}
}
- Why can the first two lines appear in any order, and how does setting a channel to nil end the loop?
- What does the last select print, and why does it not block forever?
Quick Revision Table for Channel Rules
Use the table below as a final check before your interview. It lists what each operation does on each kind of channel.
| Operation | Nil channel | Closed channel |
|---|---|---|
| Send | Blocks forever | Panics |
| Receive | Blocks forever | Zero value, ok is false |
| Close | Panics | Panics |
| len and cap | Both zero | Values left and capacity |
| range | Blocks forever | Reads the rest, then stops |
Also, many interviewers ask you to compare unbuffered and buffered channels directly. The diagram below shows the difference side by side.

Official Resources
These official pages explain the rules behind these questions.
- Go specification: Channel types
- Go specification: Select statements
- A Tour of Go: Channels
- Go blog: Go Concurrency Patterns, Pipelines and cancellation
Quick Recap
- These Go channels interview questions cover basics, buffers, close and range, select, deadlocks and coding tasks.
- An unbuffered send waits for a receiver, while a buffered send waits only when full.
- Only the sender closes a channel, and a send on a closed channel panics.
- A receive from a closed channel returns the zero value with ok set to false.
- Use select with ctx.Done or a timer, so a goroutine never waits forever.
- A nil channel blocks forever, which is handy for turning off a select case.
What’s Next?
By now, you have Go channels interview questions for every part of channels and select. Study the answers in your own notes, then check them against the Go interview topics study guide.


