Loading…
40+ curated questions with the same answer shape every time: quick recap, deep dive, pitfalls, and follow-ups. Coverage includes goroutine vs thread scenario, channel direction scenario, interface vs struct scenario, pointer vs value scenario, and more.
Suggested path
Topics follow a teaching order. Each answer ends with a clear Next question control so you can move forward without hunting the list.
Common Go interview scenarios for freshers are the practical 'what does this code do?' and 'spot the bug' questions that differentiate candidates who have written real Go from those who have only read about it. This module covers seven scenario categories: goroutine vs thread (when to use a goroutine, the classic 'print numbers 1 to 10 concurrently' problem and why it requires sync), channel direction (what does chan<- T mean in a function signature and why you'd use it), interface vs concrete type (when a function should accept an io.Writer vs a *os.File), pointer vs value receiver (the method set gotcha with pointer receivers and interface satisfaction), the nil map panic (writing to a nil map panics; reading returns zero — how to prevent both), defer ordering (LIFO execution, the argument evaluation timing that catches everyone), and error handling scenarios (when to return nil, when to wrap, when to use a sentinel). Every scenario is a runnable Go program the interviewer will put in front of you.
Full catalog
Topics are ordered for learning. Within each topic, rows are numbered 1–40 globally so you always know where you are. Collapse topics if you want a lighter view — use Expand all when you need the full list again.
Numbers 1–40 follow the order we recommend — click any row to open the full answer, or use the sticky Next link at the bottom of each page to go Q1 → Q40.