Skip to content
PPreptima

Go interview questions

Go for infrastructure and high-throughput services, where concurrency idioms carry most of the interview weight.

8 published across 4 topics.

Go fundamentals60 short answers on one page, for revising rather than studying.

Go Language

2 questions

Slices and maps internals, interfaces and embedding, error handling conventions, and generics.

Goroutines & Channels

2 questions

The scheduler, channel semantics, select, context cancellation, and detecting goroutine leaks.

mediumConceptCodingScenario

How do goroutines leak, and how would you find a leak in a running service?

A goroutine leaks when it blocks forever on an operation nobody will complete: a send with no receiver, a receive on a channel nobody closes, or a worker abandoned after its consumer returned early. Fix it by giving every blocking operation a context escape hatch, and find it with pprof goroutine profiles.

5 minmid, senior, staff
mediumConceptCodingDesign

Several producers write to one channel and one consumer reads it. Who closes the channel?

The sender closes, never the receiver, and with several senders no individual one may close because a send on a closed channel panics. The answer is a WaitGroup over the producers with a separate goroutine closing once they have all finished, which is the only place the fact 'nobody will send again' actually exists.

4 minmid, senior

Go Memory & Performance

2 questions

Escape analysis, allocation reduction, GC behaviour, and pprof-driven profiling.

Building Services in Go

2 questions

Standard-library HTTP, project structure, dependency management, and testing patterns.