Go Concurrency Patterns Checkpoint

Structured concurrency, cancellation, backpressure, and safe publication.


Get every question correct to pass this checkpoint. You can review feedback, revise your answers, and submit again.

1. BoundMap computes inputs [7,3,8] and the callbacks finish at indices 2,0,1. Each returns its input plus 10. What output is required?

Select one answer.

2. Each new goroutine acquires a semaphore inside its body before calling fn. For a million inputs and limit 4, what is actually bounded?

Select one answer.

3. A producer has finished sending jobs to workers that range over a channel. It calls Wait before closing jobs. What can happen?

Select one answer.

4. A context-aware worker has both a ready job and a ready ctx.Done case in select. Which behavior is guaranteed?

Select one answer.

5. One callback blocks forever on a channel unrelated to context. The parent cancels and joins all workers. What should the caller expect?

Select one answer.

6. BoundMap receives nonempty input, a valid callback, and maxConcurrency=-1. What value must it return without invoking the callback?
Join Discord