Go Interview Questions 2026

Go is the language of modern backend infrastructure. Interviews focus on concurrency primitives, interface design, and the absence of classes in favor of composition.

Goroutines and the Go Scheduler

Goroutines are lightweight threads managed by the Go runtime, not the OS. The Go scheduler (M:N threading) multiplexes goroutines onto OS threads. Starting a goroutine is ~2KB stack vs ~1MB for an OS thread, enabling hundreds of thousands of concurrent goroutines.

Common question: how many goroutines can you run? Practical limit is memory. A goroutine starts at 2-8KB and grows as needed. At 4GB RAM with 4KB goroutines, that is roughly 1 million goroutines. The scheduler handles context switching cooperatively at function call points.

Channels and Select

Channels are typed communication pipes between goroutines. Unbuffered channels synchronize sender and receiver (both block until both are ready). Buffered channels allow the sender to proceed without blocking until the buffer is full.

select waits on multiple channel operations, executing the first ready case. A default case makes select non-blocking. Common pattern: select with a done channel for cancellation, derived from context.Context in production code.

Interfaces and Composition

Interfaces in Go are satisfied implicitly: any type implementing the interface methods satisfies the interface without declaring intent. This enables duck typing with compile-time type safety.

Interface best practice: define interfaces close to the consumer, not the implementer. The standard library's io.Reader and io.Writer are the canonical examples. A function accepting io.Reader works with files, network connections, and byte buffers without modification.

Error Handling

Go uses explicit error return values rather than exceptions. The convention: error is the last return value; nil means success. Wrap errors with context using fmt.Errorf("context: %w", err) and unwrap with errors.Is or errors.As.

Sentinel errors (var ErrNotFound = errors.New("not found")) enable callers to check specific error types. Custom error types (structs implementing Error() string) carry additional context. Avoid panicking for expected errors; panic only for programming bugs.

Browse Backend Engineering Questions

Real backend and infrastructure questions from companies using Go at scale.

Browse Google SWE Questions