Skip to content
Preptima

Go interview questions and answers

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

8 published across 4 topics.

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 leak in Go happens when a goroutine blocks forever on a send, receive, network call or abandoned worker path. Find it with goroutine counts and pprof, then add cancellation to every blocking operation. Use this goroutines answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects channels to the point an interviewer is testing.

5 minmid, senior, staff
mediumConceptCodingDesign

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

In Go, the sender closes a channel when no more values will be sent; receivers do not close it just because they are done. Multiple senders need coordination so close happens exactly once after all sends finish. Use this channels answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects goroutines to the point an interviewer is testing.

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.