Skip to content
tezvyn:

iOS & Swift

SwiftUI, UIKit, Xcode, Swift language, Apple platforms

66 bites

Test yourself: Top 30 intermediate iOS & Swift interview questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Intermediate interview questions in iOS & Swift, page 2

Describe a pattern for background Core Data fetches and UI updates
intermediate2 min read

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
intermediate2 min read

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.

intermediate2 min read

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…

intermediate2 min read

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.

intermediate1 min read

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.

intermediate1 min read

Add a default header to every URLSession request

Set httpAdditionalHeaders on a URLSessionConfiguration, build the session from it, mention per-request overrides win.

intermediate1 min read

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.

intermediate1 min 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.

intermediate1 min read

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.

intermediate1 min read

Track location continuously in the background

Set desiredAccuracy, distanceFilter, activityType; enable the Location background mode and allowsBackgroundLocationUpdates; request Always authorization.

intermediate1 min read

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.

intermediate1 min read

Display thousands of map annotations efficiently

Enable clustering via clusteringIdentifier, reuse views with dequeueReusableAnnotationView, render clusters with MKClusterAnnotation in viewFor.

intermediate1 min read

Unit test a ViewModel with a mocked NetworkService

Inject the protocol, supply a mock returning canned data, assert published state transitions.

intermediate1 min read

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.

intermediate1 min read

Locating XCUITest elements without accessibility identifiers

Query by type, label, predicate, or index; chain queries to narrow scope.

intermediate1 min read

Code coverage and its pitfalls

It measures executed lines, surfaces untested paths, and guides where to add tests.

intermediate1 min read

Modularizing a monolithic iOS app

Extract low-dependency, high-reuse leaf code first behind clear interfaces, enforce boundaries, iterate inward.

intermediate1 min read

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.

intermediate1 min read

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.

intermediate1 min read

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