← 返回 apple 的题目列表OS Fundamentals & Concurrency Drill
类型:qbank
Apple Core OS / low-level teams open with a hiring-manager round that stays almost entirely on OS fundamentals: process vs thread, CPU scheduling, synchronization primitives (mutex / semaphore / condition variable), race conditions and deadlock, escalating to multi-core synchronization.
Requirements
This hiring-manager round is a conversational drill on operating-system fundamentals (no LeetCode-style coding). Be ready to explain and reason about:
Processes vs threads: address space, context, and when to use each.
CPU scheduling: common policies and their trade-offs.
Synchronization primitives: mutex, semaphore, and condition variable, and when each is appropriate.
Race conditions: how they arise and how to prevent them.
Deadlock: the four necessary conditions, plus detection, prevention, and avoidance.
Multi-core synchronization: the harder thread, covering memory visibility, atomics and memory barriers, cache coherence, and lock design under true parallelism.
Notes
The round rewards fluency over recitation. Follow-ups tend to move from a single-core mental model into true multi-core behavior, where naive locking reasoning breaks down. Be precise about what a mutex guarantees versus a condition variable, and why a semaphore is more than just a counter.
Preparation
Re-derive the classic synchronization problems (producer-consumer, readers-writers) using a mutex plus condition variable, by hand.
Walk through the four Coffman deadlock conditions and give a concrete prevention strategy for each.
Review multi-core memory models: atomicity, ordering and memory barriers, and why cache coherence matters for lock-free reasoning.