P
prepair.app
Start interview →
EnglishУкраїнськаРусскийDeutsch
🍏

Middle iOS (Swift)IOS developer interview questions

Middle · 2–4 years of experience

iOS interviews test the Swift type system, how ARC manages memory, and whether you can reason about UI state — plus at least one question where a retain cycle is hiding in plain sight. Below are the questions asked most often, each with a model answer. Middle: deeper understanding, optimization, and real-world situations.

Try it — no account needed
Preparing your question…

Topics to prepare

Swift language and optionals
ARC and memory management
SwiftUI and UIKit
Concurrency: async/await, Combine, GCD
Architecture and state
Persistence and networking

7 Middle-level questions with answers

1

What is the difference between `@State`, `@Binding` and `@ObservedObject`?

Answer

@State is a value a view owns and mutates. @Binding is a reference to someone else's @State, passed down so a child can write to it. @ObservedObject watches a reference type that publishes changes and is owned elsewhere. The related mistake is @ObservedObject where @StateObject was needed — the object is then recreated on every re-render.

2

How does `async/await` differ from completion handlers?

Answer

They express the same suspension, but await keeps the code linear and lets errors travel with throws instead of an error parameter you can forget to check. The compiler also enforces structured concurrency: a task's children are cancelled with it. The migration trap is calling an async function from a synchronous context, which needs an explicit Task.

3

What does `@MainActor` guarantee?

Answer

That the annotated code runs on the main thread, checked by the compiler rather than by convention. UI work must be on main, and before actors this was a runtime assertion you discovered by crashing. Marking a view model @MainActor is usually simpler than dispatching at every call site.

4

Why is `reuseIdentifier` necessary, and what breaks without careful reuse?

Answer

Because a table or collection view keeps a small pool of cells and rebinds them as you scroll, rather than allocating one per row. What breaks is state left on the cell from its previous occupant — an image from row three appearing at row forty. prepareForReuse and cancelling the in-flight image request are the fixes.

5

How do you find the cause of a memory leak on iOS?

Answer

The memory graph debugger shows what is still alive and who holds it, which usually names the cycle directly. Instruments' Leaks and Allocations answer the same question over time. The frequent culprits are closures capturing self strongly, a delegate declared strong instead of weak, and observers never removed.

6

How do you keep scrolling smooth?

Answer

Do nothing expensive on the main thread during a scroll: decode images off-main, cache the decoded result rather than the data, and avoid layout that recomputes on every frame. Off-screen rendering from shadows and masks is the quiet one — a corner radius with masksToBounds on many cells costs more than it looks.

7

How do you handle a network layer's errors sensibly?

Answer

Model them: a typed error that distinguishes no connectivity, a server 5xx, a 4xx you caused, and a decoding failure — because each deserves a different message and a different retry policy. Retrying a 400 forever is the failure mode. Decoding errors especially should be loud in development and never silently swallowed.

🦎

Reading answers is not enough

In a real interview you speak under pressure. Cam asks these same questions, scores every answer, and shows exactly what to fix.

Practice a Middle iOS (Swift) interview →
Free · 3 interviews per month

Other levels — iOS (Swift)

Junior iOS (Swift)Senior iOS (Swift)All iOS (Swift) questions

Other specializations

🔍Middle Manual QA🤖Middle QA AutomationMiddle Java Backend🐍Middle Python Backend🐘Middle PHP Backend🦫Middle Go Backend🟢Middle Node.js Backend💎Middle Ruby on Rails🟣Middle .NET Backend Developer🔷Middle C++