Introduction
Over the years, I’ve attended and taken part in multiple iOS developer interviews across different companies and roles.
During this journey, I noticed that many interview questions repeat in different forms, while some concepts are tested deeply depending on the experience level.
Based on my past interview experiences and preparation, I’ve listed down a set of iOS interview questions that I believe can help developers who are currently preparing for interviews or planning to switch roles in 2026. Instead of writing lengthy explanations for every topic, I’ve referenced helpful and easy to understand blog posts, documentation, and tutorials so that readers can understand each concept more easily and from different perspectives.
1. Arrays vs Tuples vs sets ?
Explained here
2. NSArray vs Array ?
Array is a struct, therefore it is a value type in Swift. NSArray is an immutable Objective C class, therefore it is a reference type in Swift.
Array (Swift native type) vs NSArray (from Objective-C/Foundation framework) in Swift.
3. What is NS in NSArray ?
The “NS” prefix in NSArray and other Cocoa classes stands for NeXTSTEP. NeXTSTEP was the object-oriented operating system developed by NeXT, a company founded by Steve Jobs after he left Apple. When Apple acquired NeXT, the NeXTSTEP framework, including its core classes like NSArray, NSString, and NSObject, became the foundation for what is now known as Cocoa, the application programming interface (API) for macOS and iOS.
4. Lifecycle of a ViewController in swift?
Explained here
5. Explain App lifecycle?
Not Running — Either the application has not started yet or was running and has been terminated by the system.
Inactive — An application is running in the Foreground but is not receiving any events. This could happen in case a Call or Message is received. An application could also stay in this state while in transition to a different state. In this State, we can not interact with the app’s UI.
Active — An application is running in the Foreground and receiving the events. This is the normal mode for the Foreground apps. The only way to go to or from the Active state is through the Inactive state. The user normally interacts with the UI, and can see the response/result for user actions.
Background — An application is running in the background and executing the code. Freshly launching apps directly enter into In-Active state and then to Active state. Apps that are suspended, will come back to this background state, and then transition to In-Active → Active states. In addition, an application being launched directly into the background enters this state instead of the inactive state.
Suspended — An application is in the background but is not executing the code. The system moves the application to this state automatically and does not notify. In case of low memory, the system may purge suspended applications without notice to make free space for the foreground application. Usually after 5 seconds spent in the background, apps will transition to Suspend state, but we can extend the time if the app needs it.
6. Methods vs Func ?
Function is a block of code, it performs a specific task itself. We call it when we need to do that specific task. While method is associated with Class, struct or enum.
Refer for more
7. What is type method vs instance method?
Type methods or class methods can be invoked by class name without creating instances while instance methods need an instance to invoke. For the type method there’ll be a static or class keyword while creating the function.
8. Then, what is the difference between static vs class keywords ?
Both static and class keywords are used to create type methods. Using class keywords we can override the type methods in subclass which is not possible if we are using static keywords to create type methods. So in structure and enum we can use only static keywords to create type methods (since both won’t support inheritance).
9. What is the latest in Swift 6 ?
Swift everywhere: Now swift works with Apple, Linux and windows
Swift Testing: Swift Testing is a new testing framework written in Swift, replacing the older XCTesting framework. It leverages macros for a more Swift-like syntax and introduces features such as type-safe tagging of tests and parameterized tests.
Improvement in swift build process
Language improvements
Swift Assistance: Swift Assist is a ChatGPT-like feature integrated into Xcode. It allows you to write prompts to generate code directly in the editor. This AI is trained specifically on Apple code, making it more knowledgeable about Apple APIs. Swift Assist can handle complex use cases, making it a powerful tool for developers.
Predictive code completion: Xcode now features predictive code completion, similar to GitHub Copilot. The AI suggests code completions and even full function implementations based on your initial input. This feature requires Xcode 16, macOS Sequoia, and an Apple Silicon chip with at least 16GB of memory.
10. Explain Access Specifiers in Swift?
Explained here
11. Difference between open and public access specifier ?
Open Keyword − It can be accessed by any module, it is overridable and it allows subclassing.
Public Keyword − Any module can access it, but it is not overridable and it doesn’t allow subclassing at all.
Example: Real life scenario
If you create a design system library for your company:
open class BaseButton: UIButton {
open func setupAppearance() {
// default styling
}
}By making the class open, other teams can subclass and override setupAppearance() to add product-specific branding.
12. What is the Inout parameter ?
Explained here
13. Stored property vs Computed property ?
Stored properties store constant and variable values as part of an instance, whereas computed properties calculate (rather than store) a value. Computed properties are provided by classes, structures, and enumerations. Stored properties are provided only by classes and structures.
struct Content {
var name: String
let fileExtension: String
var filename: String {
return name + "." + fileExtension
}
}
let content = Content(name: "iostutor-banner", fileExtension: "png")
print(content.filename)14. OOPS concept in swift
Solution
15. Run time polymorphism vs compile time polymorphism?
Solution
16. Methods vs Func ?
Function is a block of code, it performs a specific task itself. We call it when we need to do that specific task. While method is associated with Class, struct or enum.
17. Class vs Struct and when to use each?
- Classes are reference types (storing addresses) while structures are value types (storing values).
- Classes have deinit() while structures does not have
- Structures have default designated initialisers (memberswise initialiser) while classes does not have
- Classes support inheritance(not multiple inheritance) structures not
- Structures are stored in stack (that’s why structure is faster) while classes are stored in heap memory
When to Use - Use classes when you need Objective-C interoperability.
- Use struct for data models (User, Product, Config) that should be copied safely.
- Use a class for manager classes, controllers, or UI elements where you need shared state, inheritance, or lifecycle management.
18. Raw value vs Associated value ?
Explanation here
19. Dependency injection and types ?
Dependency Injection is often used with the intention of writing code that is loosely coupled, and thus, easier to test. When we use dependency injection in our code, we are essentially giving an object its instance variables. What this means is that instead of giving our object the responsibility of creating its own dependencies, we inject the dependencies to the object instead.
Types of DI are:
- Property injection
- Constructor injection
- Method injection
Read for more..
20. What is a mutating function ?
Explanation here
21. UInt vs Int ?
Int: It has a range or capacity distribution between positive and negative values.
UInt: The range is limited to positive values, so the values can be twice as large as an Int.
The letter “U” accompanying Int indicates that the value is unsigned.
22. Optional chaining vs optional binding
Explanation here
23. Guard let vs if let
Explanation here
24, Appdelegate vs SceneDelegate
- From iOS 13, the responsibilities of AppDelegate have been split between AppDelegate and SceneDelegate.
- This is the result of a new multi-window support feature that is introduced with iPad-OS.
- The UIScene API allows us to create multiple instances of our app’s UI as separate instances in the application switcher.
25. Is struct thread safe ?
Yes, structs in Swift are thread-safe because they are value types that are copied when passed around in code, and they don’t use reference counting. This means that structs are unique copies that can only be managed by one thread at a time, which prevents them from being accessed by multiple threads simultaneously. This can help prevent difficult-to-track bugs that can occur when multiple threads access an object at the same time.
26. What is a podlock file for?
A Podfile.lock file in Swift is a snapshot of the pods installed in an iOS project. It’s generated after the first run of the command pod install and is updated when pod install or pod update are run. The file tracks the version of each pod that was installed and locks those versions.
27. What is size class ?
Explanation here
28. What is Lazy var in swift ?
In Swift, a lazy var is a property whose initial value is not calculated until the first time it is used. Essentially, it’s a form of lazy initialization, a programming pattern that defers object creation, calculation, or some expensive process until it’s needed
It is used when:
a. When the property’s initial value is computationally expensive to calculate.
b. When the property’s initial value depends on factors that may not be known until after the object’s initialization.
c. When the property’s initial value is likely not to be needed.
lazy var profileImage: UIImage = {
// Some expensive operation
return UIImage(named: "userProfile")!
}()29. What is the final keyword ?final class
Prevents the class from being subclassed.final func / final var / final subscript
Prevents the method or property from being overridden in a subclass.
Usage:
a. Utility or Singleton classes (final class Logger)
b. Preventing sensitive logic from being overridden
c. Optimizing model or service classes that don’t need inheritance
more reading..
30. What are higher order functions
Sorted(), Map(), CompactMap(), Filter(), Reduce()
31. What is Closures in swift
Closures explained
32. @escaping & @non escaping in closure
An escaping closure is a closure that can outlive (escape) the scope where it was being used, that is, it can be called even after the function body is executed.
On the other hand, a non-escaping closure goes out of the scope and stops existing in memory as soon as the function body gets executed. nonescaping is the default closure.
For asynchronous behavior, we use Escaping closures. These can be used when you want a closure to be executed after the current function has finished its execution, making them suitable for scenarios like network requests or animations.
Non-escaping closures are suitable for synchronous operations, and their execution is guaranteed to occur within the function’s scope. This makes them ideal when the result of a closure is required to perform further operations, such as fetching records from local databases to manage pagination.
33. What is autoclosure?
Blog content One
Blog content Two
34. Trailing closure ?
Explained here
35. What is a capture list ?
In Swift, a capture list is used in a closure to control how values are captured (stored) from the surrounding scope — especially to avoid strong reference cycles.
Simple example 👇
class MyClass {
var name = "Swift"
func printName() {
// closure capturing self strongly (can cause memory leak)
someAsyncTask {
print(self.name)
}
// ✅ capture list: captures self weakly to avoid retain cycle
someAsyncTask { [weak self] in
print(self?.name ?? "No name")
}
}
}
🧠 In short: A capture list ([weak self] or [unowned self]) tells the closure how to hold onto variables from outside — weakly, unowned, or strongly — to manage memory safely.
36. What is codable ?
Codable is the combined protocol of Swift’s Decodable and Encodable protocols. Together they provide standard methods of decoding data for custom types and encoding data to be saved or transferred.
37. UUID vs UDID ?
UUID (Universally Unique IDentifier) Is on a per-app basis. identifies an app on a device. As long as the user doesn’t completely delete the app, then this identifier will persist between app launches, and at least let you identify the same user using a particular app on a device. Unfortunately, if the user completely deletes and then reinstalls the app then the ID will change.
UDID (Unique Device Identifier) A sequence of 40 hexadecimal characters that uniquely identify an ios device. This value can be retrieved through iTunes, or found using UIDevice -uniqueIdentifier. Derived from hardware details like MAC address. (It is no more using in ios and NOT RECOMMENDED, because it is deprecated )
38. == vs === in swift ?
1. ==
Compares the value of variables
2. ===
Use case: Compares object identity (are they the same instance in memory? ).
Works only for: Class instances (reference types).
What it checks: Whether two references point to the exact same object.
39. Any vs Any object ?
Here’s what the official Swift documentation says: Any can represent an instance of any type. AnyObject can represent an instance of any class type.
Watch youtube video..
40. What is IBInspectable & IBDesignable ?
a. With only @IBInspectable: You’ll see cornerRadius in the inspector, but rounded corners may not render in the storyboard.
b. With @IBDesignable + @IBInspectable: You’ll see the rounded corners live while editing.
For further reading..
41. What is Abi stability ?
It provides binary compatibility for apps: a guarantee that going forward, an app built with one version of the Swift compiler will be able to talk to a library built with another version.
For further reading..
42. URLSession and types?
- Default Session
Uses a persistent disk-based cache, cookies, and credentials.
Good for standard network requests where you want caching and cookies (like web APIs).
Example: Normal API calls in most apps. - Ephemeral Session
No data is stored to disk (no cookies, cache, or credentials saved).
Everything is kept in memory and gone once the session is invalidated.
Good for private browsing or short-lived requests.
Example: Logging into a bank app where you don’t want cookies/caches stored. - Background Session
Transfers continue even if the app is suspended or terminated (system handles it).
Runs uploads/downloads reliably in background.
Good for large file transfers (media, backup, sync).
Example: Uploading photos/videos to iCloud/Google Drive.
🔑 Important Notes to Remember
Delegates: Background sessions require a delegate for progress/callbacks.
App Lifecycle: Background tasks may relaunch the app if needed.
Configuration: Created via URLSessionConfiguration.default, .ephemeral, .background(withIdentifier:).
Power Management: iOS schedules background transfers intelligently to save battery.
Security: Ephemeral is best if you don’t want sensitive info persisted.
43. What is assert in iOS ?
In iOS (Swift), an assertion is a debugging tool used to check a condition during development. If the condition is false, the app crashes with an error message, helping you catch bugs early in development — but they do not run in production builds.
let age = -1
assert(age >= 0, "Age cannot be negative")If age is less than 0, the app will crash in debug mode with:
Assertion failed: Age cannot be negative
44. Compression resistance priority and Content hugging priority ?
Compression resistance priority – Youtube
Content hugging priority – Youtube
45. What is the swift stride function ?
Stride() is a generic function confirming Stridable protocol,which lets you move from one value to another using any increment and even lets you specify whether the upper bound is exclusive or inclusive.
Fore further reading..
46. Self VS selfself → refers to the current instance
You use self when you are inside an object (like inside a class, struct, or enum), and you want to refer to that particular object.
class Car {
var color: String
init(color: String) {
self.color = color // refers to the property of this Car
}
func start() {
print("\(self.color) car started")
}
}👉 Here self means “this particular car object.”
Self → refers to the type itself
You use Self (capital S) when you mean the type (class/struct/protocol) itself, not an instance.
class Car {
var color: String
init(color: String) {
self.color = color
}
static func createDefault() -> Self {
return Self(color: "Blue") // means Car(color: "Blue")
}
}Here Self = the type Car.
47. What is the Variadic parameter?
In Swift, variadic parameters are the special type of parameters available in the function. It is used to accept zero or more values of the same type in the function. It is also used when the input value of the parameter is varied at the time when the function is called.
For further reading..
48. What is a safe area?
The safe area is 44pt from the top and 34pt from the bottom in portrait mode on new iPhone devices, treating them as the edge of the screen in your design.
For further reading..
49. Designated initializer vs convenience initializers?
Stack Overflow Answer
50. Generics in swift ?
Generics are one of the most powerful features of Swift. They are used to create flexible, reusable functions and types that can work with any type, subject to the requirements you define.
Generics API Call Example
51. Float vs Double vs CGFloat
Explained here
52. whats wrong with the below code:
var body: some View {
VStack {
ForEach(1...5) { i in
Text("i is \(i)")
}
Spacer()
}
}53. What is a storyboard reference ?
In iOS development with Xcode, a Storyboard Reference is a feature that allows developers to connect and navigate between different storyboards within an application. Instead of having a single, potentially large and complex storyboard, developers can break down the user interface into multiple, smaller, and more manageable storyboards.
54. Is a singleton pattern possible with struct ?
With struct singleton the developer can create multiple copies in memory.
State management is not possible with struct singleton.
Rule: Always use classes for singleton because only one instance in memory is present always and no duplicate copies are created.
State management is possible and easy with class singleton.
Watch for more..
55. Universal link VS Deeplink ?
Explained here
56. BLE technology in iOS ?
Explained here
57. Lessons to build an iOS SDK
Explained here
58. What is Method Swizzling ?
Explained here
59. Websocket connection and usage in iOS ?
Explained here
60. What is Hashing and how does it work in iOS ?
Explained here
61. Architectural pattern vs design pattern ?
Design Patterns:
Design Patterns are well known patterns for solving technical problems in a way that has proven itself many times. Design patterns are common design structures and practices that make for creating reusable Object-Oriented software. Design pattern examples are Factory Pattern, Singleton, Facade, State, etc. Design patterns can be used to solve smaller problems throughout the application, and are much easier to inject, change, add than the overall architecture.
Architecture patterns:
Architecture patterns are well known patterns for solving software application architecture problems. Software application architecture is the process of defining a structured solution that meets all of the technical and operational requirements. Application architecture is the overall ‘organization’ of the code. Examples of different Architectures might be MVC, MVVM, MVP, VIPER etc. The architecture typically needs to be decided up front and often is difficult to change once the application is built.
62. Understand Swift memory management
1. Memory management in swift?
2. Difference between strong and weak ?
3. What is the retain cycle?
4. Weak vs unowned ?
Link 1 – Memory management in Swift – Explained with 5 episodes
Link 2 – Explanation on Retain cycle
63. Protocol Oriented Programming (POP) in Swift ?
1. What is protocol ?
2. What is Protocol extension and usage?
3. What is an Associated type of protocol ?
Link 1 – POP explained
Link 2 – Associated type explained
64. Grand Central Dispatch (GCD) in Swift ?
1. GCD and types ?
2. DispatchGroup ?
3. Semaphore vs DispatchGroup ?
Link 1 – Multithreading using GCD for beginners
Link 2 – GCD and dispatch queues
Link 3 – Dispatch group vs semaphore
65. SOLID Principle
1. Reading content one
2. Reading content two
3. Watch and learn one
4. Watch and learn two
66. What is Functional programming?
1. Functional programming explain one
2. Functional programming explain Two
67. Right to Left UI flipping explanation (Eng to Arabic)
Watch here
68. Learn CoreData basics
Link 1 – CodeWithChris Playback library
Link 1 – Core data vs realm vs sqlite
Link 1 – Core Data Interview Questions: Quick Guide
Conclusion
This list is not final. I’ll continue to update and improve this content gradually by adding more questions, references, and practical insights based on newer interview trends and my ongoing learning.
If you find this useful and would like a PDF version of these interview questions for offline reference, please leave a comment and let me know. I’ll be happy to share it.
Related : iOS Interview Questions 2025
