Implement a Mutual-Exclusion Lock Without Built-In Locks

Quick Overview

Implement a mutual-exclusion lock without any built-in lock, mutex or semaphore, relying only on atomic operations. Tests atomic read-modify-write, memory ordering, spinning versus sleeping waiters, fairness, reentrancy, and software-only mutual exclusion when atomic instructions are unavailable.

Implement a Mutual-Exclusion Lock Without Built-In Locks

Company: Apple

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: hard

Interview Round: Onsite

Overview: Implement a mutual-exclusion lock without any built-in lock, mutex or semaphore, relying only on atomic operations. Tests atomic read-modify-write, memory ordering, spinning versus sleeping waiters, fairness, reentrancy, and software-only mutual exclusion when atomic instructions are unavailable.

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

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