We use analytics and advertising cookies to understand how the site is used and whether our ads on Facebook, Instagram and Microsoft search (Bing) work. They are set only if you accept. See our Privacy Policy for details.
Practice Swift and iOS interview questions on optionals, value and reference types, protocols and generics, ARC and retain cycles, Swift concurrency and actors, SwiftUI state, UIKit lifecycle and the iOS app lifecycle.
Answer a real Swift & iOS interview question before you browse the list. No signup needed.
An ABC defines __subclasshook__ to return True when the candidate class has a method quack. A class Duck is never registered with the ABC and never inherits from it, but it does define quack. What does issubclass(Duck, MyABC) return?
Practice in a session
10 questions from Swift & iOS, one after another, then your score and streak.
Optionals and unwrapping, structs versus classes and copy-on-write, protocols and protocol-oriented design, generics, ARC with weak and unowned references, closures and capture lists, Swift concurrency (async/await, actors, Sendable), SwiftUI state and data flow, and UIKit fundamentals such as the view controller lifecycle and Auto Layout.
Prefer a struct for data that should be copied when assigned, such as models and values, because it avoids shared mutable state and is thread-friendly. Use a class when you need identity, shared references, inheritance, or Objective-C interop. Swift's standard collections are structs that use copy-on-write to stay cheap.
ARC frees an object when its strong reference count reaches zero, so two objects that hold strong references to each other - often a class and a closure it stores that captures self - are never freed. Break the cycle with a weak or unowned reference, typically [weak self] in the closure's capture list.
An actor protects its mutable state by letting only one task run its code at a time, so data races on that state become compile-time errors. Calls into an actor from outside are asynchronous and need await. @MainActor applies the same idea to UI code that must run on the main thread.
Both. New screens are often SwiftUI, so expect questions on @State, @Binding, @Observable and view identity, but most production apps still contain UIKit, so lifecycle methods, table and collection views, and mixing the two with UIHostingController remain common.