← Questions

Implement a mutex without built-in locks

0
AppleCodingLast asked Aug 2026

A coding interview question asked in Apple's coding round, last asked Aug 2026. It tests concurrency, atomics and synchronization.

Implement a mutual-exclusion lock with lock() and unlock(). You may not use any lock, mutex, semaphore, monitor or condition variable from the language or a library: the point is to build one.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Apple · Coding · Last asked Aug 2026

What it tests

concurrency · atomics · synchronization

Your code and the AI tutor open when you unlock this question.