iOS · 18 min
iOS interview questions in 2026, round by round
iOS interview questions for 2026, organised by round: Swift, concurrency, memory, SwiftUI, UIKit, architecture, system design, testing, coding and behavioural.
iOS · 30 min read
The top 100 iOS interview questions for 2026 with short answers, grouped by area: Swift, memory, concurrency, SwiftUI, UIKit, architecture, design and testing.
A hundred questions is a revision sheet, not a study plan. Use this page the week of your loop to find gaps fast: read each question, answer it in your head, then check the short answer. If yours matched, move on. If it did not, that topic goes on tomorrow’s list.
The questions come from what I hear most in iOS loops after more than 500 interviews on the hiring side, grouped into ten areas of ten. Answers are one to three sentences, which is about the length of a good first answer in a real interview before the follow-up arrives. For weak and senior answers side by side, use the top 10 iOS interview questions; for more room per answer, the top 50.
| Pass | What you do | Goal |
|---|---|---|
| First | Read every question, answer silently, mark misses | Find gaps |
| Second | Answer only the marked ones aloud | Fix wording |
| Third | Have someone pick ten at random and push back | Test under pressure |
Three passes over two or three days works better than one long session. The third pass matters most, because a real interviewer never lets a first answer stand on its own.
Answer: The compiler works out a type from the value or context, so let n = 5 is an Int without annotation. I still annotate public API and complex expressions to keep compile times and intent clear.
let versus var?”Answer: let binds a constant and var a variable. For a struct, let also makes all its properties immutable; for a class, only the reference is fixed.
Answer: An enum with some and none cases that forces you to handle a missing value before use.
Answer: Calling through an optional with ?., where the whole expression returns nil if any link is nil.
Answer: a ?? b unwraps a or falls back to b when a is nil.
Answer: Properties that calculate their value on each access instead of storing it. They suit derived values that are cheap to produce.
Answer: willSet and didSet run code around a change to a stored property. They do not fire during the owner’s own initializer.
Answer: Writing one function or type that works across many types while keeping full type safety, like Array<Element>.
where clause on a generic?”Answer: A constraint that narrows which types qualify, for example requiring an associated type to be Equatable.
Answer: Typed references to a property, like \User.name, that can be passed around and used to read or write that property later.
The fundamentals are quick, but hesitation on them in a phone screen colours the rest of the loop. The Swift interview questions guide goes deeper on each.
Answer: A technique where copies share storage until one of them mutates, at which point the mutating copy gets its own buffer. Standard collections use it.
some versus any?”Answer: some hides one fixed concrete type with static dispatch. any is an existential box for any conforming type, with dynamic dispatch.
Answer: A protocol where each conformer picks a type for a placeholder, like Element in Sequence. It usually needs generics or some at use sites. Since Swift 5.7 you can also write any Sequence<Int>, so the old rule that you can never use one as a type is out of date.
Answer: A type that turns a sequence of statements into one combined value. SwiftUI’s ViewBuilder is the best-known example.
Answer: Types that wrap storage for a property with reusable logic, applied with an @ attribute, like @State or a custom @Clamped.
Answer: Compile-time code generators that expand into Swift source, such as @Observable and #Preview. They are type-checked and visible with “Expand Macro” in Xcode.
Answer: A Swift 6 feature that lets a function declare the exact error type it throws, so callers can handle it without casting.
Answer: Static dispatch picks the implementation at compile time and can be inlined. Dynamic dispatch picks it at runtime through a witness table or vtable, which enables polymorphism.
final?”Answer: It prevents subclassing, which states intent and lets the compiler use static dispatch.
@autoclosure?”Answer: It wraps an argument expression in a closure automatically, so it is only evaluated if needed, as assert and ?? do.
Advanced Swift questions test curiosity more than memory. It is fine to say you have not used a feature in production, as long as you can explain what it is for.
Answer: It counts strong references to class instances and frees each instance when its count reaches zero.
Answer: The default kind of reference, which keeps the target alive.
Answer: An optional reference that does not keep the target alive and becomes nil when it is freed.
Answer: A non-optional reference that does not keep the target alive and traps if used after the target is gone. Unowned optionals exist too, so “non-optional” is not the whole definition.
Answer: A stored closure that captures self strongly, held by that same self, keeps both alive forever.
Answer: The [weak self] or [x] part of a closure that controls how values are captured, including copying a value at creation time.
[weak self] unnecessary?”Answer: When the closure is not stored beyond the call, such as map or forEach, or when a short-lived strong capture is intended.
Answer: Log in deinit in debug builds, or inspect the memory graph debugger after leaving the screen.
Answer: Limiting peak memory in tight loops that create many temporary Objective-C objects, like image processing.
Answer: Drop caches that can be rebuilt, such as decoded images, and let NSCache evict under pressure. NSCache is pressure-aware, not a strict LRU cache.
Memory questions are cheap for interviewers to ask and expensive for candidates to miss. Practise explaining a cycle out loud with a concrete example from your own code.
async/await?”Answer: Syntax for asynchronous functions that suspend without blocking a thread, reading top to bottom like synchronous code.
Task?”Answer: A unit of asynchronous work. Task { } inherits actor context and priority; Task.detached does not.
Answer: A reference type that serialises access to its mutable state, removing data races on that state. It does not make multi-step logic atomic across an await.
@MainActor?”Answer: The global actor tied to the main thread. Code isolated to it runs there, which is required for UI work.
Answer: Other callers getting a turn on an actor during a suspension inside one of its methods. Anything you checked earlier may no longer hold once the await returns.
Sendable?”Answer: A marker for types that are safe to pass across isolation domains, checked by the compiler.
async let?”Answer: A way to start a child task that runs concurrently and await its result later in the same scope.
Answer: A structured way to run a dynamic number of child tasks and collect their results.
Answer: Cooperatively: cancellation sets a flag, and code checks it or calls APIs that throw CancellationError. Cancelling does not undo a request the server may already have accepted.
AsyncSequence?”Answer: A sequence whose elements arrive over time, consumed with for await. AsyncStream creates one from callbacks; decide how it buffers and how the source is cleaned up when the stream ends.
Senior loops probe this area in follow-ups. The senior iOS interview questions guide shows how interviewers follow up on these.
Answer: They are lightweight descriptions of UI, cheap to create and compare. SwiftUI keeps the real state and rendering elsewhere.
@State do?”Answer: It gives a view storage that SwiftUI owns and preserves across body evaluations for as long as the view’s identity lasts.
@Binding do?”Answer: It gives a child two-way access to a value that some other view owns.
@Observable?”Answer: A macro that makes a class observable with per-property tracking, so a view is not updated by properties it never read. Parent, identity and environment changes can still invalidate it. It needs iOS 17 or later.
@Environment for?”Answer: Reading values injected higher up the view tree, such as colour scheme, dismiss actions or app services.
@Bindable?”Answer: A wrapper that creates bindings to properties of an @Observable object, for use with controls like TextField.
Answer: Reading more state than needed, unstable identity, and passing large models where a small value would do.
ForEach identify items?”Answer: By an id key path or Identifiable conformance, which must be stable across updates.
.task(id:) do?”Answer: Runs async work tied to the view’s lifetime, cancelling and restarting it whenever the id value changes.
Answer: #Preview renders views in Xcode with sample data, which speeds iteration and encourages views that take their dependencies as inputs.
SwiftUI questions reward a clear story about ownership and identity. The SwiftUI interview questions guide covers each in depth.
Answer: The path events and actions travel through views, controllers and the app until an object handles them.
viewDidLoad versus viewWillAppear?”Answer: viewDidLoad runs once after the view loads. viewWillAppear runs before every appearance.
prepareForReuse do?”Answer: It runs before a cell is reused, the place to reset state and cancel pending work.
Answer: A data source that applies snapshots of identifiers and animates the differences, avoiding batch update crashes.
Answer: A collection view layout built from items, groups and sections, which handles complex grids without subclassing.
bounds versus frame?”Answer: frame is a view’s rectangle in its superview’s coordinates. bounds is its own coordinate space.
Answer: The natural size a view reports from its content, like a label’s text, which Auto Layout uses without explicit width and height.
Answer: Priorities that decide which view grows or shrinks first when there is extra or too little space.
Answer: One object hands decisions or events to another through a protocol, usually held weakly to avoid a cycle.
Answer: With UIHostingController, added as a child view controller, or with UIHostingConfiguration for cells.
These show up whenever the codebase is older than a few years, which is most codebases. See the UIKit interview questions guide for more.
Answer: View controllers collect networking, state and layout, growing too large to test.
Answer: A view model that holds state and presentation logic, so the view only renders and tests can skip UI.
Answer: The Composable Architecture, a library with a single state, actions, reducers and managed effects, strong on testability.
Answer: A pattern splitting a screen into view, interactor, presenter, entity and router, suited to large UIKit teams at the cost of boilerplate.
Answer: An object that owns navigation flow, so view controllers do not push each other directly.
Answer: Passing dependencies in rather than creating them inside, which makes code testable and coupling visible.
Answer: They hide dependencies and share mutable state across tests. When one is needed, I still inject it.
Answer: A type that hides where data comes from, network or cache, behind one interface for the rest of the app.
Answer: They enforce module boundaries with access control and speed up incremental builds.
Answer: State flows down into views and user actions flow up to one owner that changes state, which makes changes easy to trace.
Architecture questions are scored on reasons. The iOS architecture interview questions guide shows how to defend a choice.
Answer: An API client that builds requests from typed endpoints, decodes with Codable, and maps errors into a small domain error type.
Codable?”Answer: A pair of protocols, Encodable and Decodable, that convert types to and from formats like JSON.
Answer: Use CodingKeys, or a decoder key strategy like convertFromSnakeCase.
Answer: Only for safe or idempotent requests, with exponential backoff and a cap. A timeout on a POST may have succeeded, so use an idempotency key. For a 429, wait as long as the server asks.
Answer: SwiftData for new SwiftUI-first apps that fit its model, Core Data for mature apps or features SwiftData does not yet cover.
Answer: In the Keychain, never in UserDefaults or files.
Answer: Comparing the certificate or public key the server presents with a value shipped in the app, which blocks some man-in-the-middle attacks but needs a rotation plan. In my view most apps do not need it; if you do pin, pin to a public key or use NSPinnedDomains in Info.plist, and plan the rotation.
URLCache help?”Answer: It stores HTTP responses and respects cache headers, giving cheap caching for many GET requests.
Answer: A background URLSession continues transfers while the app is suspended and relaunches the app to deliver results. A user force-quit stops it, and the file in the delegate callback is temporary, so move it.
Answer: Prefer cursor-based paging, load the next page near the end of the list, and track loading and end states.
Networking answers improve when you mention failure: timeouts, retries and offline. That is where interviewers push.
Answer: With requirements and scale: users, offline needs, real time or not, and what matters most.
Answer: Memory and disk layers, deduplicated in-flight loads, cancellation, and downsampling at decode time off the main thread.
Answer: Cursor paging, a local store for instant launch, prefetching and clear loading states.
Answer: Local store as source of truth, a durable outbox, idempotent retries and a stated conflict rule that never silently loses user text.
Answer: WebSocket in the foreground, push in the background, local persistence and resync by last seen id.
Answer: Register for a token, send it to the server, handle taps with deep links, and use a notification service extension for rich content.
Answer: A small event API behind a protocol, batched uploads, and a schema so events stay consistent.
Answer: Remote config with local defaults, used for gradual rollout and as a kill switch.
Answer: Measure a cold launch in a Release build on a real device, with the App Launch template in Instruments and field data from MetricKit or the Xcode Organizer, then defer non-critical work past the first frame.
Answer: Support Dynamic Type, VoiceOver labels and sufficient contrast from the start, and test with the Accessibility Inspector.
The iOS system design interview guide has full walkthroughs of the design questions above.
Answer: Apple’s newer test framework with @Test functions, #expect assertions and parameterized tests.
Answer: Write async tests that await results, with injected clocks and fakes instead of sleeps.
Answer: Catching visual regressions by comparing rendered views against reference images.
Answer: Profiling CPU time, memory, leaks, hangs, energy and SwiftUI updates, on a real device and in a Release build, since debug builds mislead.
Answer: Use the hangs report or Time Profiler to find work blocking the main thread, then move it off or make it smaller.
Answer: Builds and tests every change, and automates signing and delivery so releases are repeatable.
Answer: Impact, how you narrowed it down, the fix, and what you changed so the same bug cannot come back.
Answer: Both positions stated fairly, how you tested yours, the decision, and how you supported it.
Answer: Pair on real work, give specific feedback, and help people take on problems slightly beyond their comfort.
Answer: Tie something specific about the product or team to work you have done and want to do more of.
Behavioural answers at the end of a list are easy to skip, and that is a mistake. At senior level they often decide the outcome.
@MainActor written on every type. Do not guess a module’s setting from the compiler version. Check the language mode and the default isolation in the build settings.@concurrent attribute marks a function that should run concurrently, which makes it visible in the code when work leaves the actor.Where a one-line answer here is too short to be safe, these docs are the place to confirm the detail before you say it in an interview.
A hundred short answers will not carry you through a loop by themselves. Use them to find what you do not know, then spend real time there.

iOS · 18 min
iOS interview questions for 2026, organised by round: Swift, concurrency, memory, SwiftUI, UIKit, architecture, system design, testing, coding and behavioural.

iOS · 13 min
Swift interview questions with spoken answers: value and reference types, protocols, generics, memory and errors, and the follow-up each one leads to.

iOS · 13 min
SwiftUI interview questions on identity, state ownership, Observation and performance, each with the answer that scores, the trap and the follow-up.