Back to topics

Topic

Concurrency

Modern Swift concurrency, synchronization tradeoffs, and the reasoning interviewers expect around safety and performance

Focus areas: Actors, structured concurrency, cancellation, data-race prevention

When would you choose a Swift actor over a serial DispatchQueue?

Compare language-level isolation with traditional queue-based synchronization in production iOS code

On which thread does Swift call deinit?

Explain that deinit runs where the last strong reference is released, then connect that rule to UI safety, MainActor isolation, and isolated deinit

How do you make shared mutable state thread-safe in Swift?

Start with the race condition, then compare locks, semaphores, queues, barriers, and actors for protecting shared mutable state in real Swift code

How do task groups differ from async let in practical iOS code?

Explain when fixed child tasks make `async let` the better tool, and when dynamic fan-out or incremental result handling pushes you to task groups