📐 SwiftUI: iOS interview questions
- What is SwiftUI and how does it differ from UIKit? Junior PRO
- @State, @Binding, @StateObject, @ObservedObject, @EnvironmentObject — what's the difference? Middle PRO
- How does @StateObject differ from @ObservedObject in practice? Middle PRO
- What is @Observable (the Observation framework, iOS 17+)? Middle PRO
- How does SwiftUI decide what to redraw? What are identity and diffing? Senior PRO
- some View, ViewBuilder and result builders — what are they? Middle PRO
- onAppear vs .task — when to use which? Middle PRO
- How do state management and single source of truth work? Middle PRO
- What is GeometryReader and why shouldn't you overuse it? Middle PRO
- How does SwiftUI integrate with UIKit? Middle PRO
- How does a view's lifetime differ from the lifetime of the View struct? Senior PRO
- How do you pass data down and events up: let, @Binding, closures, Environment, PreferenceKey? Middle PRO
- How does Observation track changes, and where does fine-grained tracking break down? Senior PRO
- How does layout work in SwiftUI: size proposal, size choice, placement? Middle PRO
- How do you write a custom container with the Layout protocol? Senior PRO
- How do you make a long list fast: List, LazyVStack and stable ids? Senior PRO
- NavigationStack: how do path, navigationDestination and deep links work? Middle PRO
- How do SwiftUI animations work: implicit, explicit, Transaction and transitions? Middle PRO
- Who owns a screen's async work: .task, a Task in the model, refreshable and cancellation? Senior PRO
- How do you test SwiftUI screens: Previews, model tests, snapshots and UI tests? Middle PRO
Practice this before your interview
DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.
Get DevPrep on the App Store