Go interviews focus on goroutines, channels, interfaces, and error handling — the language is small, so questions go deep rather than wide. Below are the most common ones with model answers. Junior: core theory, definitions, and simple practical cases.
1
What is the difference between an array and a slice?
Answer
An array has a fixed length that is part of its type — [3]int and [4]int are different types. A slice is a view over an array: a pointer, a length and a capacity. You will use slices for almost everything; arrays appear mainly as the backing store you never name.
2
What happens when you append to a slice past its capacity?
Answer
Go allocates a new, larger backing array, copies the elements across and returns a slice pointing at the new one. The old slice still points at the old array — which is why append returns a value you must assign. Ignoring the return is the classic beginner bug, and it works right up until the capacity is exceeded.
3
What is the zero value, and why does Go have one?
Answer
Every type has a usable zero: 0 for numbers, "" for strings, nil for pointers, maps and slices. It means a declared variable is always initialised, so there is no undefined state to read by accident. The practical consequence is that a struct with sensible zero values often needs no constructor at all.
4
What is the difference between a value receiver and a pointer receiver?
Answer
A value receiver gets a copy, so mutations do not survive the call; a pointer receiver operates on the original. Use a pointer when the method mutates, or when the struct is large enough that copying costs. Mixing the two on one type is where people get confused, because the method set of T and *T then differ.
5
How does error handling work, and why no exceptions?
Answer
Errors are ordinary values returned alongside the result and checked at the call site. It is verbose on purpose: the path where something fails is visible in the code rather than hidden in a stack unwind. panic exists for genuinely unrecoverable situations, and using it for control flow is a code smell every reviewer will flag.
6
What is a goroutine, and how is it different from a thread?
Answer
A goroutine is a function scheduled by the Go runtime rather than the operating system. It starts at a couple of kilobytes and grows, so hundreds of thousands are ordinary, where the same number of OS threads would not be. The runtime multiplexes them onto a small pool of real threads.
7
What does `defer` do, and when does it run?
Answer
It schedules a call for when the surrounding function returns, whichever way it returns. That makes it the right place for closing a file or unlocking a mutex, next to the line that opened or locked. Arguments are evaluated at the defer statement, not at execution — which surprises people who defer something using a loop variable.
🦎
Reading answers is not enough
In a real interview you speak under pressure. Cam asks these same questions, scores every answer, and shows exactly what to fix.
Practice a Junior Go Backend interview →Free · 3 interviews per month