Golang Quizzes
Test your Golang skills with our quiz questions. Practice writing code for goroutines, channels, and building web services. These quizzes help your understanding of Go basics and will prepare you for creating fast, scalable applications.
About Golang Quiz
Each Golang quiz consists of multiple questions, each with three to four possible answers. Only one answer is correct for each question. Select the answer you believe is correct, then click the "Check My Answers" button to see your results.
If you answer at least 75% of the questions correctly, you pass the quiz! This indicates you have a solid understanding of Golang concepts and are ready to advance to more challenging topics.
After submitting your quiz, you'll receive immediate feedback with detailed explanations for each question. This helps you understand not just what the correct answer is, but why it's correct—reinforcing your learning and helping you master Golang.
Quick Tips
- Read each question carefully before selecting your answer
- Review the code examples when provided
- You can retake quizzes as many times as you want
- Sign in to save your progress and track your performance
Available Quizzes
Basics & Syntax
40 in-depth questions covering Go's fundamentals, packages, imports, syntax rules, variables, constants, comments, and formatting — with 10 code examples to solidify understanding.
Data Types & Zero Values
40 comprehensive questions on Go's built-in types, zero values, type inference, conversions vs casting, and aliased types — with 20 code examples to master type safety and initialization.
Operators & Expressions
40 comprehensive questions on Go's operators and expressions, covering arithmetic, comparison, logical, and bitwise operations — with 12 code examples exploring operator precedence, short-circuit evaluation, and practical usage patterns.
Control Flow
40 comprehensive questions on Golang's control flow statements, covering if-else, switch expressions, for loops, break/continue, and labeled statements — with 20 code examples demonstrating practical usage patterns and edge cases.
Functions
35 comprehensive questions on Golang functions, covering declarations, multiple returns, named returns, variadic functions, and pass-by-value semantics — with 18 code examples exploring function design patterns and parameter passing.
Pointers
50 comprehensive questions on Golang pointers, covering pointer basics, types, nil pointers, receiver semantics, and common pitfalls — with 15 code examples demonstrating pointer operations and memory management.
Structs
40 comprehensive questions on Golang structs, covering struct creation, methods, embedded structs, anonymous structs, and value vs reference behavior — with 20 code examples demonstrating struct operations and composition.
Interfaces
35 comprehensive questions on Golang interfaces, covering interface basics, implicit implementation, empty interface, type assertions, and type switches — with 18 code examples demonstrating interface usage and polymorphism.
Methods & Receivers
35 comprehensive questions on Golang methods and receivers, covering value vs pointer receivers, method sets, interface satisfaction, and practical usage patterns — with 18 code examples demonstrating method behavior and common scenarios.
Arrays & Slices
40 comprehensive questions on Golang arrays and slices, covering fixed-size arrays, slice creation, capacity & length, internals, and copying operations — with 18 code examples demonstrating array and slice behavior.
Maps
35 comprehensive questions on Golang maps, covering map creation, key existence checking, entry deletion, iteration order, and reference behavior — with 18 code examples demonstrating map operations and common patterns.
Strings & Runes
35 comprehensive questions on Golang strings and runes, covering UTF-8 basics, rune vs byte differences, string immutability, manipulation techniques, and conversion operations — with 18 code examples demonstrating string handling patterns.
Error Handling
40 comprehensive questions on Golang error handling, covering error values, custom error types, fmt.Errorf with wrapping, sentinel vs typed errors, and errors.Is & errors.As — with 18 code examples demonstrating error handling patterns.
Packages & Modules
35 comprehensive questions on Golang packages and modules, covering package creation, exported vs unexported identifiers, Go modules usage, dependency management, and versioning rules — with 18 code examples demonstrating package organization and module management.
Concurrency Goroutines
40 comprehensive questions on Golang goroutines, covering goroutine creation, spawning, stack management, leaks, and best practices — with 18 code examples demonstrating concurrent programming patterns and common pitfalls.
Concurrency Channels
35 comprehensive questions on Golang channels, covering unbuffered and buffered channels, directions, closing, and patterns — with 18 code examples demonstrating channel usage in concurrent programming.
Select Statement
35 comprehensive questions on Golang's select statement, covering multiplexing channels, timeouts, non-blocking operations, fan-in/fan-out patterns, and handling closed channels — with 18 code examples demonstrating advanced channel operations.
Synchronization Tools
35 comprehensive questions on Golang's synchronization tools, covering sync.Mutex, sync.RWMutex, sync.WaitGroup, sync.Once, and common race-condition mistakes — with 18 code examples demonstrating thread-safe patterns.
Context Package
35 comprehensive questions on Golang's context package, covering context.Background() & TODO(), context cancellation, deadlines & timeouts, passing values, and best practices — with 18 code examples demonstrating proper context usage.
Memory Model
45 comprehensive questions on Golang's memory model, covering stack vs heap allocation, escape analysis, allocation patterns, garbage collection basics, and avoiding unnecessary allocations — with 25 code examples demonstrating memory management techniques.
Testing & Unit Test
40 comprehensive questions on Golang's testing framework, covering the testing package, writing unit tests, table-driven tests, benchmarks with go test -bench, and test coverage tools — with 20 code examples demonstrating testing best practices.
File I/O & OS Interactions
35 comprehensive questions on Golang's file I/O and OS interaction capabilities, covering file reading/writing, os package usage, streams & buffers, directory operations, and environment variables — with 18 code examples demonstrating practical file and OS operations.
Networking & HTTP
40 comprehensive questions on Golang's networking and HTTP capabilities, covering basic HTTP servers, HTTP clients, request/response lifecycle, JSON marshalling/unmarshalling, and REST API patterns — with 20 code examples demonstrating practical networking operations.
Goroutine-Safe Patterns
35 comprehensive questions on Golang's goroutine-safe patterns, covering worker pools, producer/consumer patterns, pipeline design, avoiding shared state, and concurrency design pitfalls — with 15 code examples demonstrating safe concurrent programming practices.
Reflection
35 comprehensive questions on Golang's reflection capabilities, covering reflect.Type & reflect.Value usage, value modification, kind checking, performance considerations, and when to avoid reflection — with 15 code examples demonstrating practical reflection techniques.
Generics
35 comprehensive questions on Go's generics system introduced in Go 1.18, covering type parameters, generic functions, generic types, type constraints, and their benefits and limitations — with 15 code examples demonstrating practical generic programming patterns.
Build & Run Tooling
35 comprehensive questions on Go's build and run tooling, covering go build, go run, go test, cross-compiling, and build tags — with 15 code examples demonstrating practical build configurations and testing scenarios.
Modules & Dependency Tools
Test your knowledge of Golang modules and dependency management tools. This quiz covers go mod tidy, go mod vendor, reproducible builds, semantic import versioning, and private modules.
Best Practices & Idioms
Test your knowledge of Golang best practices and idiomatic patterns. This quiz covers idiomatic naming, error-first return style, avoiding global state, composition over inheritance, and profiling & performance tuning.
