Go (Golang) Programming Basics

By Devin Park · Updated May 25, 2026

Questions19
Passing Score70%
Format68% Multiple Choice
Sessions Logged1,714
Your progressLog in / Register to track times taken, best score, questions mastered, and coverage on this quiz.
Rating
Community rating 4.5 out of 5 from 21 ratings.
4.5 (21)

Topics covered

This quiz

Uncategorized19 (100%)

Uncategorized19 questions

Question catalog for this preview

Catalog listing of the 5 preview questions for this quiz.

Question 1

Go uses garbage collection for memory management, so developers do not need to manually free memory allocated with `new()` or `make()`.

Answer choices

  • A. True

  • B. False

Question 2

Which Go concurrency mechanism should be used when a function needs to wait for multiple goroutines to complete before proceeding?

Answer choices

  • A. A single channel with a done flag

  • B. `sync.WaitGroup` — Add(n) before goroutines, Done() in each goroutine, Wait() to block

  • C. `time.Sleep()` with an estimated duration

  • D. `runtime.GOMAXPROCS(1)` to force single-threaded execution

Question 3

What is the zero value for each Go type, and why is it important?

Answer choices

  • A. All Go types have a zero value of 0; other types must be explicitly initialized

  • B. Go has no zero values — all variables must be explicitly initialized or a compile error occurs

  • C. Every Go type has a meaningful zero value: 0 for numeric types, false for bool, "" for string, nil for pointers/slices/maps/channels/interfaces

  • D. Zero values are only for primitive types; structs and slices have no zero value

Question 4

What is the Go `context` package primarily used for in network applications?

Answer choices

  • A. Storing and retrieving values from environment variables

  • B. Propagating cancellation signals, deadlines, and request-scoped values across API boundaries and goroutines

  • C. Managing database connection pooling

  • D. Logging structured JSON output in microservices

Question 5

What is a goroutine in Go?

Answer choices

  • A. A type of error handling mechanism

  • B. A lightweight thread managed by the Go runtime, started with the `go` keyword

  • C. A Go package for HTTP routing

  • D. A method for iterating over slices and maps