Made with Palestinian hands Support EmuPath ☕

No results found.

Try another search or remove some filters.

All practice exams
Programming / FOUR DIFFICULTY LEVELS

Go Programming

Practice Go types, slices, interfaces, error handling and concurrent program design with explained scenarios.

Four self-study difficulty levels, from basic concepts to advanced scenarios. Difficulty is an editorial guide, not an official certification ranking. Core Go language and standard-library concepts. Concurrency examples require explicit synchronization, not timing assumptions.

YOUR PRACTICE SPACE

Learn it. Test it. Understand it.

Choose your difficulty

Recognize core concepts and trace a single step.

10 questions in Easy · one answer per question · no timer

Choose a mode

Free, no account needed. Answers stay in this tab and reset on reload. This is self-study, not a proctored exam or certificate.

Choose the right challenge

Easy checks core concepts. Medium applies them to tasks. Hard examines edge cases and failure modes. Very advanced combines constraints such as concurrency, security and recovery. Start where you are comfortable; each level has its own attempt and result. These labels are editorial, not certification grades.

What you will learn

  • Understand values, backing arrays and interface behavior.
  • Handle errors and resource lifetimes explicitly.
  • Reason about goroutines, cancellation and synchronization.

Think through a real scenario

Two goroutines update the same map while a handler reads it. A successful test run does not establish correctness: unsynchronized concurrent access can race. Identify shared state, use a suitable lock or ownership design, and test exercised paths with the race detector. Also define how workers exit when the request is canceled.

Turn your result into a study plan

For each missed question, write down the rule you overlooked and test it with a small example. Avoid memorizing an option’s position: understanding the behavior matters more than recognizing the wording. In exam mode explanations stay hidden until you submit; in practice mode use “Check answer” to see feedback immediately.

Read further

The questions and explanations are original EmuPath teaching material. These references provide background for further study; their publishers do not endorse this exam.

Found an ambiguous question? Include the track and question text in your correction report.

Sample Go Programming questions with explanations

Preview one question from each difficulty level before choosing a practice session. These examples also appear in the question bank. Try answering first, then open the explanation to check your reasoning.

Easy: Declarations

Inside a Go function, what does x := 3 normally do?

  1. Declares and initializes x using type inference
  2. Creates a package named x
  3. Declares an immutable constant
  4. Starts a goroutine
Show answer and explanation

Declares and initializes x using type inference

The short declaration introduces a variable in function scope. It infers a type from the expression; it does not make the variable a constant.

Medium: Append

Why should code usually assign the slice returned by append?

  1. Append may return a slice with a different backing array
  2. Append always edits the original variable’s length
  3. Append returns only an error
  4. Append sorts the slice automatically
Show answer and explanation

Append may return a slice with a different backing array

Append returns the resulting slice header. Allocation can change its backing storage, so ignoring that return value loses the updated length and possibly the new array.

Hard: Typed nil

An interface holds a nil *Widget value. Must that interface compare equal to nil?

  1. No, its dynamic type can make the interface non-nil
  2. Yes, all pointer values erase their type
  3. Yes, unless Widget has methods
  4. Only when printed with fmt
Show answer and explanation

No, its dynamic type can make the interface non-nil

An interface is nil when it has neither a dynamic type nor a dynamic value. A typed nil stored in an interface retains a dynamic type and can surprise error checks.

Very advanced: Publication

A goroutine writes shared data and another reads it after time.Sleep. Is the sleep sufficient synchronization?

  1. No; use a synchronization relationship such as a channel or lock
  2. Yes, any positive sleep orders memory accesses
  3. Yes, if both run on the same machine
  4. Only the longer sleep determines correctness
Show answer and explanation

No; use a synchronization relationship such as a channel or lock

Elapsed time does not establish the required ordering between concurrent accesses. Design a synchronization relationship that both communicates readiness and makes the writes observable.