Go (Golang) MCQ
Test your Go (Golang) knowledge with 100 multiple choice questions covering fundamentals to advanced concepts, with instant feedback and explanations.
Which company created the Go programming language?
2What is the file extension for Go source files?
3How do you declare a variable with type inference in Go?
4What is the zero value of an int in Go?
5What is a goroutine?
6What is a channel in Go?
7What does the defer keyword do?
8What is a slice in Go?
9What is a map in Go?
10What is an interface in Go?
11What is the blank identifier _ used for?
12What does Go's multiple return values feature allow?
13How do you handle errors in Go idiomatically?
14What is the empty interface interface{} (or any) in Go?
15What is a struct in Go?
16How do you add a method to a struct?
17What is a pointer receiver vs value receiver?
18What does make() do in Go?
19What does new() do in Go?
20What is package main in Go?
21What is the purpose of go.mod?
22What is the select statement used for?
23What is panic in Go?
24What does recover() do?
25What is embedding in Go?
26What is the range keyword used for?
27What is a variadic function in Go?
28What does the init() function do?
29What is a type assertion in Go?
30What is a type switch?
31What are exported identifiers in Go?
32What is a constant in Go?
33What does iota do in a const block?
34What is the for range idiom for channels?
35How do you check if a key exists in a map?
36What is composition over inheritance in Go?
37What does append() return?
38What is the purpose of sync.WaitGroup?
39What is a rune in Go?
40What does context.Context provide?
What is the Go scheduler?
2What is the difference between buffered and unbuffered channels?
3What is the errors.Is() function?
4What is a sync.Mutex used for?
5What is a sync.RWMutex?
6What is an error wrapping in Go 1.13+?
7What is sync.Once used for?
8What is a sync.Pool?
9What is the Go garbage collector's concurrency model?
10What is the difference between a nil slice and an empty slice?
11What does GOMAXPROCS control?
12What is a closure in Go?
13What is the difference between copy() and assignment for slices?
14What is a goroutine leak?
15What is the go vet tool?
16What is the context package's cancellation propagation?
17What is escape analysis in Go?
18What is atomic operations used for in Go?
19What is a goroutine's stack behavior in Go?
20What is the error interface in Go?
21What is a sentinel error in Go?
22What is the context.WithTimeout vs context.WithDeadline difference?
23What does go build -race do?
24What is a Go module proxy?
25What is the difference between value and pointer method sets for interface satisfaction?
26What does go generate do?
27What is a build tag/constraint in Go?
28What is the purpose of the io.Reader and io.Writer interfaces?
29What is a functional option pattern in Go?
30What is the go vet tool specifically checking for with printf verbs?
31What is the difference between make(chan T) and make(chan T, 1)?
32What is table-driven testing in Go?
33What does http.Handler vs http.HandlerFunc distinguish?
34What is the time.Ticker vs time.Timer difference?
35What is the net/http server's concurrency model?
36What is the stringer tool and its use in Go?
37What is golang.org/x/sync/errgroup?
38What is the difference between new(T) and &T{}?
39What is the Go workspace mode (go.work)?
40What is the difference between panic and log.Fatal in Go?
What is the Go data race detector and how do you enable it?
2What is the Go memory model's guarantee about goroutine communication?
3What is pprof and when would you use it?
4What is generics in Go 1.18 and what are type constraints?
5What is GC shape stenciling in Go generics?
6What is the difference between sync.Map and a regular map with a mutex?
7What is the unsafe package used for in Go?
8What is the Go linker's link-time optimization (LTO) and dead code elimination?
9What is the reflect package used for in Go?
10What is cgo and what are its performance implications?
11What is Go's internal package mechanism?
12What is the Go ABI and how did it change in Go 1.17?
13What is Go's sync.Map vs a map with RWMutex for read-heavy workloads?
14What is the Go compiler's inlining budget?
15What is the difference between go test -count=1 and running tests without it?
16What is the Go linker's dead code elimination vs tree shaking?
17What is fuzz testing in Go 1.18+?
18What is the Go compiler's escape analysis output and how do you inspect it?
19What is the impact of interfaces on Go performance (interface boxing)?
20What is Go's profiling tool chain for CPU and memory?