Intermediate interview questions in iOS & Swift, page 3
Phased release to limit update risk
Enable phased release so an approved update reaches a growing percentage of automatic-update users over seven days; pause if metrics spike.
Automatic signing: benefits and limitations on teams
Automatic signing creates certificates and profiles on demand and keeps them in sync, easing local setup; limits include proliferating certificates, weak CI fit, and less control for complex entitlements.
Struct versus class performance and memory tradeoffs
Structs are value types, often stack-allocated with no ARC; classes are heap-allocated reference types with retain counts.
Exposing Swift classes to Objective-C
Subclass NSObject or mark members @objc, import the generated ModuleName-Swift.h, and accept that Swift-only types like enums with associated values cannot cross.
What an autoreleasepool is and when to add one manually
An autorelease pool holds objects until it drains; wrap tight loops creating many temporary ObjC objects in autoreleasepool to cap peak memory.
dispatch_async versus Task.detached for offloading work
Dispatch_async submits a closure to a queue; Task.detached starts an unstructured async task off the current actor without inheriting context.
map versus compactMap versus flatMap
Map transforms each element one-to-one; compactMap transforms then drops nils; flatMap transforms to sequences then concatenates.
Copy-on-write and implementing it for a custom struct
CoW shares a buffer until mutation, deep-copying only when the buffer is non-unique; Array, Dictionary, Set, String use it; implement with a class storage box and isKnownUniquelyReferenced.
View identity in SwiftUI and the .id() modifier
Identity links a view to its persistent state and transitions; structural identity comes from position, explicit identity from .id(); changing the id resets state and forces a new view.
Faulting in Core Data
A fault is a placeholder object whose property data is not yet loaded; accessing a property fires the fault and fetches from the store, saving memory.
Minimizing Storyboard merge conflicts
Split into many small storyboards or xibs, or move to programmatic or SwiftUI layout; process-wise coordinate ownership and merge often.
Decoding a heterogeneous JSON array by a type field
Peek the type field with a partial decode, switch on it, and decode the concrete type, wrapping each in an enum or boxed protocol value.
Retain cycles and how to break them
A cycle is two objects (or a closure and its owner) holding mutual strong references so neither deallocates; break it with a [weak] or [unowned] capture list.
Purpose of the guard statement
Guard requires its condition to hold or else exits the scope, and unwrapped optionals stay in scope afterward; this flattens nesting versus if.
Closures and trailing closure syntax
Closures are self-contained function blocks that capture surrounding state; a final closure parameter can be passed as a trailing closure outside the parentheses.
do-try-catch versus Optional return types
Throwing functions with do/try/catch convey why something failed via typed Error values; Optionals only say success or absence. Use throws when the caller needs the reason.
Protocols with associated types and opaque types
A PAT leaves a placeholder type unresolved, so it has no single concrete shape and historically could not be used as a bare existential; opaque types with some let you return one fixed underlying conforming…
IBOutlet vs IBAction in Interface Builder
Outlet references a view, action handles an event, both connect via Ctrl-drag.
Push vs Modal Presentation in UIKit
Push adds to a nav stack with back, modal presents a self-contained interrupting flow.
Building a Card Flip Animation in SwiftUI
Drive a flipped state, rotate both faces with rotation3DEffect, hide the back face.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles