Home / Sendable interview questions
Swift concurrency
Sendable interview questions
Sendable is how the compiler proves data can cross concurrency boundaries safely. With Swift 6 strict concurrency, it comes up constantly.
What Sendable means
A Sendable type can be safely passed between isolation domains, such as into an actor or across a task boundary, without introducing a data race. Value types made of Sendable parts are usually Sendable automatically; classes are not, unless they are immutable or synchronize their own access, because shared mutable references are exactly what races on.
Talking about @unchecked Sendable
@unchecked Sendable tells the compiler to trust that you have made a type safe yourself, for example a class that guards all state with a lock. Explain that it is an escape hatch you justify, not a way to silence warnings. In interviews, showing you understand why the compiler flags a type is more valuable than knowing the annotation.
Go deeper than a summary
Share Your Screen works topics like this through in full: 75 solved Swift problems with tests, 9 real case studies, and 7 annotated mock interviews, so you rehearse the live round instead of just reading about it.
Frequently asked
Why is my class not Sendable?
Classes have shared mutable reference semantics, which is unsafe across concurrency boundaries. Make it immutable, isolate it to an actor, or synchronize access and mark it @unchecked Sendable with justification.
When is @unchecked Sendable acceptable?
When you have manually guaranteed thread safety, such as protecting all mutable state with a lock, and can justify that the compiler simply cannot verify it.