Skip to content
tezvyn:

iOS & Swift

SwiftUI, UIKit, Xcode, Swift language, Apple platforms

129 bites

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

Interview questions in iOS & Swift

easy2 min read

What is the difference between let and var in Swift?

This tests value semantics beyond syntax. A strong answer defines let as immutable and var as mutable, notes that let on a reference type only fixes the pointer, and cites clearer intent and compiler optimization.

easy2 min read

What is an optional in Swift? Demonstrate two safe unwrapping methods.

This checks Swift type safety and nil-handling. A strong answer defines Optional as an enum, demonstrates if let binding, and shows the nil-coalescing operator ?? for defaults. Avoid suggesting force-unwrapping with ! as a safe pattern.

easy1 min read

How does Swift's switch differ from C's switch?

Switches must be exhaustive, there is no implicit fallthrough between cases, and cases can match ranges, tuples, and bind values.

intermediate2 min read

Explain the primary differences between a struct and a class in Swift

Tests value versus reference semantics and their impact on memory and mutation. Strong answers note structs copy on assignment and lack inheritance, while classes share heap instances via ARC. Red flag: claiming structs are always stack-allocated.

advanced1 min read

Why can't you subscript a Swift String with an Int?

Characters are extended grapheme clusters of variable byte width, so integer offsets are not O(1) or meaningful; String.Index is an opaque position you advance via the collection.

advanced1 min read

What is @autoclosure and when is it useful?

@autoclosure wraps an argument expression in a closure so it evaluates lazily only if used, enabling clean APIs like assert and the ?? operator.

Swift struct vs class: differences and when to choose each
easy2 min read

Swift struct vs class: differences and when to choose each

Tests value vs reference semantics and let mutability. Strong answers contrast copy behavior with shared references, note allocation tendencies, and choose struct for value semantics or class for identity.

easy2 min read

Explain protocols and how extensions provide default implementations

Tests behavior sharing without inheritance. A strong answer defines protocols as requirements, shows extensions injecting default implementations, and contrasts this with base-class inheritance.

intermediate2 min read

What is a retain cycle in ARC with closures?

It tests reference counting and closure capture semantics. A retain cycle forms when a closure captures self strongly while self holds the closure; break it with weak if self can deallocate, or unowned if it will outlive the closure.

intermediate2 min read

What are Swift generics, why useful, and write a swap function?

This tests parametric polymorphism and type-safe reuse. A strong answer defines generics as placeholder types for reusable code, then writes a swap<T> function using inout parameters. Red flag: confusing generics with Any or omitting inout.

intermediate2 min read

What is a closure capture list? Explain [weak self] versus [unowned self].

Define capture lists, contrast [weak self] safe optionality against [unowned self] crash risk, and match each to lifetime guarantees.

Explain Copy-on-Write in Swift and implement it for custom structs
advanced2 min read

Explain Copy-on-Write in Swift and implement it for custom structs

Tests value semantics with reference storage and uniqueness checks. A strong answer explains CoW delays copy until mutation via isKnownUniquelyReferenced, lists custom steps: wrap, read, check, clone. Red flag: assuming structs are automatically CoW.

advanced2 min read

How does Swift async/await improve on completion handlers?

Tests structured concurrency mastery over callback control flow. A strong answer covers inversion of control, suspension points as yield locations, and Tasks as parent-child units.

Difference between .xcodeproj and .xcworkspace, and when to use a workspace
easy2 min read

Difference between .xcodeproj and .xcworkspace, and when to use a workspace

Tests your mental model of Xcode build containers. A project defines one buildable unit; a workspace groups multiple projects so they build together and share derived data. Use it for package managers or modular codebases.

What LLDB command prints a UIView description versus an Int?
easy2 min read

What LLDB command prints a UIView description versus an Int?

Tests LLDB formatting at breakpoints. Great answers: po invokes description or debugDescription on objects, while p evaluates and prints raw primitive values with type info. Red flag: mixing them up or recommending console print instead of LLDB.

What is an Xcode Scheme? How do you configure a custom one?
intermediate2 min read

What is an Xcode Scheme? How do you configure a custom one?

This tests Xcode build orchestration. A scheme is a blueprint for build, test, run, profile, analyze actions; a strong answer covers duplicating it, setting launch arguments, and staging configs. A red flag is confusing schemes with build configurations.

Explain symbolic breakpoints and debug Auto Layout with one
intermediate2 min read

Explain symbolic breakpoints and debug Auto Layout with one

Tests debugging closed-source frameworks without source lines. A strong answer says a symbolic breakpoint stops on UIViewAlertForUnsatisfiableConstraints, then checks the backtrace or log to find the bad view.

Which Instrument diagnoses scroll stuttering and dropped frames?
intermediate2 min read

Which Instrument diagnoses scroll stuttering and dropped frames?

Tests whether you connect UI jank to Instruments data. A strong answer names the Core Animation or Time Profiler instrument, cites frame duration and hitch ratio, and correlates spikes with main-thread work.

How does Debug Memory Graph find leaks and retain cycles?
advanced2 min read

How does Debug Memory Graph find leaks and retain cycles?

This tests knowledge of Xcode's heap visualization versus allocation sampling. A strong answer notes the graph shows objects, draws retain cycles as loops, and contrasts with Leaks time-based sampling. Red flag: expecting leak flags without inspection.

What build settings improve Time Profiler symbols in Release builds?
advanced2 min read

What build settings improve Time Profiler symbols in Release builds?

This tests debug symbol control in Xcode Release builds. Set DEBUG_INFORMATION_FORMAT to DWARF with dSYM, avoid stripping, citing larger size and slower links. Red flag: suggesting you disable optimizations, invalidating the performance profile.

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