Lesson 27 / 27

Exam and interview questions

Explain Exam and interview questions, test a small program, and use the result to build confidence.

The essential idea

Exam and interview questions becomes clear when you identify its job before memorising syntax. In Go, small explicit pieces combine into programs that are easy to read, build, and change.

Run a tiny experiment

Keep the path from source file to compiled program in mind as you learn this part.

// Explore interview with one small program.
value := 0
fmt.Println(value)

Output:

0

A useful habit

Do not copy a solution blindly. For Exam and interview questions, change one value, run go test or go run, and explain why the result changed.

Quick check

Quick check: How should you learn Exam and interview questions?

  • Run one focused example and inspect the result.
  • Memorize it without writing code.
  • Skip compiler and test feedback.
Answer

Run one focused example and inspect the result. — Small experiments reveal cause and effect.