25 Swift interview questions
Structure a Swift interview loop around the work the engineer will actually do. Start with a 30-minute screen on recent iOS/macOS projects, ownership, and how they debug production issues. Follow with a Swift coding exercise that uses real language features: async/await, error handling, value semantics, and testability. Add a platform round focused on SwiftUI/UIKit, app lifecycle, persistence, networking, and performance tools in Xcode 26 and Instruments. For mid-level and above, include an architecture round covering modularization, concurrency boundaries, and release safety. Close with a collaboration round: code review habits, product trade-offs, accessibility, and how they communicate with design, backend, and QA.
Junior Swift questions
Fundamentals, learning speed and how they debug.
01Tell me about a bug you fixed in a Swift app where the root cause was not obvious. How did you narrow it down?
Listen for: A strong answer shows a structured debugging path: reproduce, isolate inputs, inspect logs, use breakpoints, read stack traces, and verify the fix with a test or manual scenario. They should mention Xcode tools such as the debugger, View Debugger, Instruments, or Console rather than only guessing or rewriting code.
Red flag: They cannot explain how they confirmed the cause or whether the fix worked.
02When would you choose a struct over a class in Swift, and when would a class still be the better choice?
Listen for: Look for practical reasoning around value semantics, mutation, copying, identity, reference sharing, and thread safety. A good junior should know structs are common for models and view state, while classes fit shared mutable objects, delegates, Objective-C interop, and identity-heavy APIs. They should avoid treating one as always superior.
Red flag: They answer with memorized definitions but cannot connect the choice to bugs or maintainability.
03You call an API from a SwiftUI screen. How would you handle loading, success, empty, and error states?
Listen for: Listen for a simple state model, not scattered booleans. Good answers mention an enum or typed view state, async/await in a view model or observable model, main-actor UI updates, cancellation when the view disappears, retry behavior, and user-friendly errors. They should keep networking separate from view layout.
Red flag: They put all networking directly in the View body and rely on print statements for errors.
04How do you decide between force unwrapping, optional binding, guard let, and throwing an error?
Listen for: A strong answer treats force unwrap as rare and justified only when an invariant is guaranteed and failure should surface during development. They should use guard for required preconditions, optional binding for conditional paths, and throwing or result-based APIs when callers can recover. Listen for clarity around user input and remote data.
Red flag: They say force unwrap is fine if the app has not crashed in testing.
05What makes a SwiftUI view difficult to maintain, and how would you improve it?
Listen for: Good signals include separating rendering from business logic, extracting smaller views only when it improves clarity, using focused state, avoiding duplicated modifiers, and moving side effects out of body. They should understand property wrappers such as @State, @Binding, @Observable, and @Environment at a practical level.
Red flag: They think every large view should be split by line count without considering state ownership.
06How would you write tests for a small Swift feature that formats account balances from an API response?
Listen for: Listen for tests around normal cases, rounding, nil or missing fields, locale or currency behavior, and invalid server values. Strong juniors separate formatting logic from UI so it can be unit tested, name tests clearly, and avoid depending on live APIs. Snapshot tests may be useful but should not be the only coverage.
Red flag: They only test the happy path by tapping through the app manually.
Mid-level Swift questions
Independent delivery, trade-offs and code quality.
07A SwiftUI screen starts two async tasks when it appears. Users report stale data after navigating quickly between screens. How would you investigate and fix it?
Listen for: A strong answer discusses task cancellation, view identity, task(id:), MainActor isolation, and preventing older responses from overwriting newer state. They should inspect lifecycle events and logs, reproduce with slow network conditions, and consider moving ownership to a model with explicit cancellation rather than relying on timing.
Red flag: They add arbitrary delays or dispatch back to the main queue without understanding task lifetimes.
08Design a networking layer for a Swift app that talks to several backend services. What decisions matter?
Listen for: Look for clear boundaries: endpoint modeling, URLSession configuration, authentication, retries, decoding strategy, error taxonomy, cancellation, and test injection. Good candidates avoid over-engineering but know where abstractions help. They should discuss observability, redaction of sensitive data, and how to support async/await cleanly without hiding useful HTTP details.
Red flag: They propose a single global client with string URLs everywhere and no test strategy.
09How would you migrate a Combine-heavy feature to async/await without breaking behavior?
Listen for: Strong answers identify publisher semantics first: backpressure, debouncing, sharing, cancellation, scheduler behavior, and error handling. They may use AsyncSequence bridges where appropriate, keep Combine for UI/event streams when it fits, and migrate incrementally behind protocols. They should add tests around ordering and cancellation before refactoring.
Red flag: They claim async/await always replaces Combine with a simple mechanical rewrite.
10An app’s launch time regressed after a feature release. What would you measure and change?
Listen for: Listen for Instruments, signposts, cold versus warm launch, dyld and static initialization, main-thread work, dependency setup, disk I/O, remote config, and synchronous keychain or database access. Good candidates propose moving noncritical work after first render while keeping correctness, and they verify improvement with repeatable measurements.
Red flag: They immediately blame SwiftUI or the backend without profiling.
11How do you organize a medium-size Swift codebase so teams can work independently?
Listen for: A strong mid-level answer covers Swift Package Manager modules, feature boundaries, shared design system or core utilities, dependency direction, and avoiding a large catch-all module. They should consider build times, preview/test targets, access control, and ownership. They should also know that too many modules create coordination overhead.
Red flag: They suggest either one giant app target or a module for every file with no trade-off discussion.
12A product manager asks for local caching so the app works during poor connectivity. What questions do you ask before implementing?
Listen for: Good answers clarify freshness, conflict behavior, data sensitivity, storage size, authentication changes, offline actions, sync triggers, and user messaging. They should compare URLCache, file storage, SQLite/Core Data/SwiftData, and keychain where relevant. Listen for awareness that cache invalidation and migration are product decisions as much as technical ones.
Red flag: They choose a persistence framework before understanding the data and consistency requirements.
13How would you review a pull request that introduces a new SwiftUI feature with several view models and services?
Listen for: Look for review focus beyond style: state ownership, actor isolation, dependency injection, error handling, accessibility labels, localization, test coverage, and whether abstractions match current needs. A good answer balances correctness with delivery, asks clarifying questions, and explains when they would request changes versus leave suggestions.
Red flag: They mainly comment on formatting and personal preferences.
Senior Swift questions
Judgement, architecture and raising the team's bar.
14Your team is enabling Swift 6 strict concurrency checking in a large app. How would you plan the migration?
Listen for: A strong answer starts with inventory and compiler settings, then migrates module by module. Listen for Sendable audits, actor boundaries, @MainActor usage, nonisolated APIs, third-party dependencies, and temporary escape hatches with clear ownership. They should prioritize risky shared mutable state and preserve release flow with tests and CI gates.
Red flag: They suggest adding @MainActor or @unchecked Sendable broadly until the warnings disappear.
15How do you decide whether to use MVVM, The Composable Architecture, coordinators, or a simpler feature structure?
Listen for: Look for context-driven judgment: team familiarity, testability, navigation complexity, state sharing, app size, and onboarding cost. Strong seniors do not sell one architecture universally. They should explain how they keep business logic out of views, prevent dependency sprawl, and evolve architecture through real seams instead of rewrites.
Red flag: They insist their preferred architecture is always correct regardless of product or team constraints.
16A critical crash appears only in production on a small set of devices. What is your response from triage to prevention?
Listen for: Listen for crash symbolication, device/OS segmentation, release version comparison, logs and breadcrumbs, feature flags, rollback or hotfix criteria, and communicating risk. Strong answers include reproducing with realistic data, adding regression tests when possible, and improving observability or guardrails so similar issues are caught earlier.
Red flag: They focus only on fixing the code locally and ignore rollout, communication, and recurrence.
17How would you design authentication and secret handling in a Swift app that uses biometric unlock?
Listen for: A good answer separates authentication tokens, local unlock, and server trust. Listen for keychain access control, Secure Enclave where appropriate, LocalAuthentication, token refresh, logout behavior, device passcode changes, jailbreak/root risk, logging redaction, and not storing secrets in UserDefaults or source. They should involve backend constraints early.
Red flag: They describe Face ID as if it authenticates the user to the server by itself.
18You need to introduce a reusable internal Swift package used by multiple apps. What API design concerns matter?
Listen for: Strong answers cover public surface area, semantic versioning, binary compatibility when relevant, dependency minimization, test fixtures, documentation comments, examples, and clear ownership. They should discuss async APIs, error types, cancellation, access control, and how to avoid leaking app-specific assumptions into the package.
Red flag: They expose implementation types publicly because it is faster for the first consumer.
19How do you mentor engineers through code quality issues without slowing delivery?
Listen for: Look for concrete practices: pairing, focused review comments, shared examples, lightweight design notes, and follow-up refactors tied to product work. Strong seniors distinguish must-fix correctness issues from improvements, explain trade-offs, and create reusable patterns. They should avoid becoming the bottleneck for every Swift decision.
Red flag: They either rewrite others’ code themselves or approve everything to avoid conflict.
20A feature needs background uploads, push notifications, and deep links into SwiftUI navigation. What risks do you plan for?
Listen for: Listen for background URLSession constraints, app lifecycle states, notification authorization, universal links, idempotent routing, authentication gates, and state restoration. Strong answers plan for delivery out of order: upload completes before UI exists, link arrives while logged out, or notification opens stale content. They include testing on real devices.
Red flag: They assume foreground flows and simulator testing cover the feature.
System design Swift questions
Designing real systems end to end.
21Design an offline-first SwiftUI field-service app where users create records, attach photos, and sync when connectivity returns.
Listen for: Strong candidates clarify conflict rules, data ownership, attachment size, retry policy, and user expectations before choosing storage. They should discuss SwiftData/Core Data or SQLite, background transfers, a sync queue, stable local IDs, merge status in UI, and tests for interrupted uploads. Security and migration should be part of the design.
Red flag: They describe a cache but no durable queue, conflict handling, or user-visible sync state.
22Design the architecture for a multi-team iOS app with shared login, design system, analytics, and independent feature delivery.
Listen for: Look for module boundaries with Swift Package Manager, dependency direction, app shell ownership, shared UI components, routing contracts, and CI implications. Strong answers weigh build time, preview reliability, access control, and governance for shared code. They should avoid centralizing all decisions in a core module.
Red flag: They create a massive shared framework that every feature imports and modifies.
23Design a high-performance media feed in Swift that supports video autoplay, image prefetching, and smooth scrolling.
Listen for: A strong design mentions cell/view reuse, prefetch windows, cancellation, memory pressure handling, downsampling images, video session limits, caching layers, and measuring with Instruments. They should coordinate SwiftUI or UIKit rendering with async loading and avoid doing decoding or layout-heavy work on the main thread.
Red flag: They rely on loading full-resolution assets directly in each row as it appears.
24Plan a migration from an Objective-C/UIKit app to modern Swift and SwiftUI while active feature work continues.
Listen for: Strong answers are incremental: identify seams, bridge with Objective-C interoperability, add Swift packages, wrap UIKit where needed, and replace screens based on value and risk. They should discuss testing, navigation integration, design parity, concurrency adoption, and avoiding a stalled big-bang rewrite. Release safety matters as much as code modernization.
Red flag: They propose rewriting the whole app first and pausing product work until it is done.
25Design a Swift SDK consumed by third-party apps for payments or identity verification.
Listen for: Look for API stability, minimal dependencies, clear async APIs, cancellation, error taxonomy, theming boundaries, accessibility, logging redaction, and secure handling of tokens or PII. Strong candidates discuss Swift Package Manager distribution, sample apps, integration tests, versioning, and not assuming the host app’s architecture or lifecycle.
Red flag: They design the SDK as if it controls the entire app environment.
Build a Searchable SwiftUI Repository Browser
Create a small iOS app in Swift that searches a public JSON API or a provided mock repository list, displays results in SwiftUI, and opens a detail screen. Use async/await for loading, model loading/error/empty states explicitly, and add at least a few unit tests around parsing, state transitions, or the repository service. The app should be understandable without external setup beyond Xcode 26 and Swift Package Manager. Candidates may use a lightweight architecture of their choice, but should explain trade-offs in a short README, including cancellation, dependency injection, and what they would improve with more time.
How to evaluate it
- Clear state modeling for loading, success, empty, and failure paths
- Correct use of async/await, cancellation, and main-actor UI updates
- Separation of networking, domain logic, and SwiftUI views without unnecessary abstraction
- Meaningful tests that do not depend on a live network response
- Readable README explaining decisions, trade-offs, and known gaps
Rather skip the interview loop?
Every Octogle Swift engineer has already passed a technical assessment, system design and a live interview with an engineer who has shipped Swift. Send a brief and get 3–5 scored profiles in 48 hours.