Q1
Explain the difference between `@escaping` and non-escaping closures in Swift, and provide a real-world example of when you'd use each.
Why they ask this:* This tests understanding of memory management, closure semantics, and whether the candidate can write safe, performant Swift code without causing retain cycles.
Q2
Walk us through how you would optimize an app that's experiencing poor scroll performance when displaying a large list of images. What tools would you use to diagnose the problem?
Why they ask this:* This evaluates practical debugging skills, familiarity with Instruments and performance profiling, and knowledge of iOS-specific optimization techniques like cell reuse and image caching.
Q3
Describe your approach to handling concurrent network requests in iOS. How would you decide between using URLSession with DispatchGroup, Combine, or async/await?
Why they ask this:* This assesses knowledge of concurrency patterns in iOS, understanding of modern Swift concurrency, and ability to choose appropriate solutions based on project constraints.
Q4
How do you manage state in SwiftUI applications? Walk through an example of when you'd use @State, @ObservedObject, and @EnvironmentObject.