Apple Interview Question

Special case of malloc implementation. Implementing a spinlock, etc.