Intermediate interview questions in iOS & Swift, page 2

Describe a pattern for background Core Data fetches and UI updates
This tests NSManagedObjectContext concurrency and queue confinement. Strong answer: create a background context, fetch, pass objectIDs or structs to main, then main context fetches by ID to update UI. Red flag: passing NSManagedObjects across threads.

Describe lightweight vs heavyweight Core Data migration and a heavyweight example
This tests inferred versus manual Core Data migrations. Contrast lightweight additive changes with heavyweight transforms like entity splits, citing promoting a string to a new entity. A red flag is claiming renames always need custom mapping.
URLSession data vs download vs upload tasks
Data tasks buffer responses in memory for small API calls; download tasks stream to a file and support background transfers for large files; upload tasks send bodies from data or files and report…
Run two API calls concurrently with async let
Use async let to start two independent fetches that run concurrently, then await both, so total time approaches the slower call rather than the sum.
What is @MainActor and why does it matter?
@MainActor is a global actor guaranteeing code runs on the main thread; annotate UI-updating types or methods so post-network state changes are main-thread safe.
Add a default header to every URLSession request
Set httpAdditionalHeaders on a URLSessionConfiguration, build the session from it, mention per-request overrides win.
Difference between frame, bounds, and center
Frame and center are in the superview's space; bounds is the view's own space, usually origin zero. A non-identity transform makes frame undefined to read.
Build a custom circular progress bar in UIKit
Draw an arc with UIBezierPath, assign it to a CAShapeLayer path, set lineWidth and no fill, animate strokeEnd 0 to 1.
Allow simultaneous pan and pinch gestures
Attach pan and pinch recognizers, set yourself as delegate, return true from shouldRecognizeSimultaneouslyWith, apply translation to center and scale to transform.
Track location continuously in the background
Set desiredAccuracy, distanceFilter, activityType; enable the Location background mode and allowsBackgroundLocationUpdates; request Always authorization.
Run a Core ML image model with Vision
Add the .mlmodel so Xcode generates a class, wrap it in a VNCoreMLModel, run a VNCoreMLRequest via a VNImageRequestHandler, read results off the main queue.
Display thousands of map annotations efficiently
Enable clustering via clusteringIdentifier, reuse views with dequeueReusableAnnotationView, render clusters with MKClusterAnnotation in viewFor.
Unit test a ViewModel with a mocked NetworkService
Inject the protocol, supply a mock returning canned data, assert published state transitions.
Testing async code and completion handlers in XCTest
Create an expectation, fulfill it inside the completion handler, call wait with a timeout, or use async test methods.
Locating XCUITest elements without accessibility identifiers
Query by type, label, predicate, or index; chain queries to narrow scope.
Code coverage and its pitfalls
It measures executed lines, surfaces untested paths, and guides where to add tests.
Modularizing a monolithic iOS app
Extract low-dependency, high-reuse leaf code first behind clear interfaces, enforce boundaries, iterate inward.
Static library versus dynamic framework linking
Static code is copied into the executable at build time; dynamic is loaded at launch by dyld. Trade-off: static bloats the binary but avoids load cost; many dynamic frameworks slow launch.
Ad Hoc versus external TestFlight distribution
Ad hoc installs on pre-registered device UDIDs without Apple review; external TestFlight reaches many testers via the app but needs Beta App Review.
Using dSYM files to symbolicate crash reports
A dSYM maps stripped memory addresses back to function names, files, and line numbers; matched by UUID it symbolicates the report to readable frames.
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