Swift language features interview questions
Scenario-style prompts with sample answer outlines. Focus is on how you would design and reason in real codebases.
- 01Value vs reference semantics: struct, class, actorWhen would you choose a struct vs a class vs an actor for a model type in an iOS app? What are the tradeoffs for identity, mutation, and concurrency?
- 02Optionals: guard let, if let, chaining, nil coalescingHow do you choose between guard let, if let, optional chaining, and nil coalescing for clarity and safety? When would you avoid force-unwraps?
- 03Protocols, generics, and where clausesHow do you use protocol-oriented design with generics and associated types? When do you need a where clause on an extension or generic method?
- 04Memory management: ARC, strong, weak, unownedExplain ARC's role in Swift. When do you use weak vs unowned references, and how do you break retain cycles in closures and delegates?
- 05Closures: captures and @escapingWhat does @escaping mean for a closure parameter? When can a closure be implicitly non-escaping?
- 06Error handling: throws and ResultCompare throws/try/catch with Result for modeling failures.
- 07Property wrappers: @State, @Published, custom wrappersWhat problem do property wrappers solve? How would you implement a simple custom property wrapper, and what is the projected value ($)?
- 08Copy-on-write in standard library collectionsWhat is copy-on-write for Array and Dictionary? Why does it matter for performance and when does copying still happen?
- 09Sendable, ownership, and mutabilityWhat does Sendable communicate to the compiler? How does it relate to actor isolation and mutability in Swift 6 concurrency?



