typeover
curriculum

Curriculum Concurrency Sync primitives exercise 1 · mcq

Sync primitives

sync.Mutex is Go's classic mutual-exclusion primitive. Pick the line that creates a usable mutex declared as variable mu. TypeScript: no built-in mutex (JS is single-threaded). Libraries like async-mutex provide it. Go's stdlib bakes it in.

TypeScript reference
Pick the idiomatic Go translation

About this theme

sync.Mutex, sync.RWMutex, sync.WaitGroup, sync.Once. The classical concurrency toolbox. Go's culture prefers channels for orchestration and sync for protecting state. Use whichever makes the code clearer; don't pick a side as a religion.