DEV Community

Cover image for 25 interview questions for Go Developer position
Henryk Konsek
Henryk Konsek

Posted on • Updated on

25 interview questions for Go Developer position

This is a list of common questions that can be asked by technical interviewers for Go developer position. This is definitely not a complete list, just a subset I find pretty likely to occur during the interview.

Questions

The questions are grouped by the category. Again - the list of categories is far from being complete, however it is very likely that question from given category will be asked during the interview.

Modules

  • What are Go modules?
  • What was used before Go modules were introduced?
  • What is vendoring?

Interfaces

  • What is an interface in Go?
  • How many functions can be usually found in an average Go stdlib interface?
  • How to define a function argument that can be anything?

Pointers

  • How to indicate nil string as a return type?
  • How to modify arguments passed to a function?
  • When arguments passed to a function is stored the stack? When on the heap? What is a difference?

Slices

  • How to define a variadic function?
  • How to pass a slice into a variadic function?

Strings

  • How to get a substring?
  • How to split a string?
  • How to join a slice of strings?
  • How to check if a string starts with a substring?
  • How to check if a string ends with a substring?

Context

  • What is context? Why is it useful?
  • How to define a context timeout for function execution?
  • How to handle a context timeout within that function?

Concurrency

  • Improve the following library function:
    • func ExecuteShellCommand(cmd string) (output []string)
    • Allow function caller to asynchronously receive every line of stdout of executed shell command (in real time)
    • Notify function caller that command execution is over

IO

  • How to read local file as slice of bytes?
  • How to convert io.Reader into slice of bytes?

JSON support

  • What library and function would you use to parse JSON file?
  • What library and function would you use to parse JSON file that doesn't fit into RAM?
  • What JSON library would you recommend from the usability point of view? For example to support nested queries.

Summary

What do you think about the list above? What would you add or remove? What other questions do you find to be asked frequently during interviews? What questions to you like to ask when interviewing your candidates? Please leave the answer in the comments!

Top comments (0)