Backend Go — техническое интервью
60 минут, middle → senior. Go 1.21+, goroutines, channels, interfaces, HTTP-сервисы.
- Questions
- 14
- Live coding
- 2
Разогрев: опыт и контекст
Опыт с Go
Сколько пишете на Go? Какие проекты — микросервисы, CLI, high-load?
Scoring rubric (0–10)
3–5: «Год-два Go» без контекста нагрузки. 6–8: Конкретные сервисы; stdlib vs gin/echo; версия Go в проде. 9–10: Миграции модулей; performance tuning; когда Go не лучший выбор — честно. Красный флаг: «Go как Python, только быстрее» без понимания модели concurrency.
Interviewer notes
2–3 минуты.
Язык и concurrency
Goroutines
Чем goroutine отличается от OS thread? Сколько goroutines «можно» и что их останавливает?
Scoring rubric (0–10)
3–5: «Легковесные потоки» без scheduler. 6–8: M:N scheduling; stack growth; goroutine завершится когда функция return. 9–10: GOMAXPROCS; leak через blocked channel; pprof goroutine dump. Красный флаг: «можно миллионы без последствий» без mention blocked goroutines.
Interviewer notes
4 минуты.
Channels
Buffered vs unbuffered channel. Когда select и что будет при send в закрытый channel?
Scoring rubric (0–10)
3–5: «Channels для общения goroutines». 6–8: Unbuffered sync handshake; buffer decouples; close — broadcast done; panic on send to closed. 9–10: context cancellation; fan-in/fan-out; nil channel blocks forever in select. Красный флаг: close channel со стороны receiver без понимания.
Interviewer notes
Follow-up: worker pool pattern. 5 мин.
Interfaces
Как работают interfaces в Go? Что значит «implicit satisfaction»?
Scoring rubric (0–10)
3–5: «Как Java interface». 6–8: Structural typing; empty interface{} / any; compile-time check via var _ Interface = (*T)(nil). 9–10: Small interfaces (io.Reader); accepting interfaces returning structs; nil interface gotcha. Красный флаг: giant interface with 20 methods.Interviewer notes
4 минуты.
Ошибки
Как обрабатываете ошибки в Go? Зачем errors.Is / errors.As и fmt.Errorf %w?
Scoring rubric (0–10)
3–5: «return err» everywhere без wrap. 6–8: Wrapping with context; Is/As for sentinel errors; don't panic in libraries. 9–10: Custom error types; multierror; logging vs returning. Красный флаг: panic для expected validation errors in HTTP handler.
Interviewer notes
4 минуты.
Память и GC
Как уменьшить аллокации в hot path? Что такое escape analysis на бытовом уровне?
Scoring rubric (0–10)
3–5: «Go быстрый, не думаем о памяти». 6–8: sync.Pool; preallocate slices; avoid unnecessary string concat in loop. 9–10: go test -bench; pointer vs value receiver trade-offs; GC pacing basics. Красный флаг: premature micro-opts без профилирования.
Interviewer notes
5 минут.
Практика: живой код
Two Sum
Дан слайс nums и target. Верните индексы двух чисел с суммой target (ровно одно решение).
Scoring rubric (0–10)
3–5: O(n²) nested loops. 6–8: map[value]index O(n); объясняет ключи. 9–10: Edge cases; preallocate map capacity; tests table-driven. Красный флаг: модифицирует входной slice без необходимости.
Interviewer notes
15 минут.
Worker pool
Реализуйте RunJobs(jobs <-chan func(), workers int), которая запускает workers goroutines и обрабатывает jobs до закрытия канала.
Scoring rubric (0–10)
3–5: Одна goroutine на job без лимита. 6–8: Fixed worker count; range jobs; wg.Wait after close. 9–10: context cancel; panic recovery in worker; backpressure discussion. Красный флаг: busy spin или leak — wg не Wait.
Interviewer notes
15 минут.
HTTP и тестирование
context.Context
Зачем context в HTTP handlers? Как пробросить deadline в downstream вызов?
Scoring rubric (0–10)
3–5: «Для отмены» без примера. 6–8: ctx from request; WithTimeout; cancel on client disconnect. 9–10: Context values anti-patterns; propagation through grpc/http client. Красный флаг: context.Background() в каждом internal call.
Interviewer notes
4 минуты.
Тесты в Go
Как тестируете HTTP handler? Чем table-driven tests удобны?
Scoring rubric (0–10)
3–5: «testing package и assert». 6–8: httptest.ResponseRecorder; table cases; t.Parallel cautions. 9–10: Integration with testcontainers; golden files; fuzzing intro. Красный флаг: тесты зависят от порядка запуска и shared global state.
Interviewer notes
4 минуты.
Инженерная культура и вопросы
Run an interview with this template
Sign up free: copy the template to your org, schedule an interview, and run it in a room with live coding.
Get started in FlashTalk