Skip to content
All essaysTwo swifts arriving at the same narrow stone niche at the same instant from opposite sides, only one space between them

Interviews

Senior iOS developer interview questions and answers (2026): 15 scenarios

Fifteen senior iOS interview scenarios, each with the question, the weak answer, a strong spoken answer, the follow-up that decides it and where senior reasoning ends and staff reasoning begins. Three of them come with a short Swift reproducer: the bug first, then the fix.

By Mike Salari. Staff mobile engineer · 500+ technical interviews from the hiring side.

15 min read

An actor can still allow two callers to claim the same resource. A cancelled task can still leave a write committed on a server. A SwiftUI screen can discard state after its identity changes, even though the code compiles. If you cannot explain these failures, memorising another 100 iOS questions will not help much.

I am a Staff Mobile Engineer and Tech Lead with 15 years in mobile, and I have run 500+ technical interviews on the hiring side.

When I ask a senior-level question, the API name is rarely the end of the answer. I look for a precise invariant, an execution order that breaks it, the smallest correction, and a test that would fail before the fix. Apple makes the actor rule clear in its WWDC explanation of reentrancy: an actor can execute other work while one of its methods is suspended. That one detail changes how you design caches, checkout flows and reservations.

These 15 scenarios deliberately begin where the ordinary interview flashcards stop: after the implementation appears to work. Each answer below is a model of reasoning, not a script you should recite. State the invariant in your own words, then let the interviewer change one constraint.

Across the 500+ technical interviews I have conducted and debriefed, the most common senior failure was not a missing API. It was a candidate who started coding within thirty seconds of the prompt, went silent for eight minutes, polished a helper while the core requirement sat unfinished, and said "done" without walking through a single case. From my side of the screen, silent correct work and silent confusion look identical. I can only score what you make visible.

The 15 scenarios at a glance

ScenarioThe questionThe follow-up that decides it
1. Actor isolation under pressureYour image cache is shared by multiple tasks. How do you prevent a data race?What if a cache lookup suspends between reading and writing?
2. Cancellation after navigationA user leaves a screen while a request is running. What should happen?What happens if the server processes the write after client cancellation?
3. Main actor versus background workWhy did a SwiftUI screen freeze during JSON processing?What evidence shows the fix improved responsiveness?
4. View identity and lost stateA form resets when a filter changes. What do you investigate?What should persist across process death?
5. Duplicate network requestsA list loads twice when the user returns to it. How do you debug it?What if two accounts request the same endpoint?
6. The offline write contractThe user edits a note without connectivity. What appears on screen?What if another device edited the same note?
7. Pagination without duplicatesA feed has gaps and duplicates while scrolling. What is your first fix?What happens when an item is deleted between page requests?
8. Dependency injection and testsHow do you test a feature that depends on networking and persistence?Which failures must stay in integration tests?
9. Secure token handlingWhere should an iOS app keep a refresh token?What happens when the device is compromised?
10. Image memory in scrollingScrolling a large gallery causes the app to be terminated. How do you proceed?How do you choose a cache budget?
11. Task ordering and stale searchTyping quickly shows results for an older search term. What is happening?What if cancellation does not reach the server?
12. Schema migrationsThe new app version changes local storage. How do you release safely?Can you roll back after a destructive migration?
13. Push notifications and truthA push notification says an order shipped, but the app shows pending. Which wins?What happens offline when users tap the push?
14. Feature flags and rollbackA new checkout flow crashes for one device segment. What is your rollback?Can the old client still read data written by the new flow?
15. Explaining a trade-offWould you choose UIKit or SwiftUI for a new critical screen?What finding would make you reverse your choice?

A full follow-up: when actor isolation is not a transaction

Take the first scenario. Suppose two taps reach an actor method that checks whether a reservation is free. The method awaits a network check and only then sets reserved = true. Both callers may enter before either commits the local flag. The dictionary, flag and actor are all race-free, yet the business invariant, one reservation only, is violated.

A candidate who proposes "put it in an actor" has answered only the memory-safety question. The next question is about atomicity across suspension. I expect them to move the local claim before the first await, or to revalidate after suspension, depending on whether the server or device has authority. If the server owns the inventory, the definitive claim needs a server-side conditional operation. A client actor is not a distributed lock.

The test is deliberately adversarial. Start two tasks at the same time, make the awaited dependency suspend, and assert no more than one successful local claim. Then simulate the server accepting a request while its response is lost. The client retries. Without a stable operation identifier and server-side deduplication, the fix for the original race can still duplicate a real effect.

This is what I mean by Senior judgment: explain the limit of the first fix without hiding behind another abstraction. Staff reasoning extends the contract to all clients and old app releases. That is not a more elaborate Swift answer. It is a different authority boundary.

1. Actor isolation under pressure

Question: "Your image cache is shared by multiple tasks. How do you prevent a data race?"

Weak answer: "I would wrap the dictionary in a singleton."

Strong spoken answer: "I would put mutable cache state behind an actor and expose operations rather than the dictionary itself. I would bound the cache size separately, because isolation does not solve memory pressure. I would verify whether callers need a snapshot or a stream of changes."

Platform reference: Swift actor isolation.

The next follow-up: "What if a cache lookup suspends between reading and writing?" This exposes whether I can trust the candidate to reason about actor reentrancy, not simply the absence of data races.

Senior versus Staff: Staff asks whether a cache belongs on the client, what its invalidation policy costs and whether separate screens can share it safely.

A small reproducer, first the bug:

Swift
actor ClaimGate {
    private var claimed = false

    func claim() async -> Bool {
        guard !claimed else { return false }
        await Task.yield()
        claimed = true
        return true
    }
}

Swift 6, targeting Xcode 26. The sample was type-checked with Swift 6.2.1.

The fix:

Swift
actor ClaimGate {
    private var claimed = false

    func claim() async -> Bool {
        guard !claimed else { return false }
        await Task.yield()
        guard !claimed else { return false }
        claimed = true
        return true
    }
}

Swift 6, targeting Xcode 26. The corrected actor was type-checked with Swift 6.2.1.

Why: An actor serialises access between suspension points. Another call may run while the first awaits. The second check protects the invariant after resumption. See Apple's actor reentrancy explanation.

2. Cancellation after navigation

Question: "A user leaves a screen while a request is running. What should happen?"

Weak answer: "The request will eventually finish, so I ignore the response."

Strong spoken answer: "I would tie the operation to the view or feature lifetime, propagate cancellation and ensure stale results cannot overwrite newer state. Cancellation is cooperative, so I would check at suspension boundaries and protect the final state update with request identity."

Platform reference: Swift task cancellation.

The next follow-up: "What happens if the server processes the write after client cancellation?" This exposes whether the candidate distinguishes cancelling a local task from reversing a server-side effect.

Senior versus Staff: Staff separates client cancellation from server-side commitment and proposes idempotency for writes.

A stale result, first the bug:

Swift
@MainActor
final class SearchState {
    private(set) var latestQuery = ""
    private(set) var displayedResult = ""

    func presentResult(for query: String) async {
        latestQuery = query
        await Task.yield()
        displayedResult = query
    }
}

Swift 6, targeting Xcode 26. The stale-result example was type-checked with Swift 6.2.1.

The fix:

Swift
@MainActor
final class SearchState {
    private(set) var latestQuery = ""
    private(set) var displayedResult = ""

    func presentResult(for query: String) async {
        latestQuery = query
        await Task.yield()
        guard !Task.isCancelled, latestQuery == query else { return }
        displayedResult = query
    }
}

Swift 6, targeting Xcode 26. The guarded-result example was type-checked with Swift 6.2.1.

Why: The state guard prevents an older response from replacing the result of a newer request. Cancellation alone cannot establish ordering. See Swift Task cancellation.

3. Main actor versus background work

Question: "Why did a SwiftUI screen freeze during JSON processing?"

Weak answer: "I used async/await, so it was not blocking."

Strong spoken answer: "Async syntax does not guarantee CPU-intensive work happens off the main actor. I would profile the main-thread stall, identify where parsing and transformation execute, and move independent CPU work off UI isolation while delivering view state back safely."

The next follow-up: "What evidence shows the fix improved responsiveness?" I ask this to find out whether the candidate measures main-thread responsiveness rather than assuming an async function runs elsewhere.

Senior versus Staff: Staff sets a responsiveness budget and makes regression detection part of releases, rather than fixing one screen.

4. View identity and lost state

Question: "A form resets when a filter changes. What do you investigate?"

Weak answer: "I would add another State property."

Strong spoken answer: "I would inspect whether the view identity changes, especially conditional branches, list identifiers and explicit IDs. State lifetime is attached to identity, so I would preserve stable identity and lift user input to an owner whose lifetime matches the task."

The bug, in code:

Swift
import SwiftUI

struct NoteField: View {
    @State private var note = ""
    var body: some View { TextField("Note", text: $note) }
}

struct OrderForm: View {
    let compact: Bool
    var body: some View {
        // Two branches are two different views to SwiftUI.
        // Toggling `compact` destroys one NoteField and its @State with it.
        if compact {
            NoteField()
        } else {
            NoteField().padding()
        }
    }
}

The fix keeps one view and changes only its modifier:

Swift
import SwiftUI

struct NoteField: View {
    @State private var note = ""
    var body: some View { TextField("Note", text: $note) }
}

struct OrderForm: View {
    let compact: Bool
    var body: some View {
        // One view with a changing modifier keeps the same identity,
        // so the typed note survives the layout change.
        NoteField()
            .padding(compact ? 0 : 16)
    }
}

Type-checked with Swift 6.3 (Xcode 26.5), Swift 6 language mode, strict concurrency, warnings as errors.

Platform reference: SwiftUI view identity.

The next follow-up: "What should persist across process death?" The answer tells me whether the candidate separates a view's identity-bound state from a durable draft that survives relaunch.

Senior versus Staff: Staff distinguishes transient interaction state, saved draft state and durable domain state, including privacy and storage constraints.

5. Duplicate network requests

Question: "A list loads twice when the user returns to it. How do you debug it?"

Weak answer: "I put the request in onAppear and guard with a boolean."

Strong spoken answer: "I would trace the trigger and separate screen appearance from data freshness policy. A repository should coalesce equivalent in-flight reads where appropriate and expose the freshness decision explicitly, instead of assuming a view callback happens once."

The next follow-up: "What if two accounts request the same endpoint?" I use this to check whether cache keys include account identity and avoid sharing data across authorisation boundaries.

Senior versus Staff: Staff forces cache and request keys to include identity and authorisation boundaries.

6. The offline write contract

Question: "The user edits a note without connectivity. What appears on screen?"

Weak answer: "I show a spinner until the server is back."

Strong spoken answer: "If offline editing is required, I would commit the change to a local source of truth and mark sync state separately. I would persist an operation identifier for the retry queue and define how a conflict is presented before claiming the edit is saved remotely."

The next follow-up: "What if another device edited the same note?" This reveals whether the candidate can negotiate a conflict policy across devices instead of silently overwriting edits.

Senior versus Staff: Staff establishes product conflict policy and consistency expectations with backend owners, not only a client database schema.

7. Pagination without duplicates

Question: "A feed has gaps and duplicates while scrolling. What is your first fix?"

Weak answer: "I increase page size."

Strong spoken answer: "I would check cursor semantics, stable item identity and merge rules. I would record a reproducible sequence of pages, deduplicate by server identity and choose a consistent ordering contract with the service. Offset pagination under concurrent inserts can be unstable."

The next follow-up: "What happens when an item is deleted between page requests?" I am testing whether the pagination contract handles a moving collection, including tombstones and cursor continuity.

Senior versus Staff: Staff aligns API and client teams on cursor validity and an observable consistency model.

8. Dependency injection and tests

Question: "How do you test a feature that depends on networking and persistence?"

Weak answer: "I mock everything and assert that the view model calls methods."

Strong spoken answer: "I would inject interfaces at meaningful boundaries and test observable behaviour. A deterministic repository fake can simulate stale data, offline writes and delayed responses. I would retain integration tests for actual persistence and encoding contracts."

The next follow-up: "Which failures must stay in integration tests?" This shows whether the candidate can identify the risks that a mocked dependency cannot reproduce, such as actual persistence and transport.

Senior versus Staff: Staff manages test cost and confidence across teams and checks whether the contract is tested once at the right boundary.

9. Secure token handling

Question: "Where should an iOS app keep a refresh token?"

Weak answer: "I store it in UserDefaults because it is local."

Strong spoken answer: "I would treat it as credential material, use the platform credential storage facilities and minimise its lifetime and exposure. I would define logout semantics, device-restoration behaviour and server invalidation, not rely on storage alone to secure a session."

The next follow-up: "What happens when the device is compromised?" This probes the boundary of client-side guarantees and whether the candidate avoids promising security after full device compromise.

Senior versus Staff: Staff models threats and fallback controls, including short-lived credentials and backend detection.

10. Image memory in scrolling

Question: "Scrolling a large gallery causes the app to be terminated. How do you proceed?"

Weak answer: "I increase the cache so images stop downloading."

Strong spoken answer: "I would capture peak memory, distinguish compressed bytes from decoded image cost, inspect cell reuse and downsample images for display size. I would bound resident work and test under memory pressure on a representative device."

The next follow-up: "How do you choose a cache budget?" I want a measurable memory budget, a response to memory warnings and a test on constrained devices.

Senior versus Staff: Staff connects memory budgets to device classes, product needs and production telemetry.

11. Task ordering and stale search

Question: "Typing quickly shows results for an older search term. What is happening?"

Weak answer: "I debounce the input."

Strong spoken answer: "I would assign each search a request generation or equivalent identity, cancel obsolete work and discard responses that no longer match the active query. Debouncing reduces traffic, but it cannot guarantee response ordering."

Platform reference: Task cancellation semantics.

The next follow-up: "What if cancellation does not reach the server?" This reveals whether the candidate understands request ordering even when transport cancellation fails or arrives too late.

Senior versus Staff: Staff distinguishes UI correctness from resource efficiency and sets acceptable backend load.

12. Schema migrations

Question: "The new app version changes local storage. How do you release safely?"

Weak answer: "I add a migration and ship it."

Strong spoken answer: "I would test upgrades from supported on-device schemas using real representative fixtures. I would measure migration duration, preserve critical user data and plan recovery when storage is full or the process is interrupted."

The next follow-up: "Can you roll back after a destructive migration?" This tests whether the migration strategy protects old on-disk data when a rollback cannot reverse a destructive change.

Senior versus Staff: Staff treats backward compatibility and phased rollout as a release contract, not a local implementation detail.

13. Push notifications and truth

Question: "A push notification says an order shipped, but the app shows pending. Which wins?"

Weak answer: "The push is the newest information."

Strong spoken answer: "I would treat the notification as a hint to fetch or reconcile authoritative order state. Delivery may be delayed or duplicated, and notification ordering is not a business consistency protocol. The app should explain stale information without inventing an order transition."

The next follow-up: "What happens offline when users tap the push?" I am looking for a route that opens safely from cached state and explains when the notification payload has become stale.

Senior versus Staff: Staff defines end-to-end event semantics and a supportable incident trail across client and service.

14. Feature flags and rollback

Question: "A new checkout flow crashes for one device segment. What is your rollback?"

Weak answer: "I remove the feature and submit a hotfix."

Strong spoken answer: "I would use a remotely controlled exposure gate where appropriate, monitor the release by cohort and stop rollout when agreed thresholds trigger. A kill switch can disable new entry, but data mutations already made may need a separate recovery strategy."

The next follow-up: "Can the old client still read data written by the new flow?" This exposes whether old and new clients can coexist after a flag is disabled, particularly when their persisted formats differ.

Senior versus Staff: Staff owns compatibility, reversibility and incident communication across rollout stages.

15. Explaining a trade-off

Question: "Would you choose UIKit or SwiftUI for a new critical screen?"

Weak answer: "SwiftUI is modern, so it is always better."

Strong spoken answer: "I would start with the screen requirements, deployment baseline, accessibility, lifecycle and performance constraints. I would prototype the riskiest interaction and keep interoperability available if a platform component does not meet the need. The choice needs a measurable exit criterion."

The next follow-up: "What finding would make you reverse your choice?" I ask for the threshold that would overturn the recommendation, rather than a list of trade-offs with no decision.

Senior versus Staff: Staff considers staffing, long-term migration and the cost imposed on adjacent teams.

The five-minute failure drill

Choose one of the fifteen questions. Draw three columns: event order, invariant, observation. In the first column write exactly when work suspends, when identity changes, or when the process dies. In the second write the rule the product must preserve. In the third name a test or metric that would expose the violation. Then change one constraint: make the network reply late, insert an older app version, or remove background execution. You should be able to explain the cost of your revised decision in plain language.

How to practise without memorising

Pick three scenarios with different failure boundaries. For each, say the user promise, the broken invariant, the smallest safe intervention, the measurement that confirms the fix and the condition that would reverse your decision. Then invite a changed constraint.

A stable view identity may solve a problem that another state framework would merely hide. A feature flag may stop further damage without repairing persisted records. I score whether you know where your choice stops helping.

If you are unsure, say what you would test and which result would change your answer.

Related interview guides

The shorter list is the 5 follow-ups that decide a senior iOS loop. The design round has its own worked answer in the iOS system design interview, and the Android version of this page is senior Android developer interview questions and answers.

Questions engineers ask about senior iOS interview questions

What do senior iOS interviewers actually look for?

A precise invariant, an execution order that breaks it, the smallest correction, and a test that would fail before the fix. The API name is rarely the end of the answer, so the follow-up is where the score is decided.

How should I practise these 15 scenarios?

Pick three scenarios with different failure boundaries. For each, say the user promise, the broken invariant, the smallest safe intervention, the measurement that confirms the fix and the condition that would reverse your decision. Then invite a changed constraint.

Is putting shared state in an actor enough?

No. An actor serialises access between suspension points, but another call can run while the first one awaits. Move the claim before the first await or check the invariant again after it, and remember that a client actor is not a distributed lock when the server owns the data.

The iOS Interview Blueprint gives the textbook, the senior and the Staff+ answer to the questions behind this, side by side.

Share this essay