Implement a Reusable Cyclic Barrier from a Mutex and Condition Variables

Quick Overview

Implement a reusable cyclic barrier from a mutex and condition variables, where a fixed number of threads block until all have arrived and are then released together. Tests round tracking for safe reuse, spurious wakeups, timeout and broken-barrier semantics, an atomics-only variant and concurrency testing.

Implement a Reusable Cyclic Barrier from a Mutex and Condition Variables

Company: Apple

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: hard

Interview Round: Onsite

Overview: Implement a reusable cyclic barrier from a mutex and condition variables, where a fixed number of threads block until all have arrived and are then released together. Tests round tracking for safe reuse, spurious wakeups, timeout and broken-barrier semantics, an atomics-only variant and concurrency testing.

Read the full Apple Software Engineer interview experience this question came from

Apple logo
Apple
Aug 28, 2026
hardSoftware EngineerOnsiteSoftware Engineering Fundamentals
6
0
Loading...