Go for placements: interview questions by topic
Go is the language behind much of today's cloud infrastructure, from Docker and Kubernetes to countless internal services, and product companies and startups that build backends increasingly ask for it. It is a small language, which makes its interviews precise: with few features to cover, the questions go deep into how each one behaves. What does a slice share with the array it came from? When does a method need a pointer receiver? What does a function see when you pass it a map? What blocks, and what deadlocks?
The answers are rarely about syntax. They come from a few design decisions: values are copied, errors are ordinary return values, interfaces are satisfied without being declared, and concurrency is built from goroutines and channels rather than threads and locks. Knowing those decisions lets you predict what unfamiliar Go code does, which is what an interviewer is really checking.
The pages below take one topic each, with answers whose code was built and run with Go 1.27, and one question exactly as the diagnostic asks it. The diagnostic draws from every Go topic in the bank and names the ones to read first.
On this page3 sections
Go topics, one page each
- Go data types interview questionsGo's types as interviews test them: the size of int, var versus :=, zero values, untyped constants, conversions, iota and shadowing.
- Go functions and defer interview questionsGo functions as interviewers ask about them: multiple and named results, defer order and arguments, closures, variadic calls, pass by value.
- Go slices interview questionsGo slices and arrays for interviews: arrays as values, the slice header, length and capacity, append growth, sharing, copying and removal.
- Go maps and strings interview questionsGo maps and strings for interviews: creating maps, checking keys, iteration order, concurrent access, immutable strings, bytes, runes, builders.
- Go structs and methods interview questionsGo structs as interviews test them: literals and pointers, value versus pointer receivers, constructors, embedding, struct tags, comparison.
- Go interfaces interview questionsGo interfaces for interviews: implicit implementation, any, type switches and type assertions, compile-time checks, generics and method sets.
- Go error handling interview questionsGo error handling explained: error values, custom error types, wrapping with %w, errors.Is and errors.As, errors.Join, panic and recover.
- Go goroutines and channels interview questionsGoroutines and channels as Go interviews ask them: goroutines versus threads, buffered channels, close and range, select, races and deadlocks.
One question, exactly as the diagnostic asks it
From the Go bank — 48 questions across 8 topics. The answer is marked because this one is public; in a sitting you choose first, then see why each option is right or wrong.
What happens when this Go code runs?
ch := make(chan int)
ch <- 1
fmt.Println(<-ch)- 1correct
It crashes: fatal error: all goroutines are asleep - deadlock!
- 2
It prints 1
- 3
It prints 0
- 4
It does not compile: nothing receives from ch
An unbuffered channel has no storage: a send completes only when another goroutine is ready to receive at the same moment. Here main is the only goroutine, and it blocks on ch <- 1 before it ever reaches the receive on the next line. With every goroutine blocked, the Go runtime detects that nothing can make progress and stops the program with fatal error: all goroutines are asleep - deadlock!. It would print 1 with a buffered channel, make(chan int, 1), or with the send moved into its own goroutine. The compiler does not analyse channel usage, so it compiles.
Measure it
Reading the answers tells you what’s true. A diagnostic tells you what you get wrong.
10 Go questions across its topics, easy to hard, about fifteen minutes. You get a readiness figure with the arithmetic shown, the topics you missed named, and a practice set sized for today. Free: a diagnostic in every subject, a retake a week and 15 problems a day. No card.