Swift is safe by design, but only if used well. These questions check whether a candidate understands optionals, memory and value semantics, not just UIKit/SwiftUI syntax.
Hiring a Swift developer is easy. Telling a real one from a convincing résumé is the hard part — and it’s most of what we do. These are grouped by level, because the same question that stretches a junior is a warm-up for a senior.
Junior Swift interview questions
0–2 years
Language basics.
What are optionals in Swift?
Types that may hold a value or nil, forcing you to handle absence with optional binding or the nil-coalescing operator.
Force-unwraps with ! everywhere and crashes.
What is the difference between a struct and a class?
Structs are value types copied on assignment; classes are reference types shared by reference. Swift favours structs for models.
Uses classes for everything and hits shared-mutation bugs.
What is the difference between let and var?
let is a constant, var is mutable; prefer let for immutability and clarity.
Uses var by default with no reason.
What is optional binding and the nil-coalescing operator?
if let/guard let safely unwrap optionals; ?? supplies a default. They avoid force unwraps.
Force-unwraps instead of binding.
What is a guard statement?
An early-exit that unwraps or validates and returns/throws otherwise, keeping the happy path unindented.
Nests deep if pyramids instead.
What are closures?
Self-contained blocks of functionality that capture their surrounding context, used heavily for callbacks and functional operations.
Cannot explain capture semantics.
What are protocols?
Contracts of required methods/properties that types adopt, enabling protocol-oriented design and polymorphism.
Relies only on class inheritance.
What is the difference between map, filter and reduce?
Transform, select and fold a collection respectively, producing new values without manual loops.
Writes verbose loops for simple transformations.
Mid-level Swift interview questions
2–5 years
Memory and patterns.
How does ARC manage memory?
Automatic Reference Counting frees objects when their reference count hits zero; strong reference cycles cause leaks.
Assumes there’s a garbage collector.
What is a retain cycle and how do you break it?
Two objects strongly referencing each other never deallocate; weak or unowned references break the cycle, commonly in closures with [weak self].
Captures self strongly in closures and leaks.
What is the difference between weak and unowned?
Both avoid strong references; weak becomes nil when the object is freed, unowned assumes it outlives the reference and crashes if not.
Uses unowned where the object can be nil.
What are value vs reference semantics in practice?
Value types copy so mutations stay local, avoiding shared-state bugs; reference types share and need care with mutation.
Passes a class around and is surprised by shared mutations.
What are generics and associated types?
Type parameters for reusable, type-safe code; protocols use associated types for generic requirements.
Uses Any and loses type safety.
How does error handling work in Swift?
throws/try/catch for recoverable errors and typed Result where appropriate; not for ordinary control flow.
Force-tries (try!) and crashes on error.
What is the difference between escaping and non-escaping closures?
Escaping closures outlive the function call (stored/async) and require explicit annotation and capture care.
Doesn’t understand why a closure needs @escaping.
How do you handle concurrency in modern Swift?
async/await, actors for protecting mutable state, and structured concurrency with tasks.
Manages threads manually with race conditions.
Senior Swift interview questions
5+ years
Architecture and performance.
How do actors help with concurrency?
Actors serialise access to their mutable state, preventing data races by design in Swift concurrency.
Guards shared state with ad-hoc locks and still races.
How do you architect a large iOS app?
A clear pattern (MVVM/VIPER/TCA), dependency injection, modularisation, and separation of UI from business logic.
Massive view controllers holding everything.
What are the tradeoffs of SwiftUI vs UIKit?
SwiftUI is declarative and fast to build with, but has maturity gaps and OS-version constraints; UIKit is battle-tested and granular.
Presents one as strictly superior with no nuance.
How do you diagnose performance and memory issues?
Instruments (Time Profiler, Allocations, Leaks) to find hotspots and retain cycles, then optimise measured problems.
Guesses without profiling.
How do you keep the main thread responsive?
Do heavy work off the main actor/thread and update UI on the main thread, avoiding blocking calls.
Does network or heavy work on the main thread.
How does protocol-oriented programming change design?
Composing behaviour via protocols and extensions with value types instead of deep class hierarchies.
Defaults to class inheritance for reuse.
How do you manage dependencies and modularity?
Swift Package Manager, clear module boundaries, and dependency injection for testability.
One monolithic target with tangled dependencies.
How do you test iOS code effectively?
Unit-test business logic isolated from UIKit/SwiftUI, use protocols to mock dependencies, and add UI tests for critical flows.
All logic lives in view controllers, untestable.
Build and score a full interview with our free interview scorecard tool, browse the full question hub, or see how we interview engineers.