IOS Developer
200+ IOS Developer Interview Questions and Answers
Asked in Movius Corp

Q. What will be the output of the following Swift code: \n\nstruct s1Struct {\n var abc = "Hello"\n \n func change() {\n abc = "bye"\n }\n}\n\nvar a = s1Struct()\na.change()\nprint(a.abc)
The output will be 'bye'.
The code defines a struct 's1Struct' with a property 'abc' initialized to 'Hello'.
It also has a method 'change()' that changes the value of 'abc' to 'bye'.
An instance 'a' of 's1Struct' is created and its 'change()' method is called.
Finally, the value of 'abc' in the instance 'a' is printed, which will be 'bye'.

Asked in Apporio Infolabs

Q. 1 - MVC PATTERN 2- CLOUSERS & it's type 3- Google SDK like Google maps 3- How u manage the constraints of any label , stick at every corner & center of view controller, when getting data from json.
Questions related to iOS development, including MVC pattern, closures, Google SDK, and managing constraints for labels.
MVC pattern is a design pattern used in iOS development to separate the application logic into three components: model, view, and controller.
Closures are self-contained blocks of functionality that can be passed around and used in code. Types include escaping and non-escaping closures.
Google SDKs like Google Maps provide pre-built functionality for developers...read more
IOS Developer Interview Questions and Answers for Freshers
Asked in Movius Corp

Q. What is the difference between the Liskov Substitution Principle and the Interface Segregation Principle?
Liskov Substitution Principle focuses on inheritance while Interface Segregation Principle focuses on interfaces.
Liskov Substitution Principle states that objects of a superclass should be replaceable with objects of its subclasses without affecting the program's correctness.
Interface Segregation Principle states that a client should not be forced to implement interfaces they do not use.
Liskov Substitution Principle is related to inheritance hierarchy, while Interface Segrega...read more
Asked in Movius Corp

Q. What is the time complexity for finding the longest common prefix in a given array of strings?
The time complexity for finding the longest common prefix in an array of strings is O(n*m), where n is the number of strings and m is the length of the longest string.
Iterate through the characters of the first string and compare them with the corresponding characters of the other strings.
The worst-case scenario is when all strings have the same prefix, resulting in O(n*m) time complexity.
Example: For strings ['apple', 'app', 'apricot'], the longest common prefix is 'ap'.

Asked in Cognizant

Q. What is optional, difference between struct and class?
Optional is a type in Swift that can hold a value or be nil. Struct and class are both used to define custom data types.
Optional is denoted by a question mark (?) and is used to handle nil values.
Structs are value types and are passed by value, while classes are reference types and are passed by reference.
Structs have a default memberwise initializer, while classes do not.
Classes can inherit from other classes, while structs cannot.
Examples of optional usage include declaring...read more

Asked in TCS

Q. What is the difference between a class and a structure?
Classes and structures are both used to define custom data types, but they have some key differences.
Classes are reference types, while structures are value types.
Classes support inheritance, while structures do not.
Classes have deinitializers, while structures do not.
Classes have reference counting for memory management, while structures do not.
Classes can have optional property types, while structures cannot.
IOS Developer Jobs




Asked in Codelogicx Technologies

Q. How do you upload/download files or fetch requests for an API?
To upload/download files or fetch requests for API in iOS, you can use URLSession and its related classes.
Use URLSession to create a URLSessionDataTask for making API requests.
For file upload, use URLSessionUploadTask and provide the file URL.
For file download, use URLSessionDownloadTask and specify the destination URL.
Handle the response and errors using completion handlers.
Example: URLSession.shared.dataTask(with: url) { (data, response, error) in ... }
Asked in Movius Corp

Q. What are the benefits of using Structs over Classes in SwiftUI?
Structs are value types, leading to better performance and memory management in SwiftUI.
Structs are value types, meaning they are copied when passed around, leading to better performance compared to reference types like classes.
Structs are immutable by default, making it easier to reason about the state of your app and preventing unexpected changes.
Structs are more lightweight than classes, which can lead to better memory management in SwiftUI applications.
Structs are preferr...read more
Share interview questions and help millions of jobseekers 🌟

Asked in Capgemini

Q. What is closure? Life cycle of escaping closure?
A closure is a self-contained block of code that can be passed around and used in your code. An escaping closure is a closure that is called after the function it was passed to has returned.
Closure is a block of code that can be passed around and used in your code.
Escaping closure is called after the function it was passed to has returned.
Example: Using a completion handler in a network request to handle the response after the request has finished.

Asked in Codelogicx Technologies

Q. How do you integrate Push Notifications in iOS?
To integrate Push Notification in iOS, you need to register for remote notifications, handle the registration token, and implement the necessary delegate methods.
Register for remote notifications using the UIApplication.shared.registerForRemoteNotifications() method.
Implement the AppDelegate's didRegisterForRemoteNotificationsWithDeviceToken method to handle the registration token.
Implement the AppDelegate's didReceiveRemoteNotification method to handle incoming notifications...read more

Asked in Animaker Inc

Q. What is the difference between frame and bounds?
The frame represents the view's position and size in its superview's coordinate system, while the bounds represents the view's position and size in its own coordinate system.
Frame is relative to the superview, bounds is relative to the view itself
Frame includes any transformations applied to the view, bounds does not
Frame's origin is the top-left corner of the view, bounds' origin is always (0,0)
Asked in MULTITV TECH SOLUTION

Q. What is the process for performing matrix multiplication? Please provide a sample program to demonstrate it.
Matrix multiplication involves multiplying rows of the first matrix by columns of the second matrix.
Matrix multiplication is defined for two matrices A (m x n) and B (n x p).
The resulting matrix C will have dimensions (m x p).
Element C[i][j] is calculated as the dot product of the i-th row of A and the j-th column of B.
Example: For A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]], C[0][0] = 1*5 + 2*7 = 19.

Asked in First Due

Q. What are the SOLID principles in software development?
SOLID principles are a set of five design principles in object-oriented programming to make software more maintainable, flexible, and scalable.
Single Responsibility Principle (SRP) - A class should have only one reason to change.
Open/Closed Principle (OCP) - Software entities should be open for extension but closed for modification.
Liskov Substitution Principle (LSP) - Objects of a superclass should be replaceable with objects of its subclasses without affecting the functiona...read more
Asked in Azentech Software Solutions

Q. Describe how to programmatically create views in a view controller and add auto layout constraints programmatically.
Creating views and setting Auto Layout constraints programmatically in a view controller for iOS development.
Initialize the view: let myView = UIView()
Set properties: myView.backgroundColor = .blue
Add the view to the main view: view.addSubview(myView)
Disable autoresizing mask: myView.translatesAutoresizingMaskIntoConstraints = false
Set constraints: NSLayoutConstraint.activate([
myView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
myView.trailingAnchor.c...read more

Asked in Capgemini

Q. What is a retain cycle and how can you avoid it?
Retain cycle is a memory management issue where objects reference each other and cannot be released. It can be avoided by using weak or unowned references.
Retain cycle occurs when two or more objects hold strong references to each other.
To avoid retain cycle, use weak or unowned references instead of strong references.
Weak references do not increase the reference count of an object and automatically become nil when the object is deallocated.
Unowned references are similar to w...read more

Asked in UST

Q. What is the difference between Swift and Objective-C?
Swift is a modern programming language while Objective-C is an older language used for iOS development.
Swift is easier to read and write than Objective-C.
Swift is faster than Objective-C.
Objective-C is still used in legacy codebases.
Swift has a simpler syntax and is more concise.
Swift has better memory management than Objective-C.

Asked in Accenture

Q. What are Access Controls/modifiers? What is the difference between public and open access modifiers?
Access controls/modifiers determine the visibility and accessibility of classes, methods, and properties in object-oriented programming.
public access control allows a class, method, or property to be accessed from anywhere in the code
open access control allows a class to be subclassed outside of the module where it is defined
public is commonly used in Swift for most cases, while open is used when you want to allow subclassing from external modules
Asked in Movius Corp

Q. What is Automatic Reference Counting, and how does it work?
Automatic Reference Counting (ARC) is a memory management feature in iOS development that automatically manages memory by keeping track of references to objects.
ARC automatically adds and removes retain/release calls to manage memory for objects.
It helps prevent memory leaks by deallocating objects when they are no longer needed.
ARC is the default memory management model in Swift and Objective-C.
Example: var myObject = MyObject() // ARC automatically retains myObject
Example: ...read more

Asked in Allegion

Q. What are retain, weak, strong, and atomic properties in Objective-C?
Retain, weak, strong, atomic are property attributes in Objective-C for memory management and thread safety.
Retain: Increases the reference count of an object.
Weak: Does not increase the reference count, used to avoid retain cycles.
Strong: Increases the reference count and keeps the object in memory until all references are removed.
Atomic: Guarantees that the value is always fully retrieved or set in a multi-threaded environment.
Asked in Net Check Solutions (india).

Q. What's the difference between reference types and value types?
Reference types store a reference to the actual data in memory, while value types store the actual data directly.
Reference types are stored on the heap and passed by reference, while value types are stored on the stack and passed by value.
Changing the value of a reference type will affect all references to that object, while changing the value of a value type will not affect other instances.
Examples of reference types in iOS development include classes, while examples of valu...read more

Asked in WayToWeb

Q. What are the causes and consequences of memory leakage in software applications?
Memory leakage occurs when a program fails to release memory, leading to reduced performance and potential crashes.
Improper use of strong references in Swift can prevent deallocation of objects, causing leaks.
Retain cycles occur when two objects hold strong references to each other, preventing memory from being freed.
Example: A view controller holding a strong reference to a delegate that also holds a strong reference back to the controller.
Using global variables or singleton...read more

Asked in Mobikwik

Q. What is the bridge between SwiftUI and UIKit?
The bridge between SwiftUI and UIKit is represented by the UIViewRepresentable and UIViewControllerRepresentable protocols.
UIViewRepresentable and UIViewControllerRepresentable protocols allow SwiftUI views to interact with UIKit views and controllers respectively.
UIViewRepresentable is used to wrap a UIKit view and make it available to SwiftUI.
UIViewControllerRepresentable is used to wrap a UIKit view controller and make it available to SwiftUI.
These protocols enable develop...read more

Asked in Apptunix

Q. How would you ensure secure app development in iOS and Android?
Implementing secure app development involves best practices in coding, data handling, and user authentication for both iOS and Android.
Use HTTPS for all network communications to encrypt data in transit.
Implement strong authentication methods, such as OAuth or biometric authentication.
Regularly update libraries and frameworks to patch known vulnerabilities.
Use secure storage solutions like Keychain on iOS and EncryptedSharedPreferences on Android for sensitive data.
Conduct re...read more

Asked in PhonePe

Q. How do you create a specific mobile screen?
To create a particular mobile screen, you need to design the layout using Interface Builder or programmatically in Swift.
Design the UI layout using Interface Builder in Xcode
Add necessary UI elements like labels, buttons, text fields, etc.
Customize the appearance using constraints, auto layout, and size classes
Implement functionality using Swift code to handle user interactions and data processing

Asked in Tigerspike

Q. Apply the SOLID principles to the given sample code and write Unit Test Cases for it.
Applying SOLID principles improves code maintainability and testability in iOS development.
S - Single Responsibility Principle: Each class should have one reason to change. Example: Separate User and UserManager classes.
O - Open/Closed Principle: Classes should be open for extension but closed for modification. Example: Use protocols for new functionalities.
L - Liskov Substitution Principle: Subtypes must be substitutable for their base types. Example: Ensure subclasses can r...read more

Asked in ChicMic

Q. What is the difference between Realm and Core Data?
Realm is a mobile database that is faster and easier to use than Core Data.
Realm is faster than Core Data in terms of performance.
Realm is easier to use and requires less code for implementation.
Core Data is more suitable for complex data models and relationships.
Realm is cross-platform and can be used for both iOS and Android development.
Core Data is Apple's native framework for data persistence on iOS and macOS.
Asked in Net Check Solutions (india).

Q. What types of property wrappers do you know?
Property wrappers in Swift are used to add extra functionality to properties.
Some types of property wrappers include @State, @Binding, @ObservedObject, @EnvironmentObject, @Published, @FetchRequest, @NSManaged, etc.
Property wrappers help in managing the state of UI components, data flow, and data persistence in iOS apps.
They provide a convenient way to encapsulate common behavior and logic for properties.

Asked in ChicMic

Q. What is the process for uploading an image to Firebase?
The process involves creating a reference to the Firebase storage, uploading the image data, and handling the completion callback.
Create a reference to the Firebase storage using FirebaseStorage instance
Get the reference to the image file using the file path or URI
Upload the image data to the Firebase storage reference using putFile or putData method
Handle the completion callback to get the download URL of the uploaded image

Asked in London Stock Exchange Group

Q. What is the difference between a class and a struct?
Classes are reference types, while structs are value types in Swift.
Classes are reference types, meaning they are passed by reference, while structs are value types, passed by value.
Classes support inheritance, while structs do not.
Classes have deinitializers, while structs do not.
Classes can have reference counting for memory management, while structs do not.
Example: class Person {} vs struct Point {}

Asked in Capgemini

Q. Explain the life cycle of a UIViewController.
The UIViewController life cycle consists of several stages that occur when the view controller is loaded and unloaded.
viewDidLoad() - called when the view controller's view is loaded into memory
viewWillAppear() - called just before the view appears on the screen
viewDidAppear() - called just after the view appears on the screen
viewWillDisappear() - called just before the view disappears from the screen
viewDidDisappear() - called just after the view disappears from the screen
de...read more
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for IOS Developer Related Skills



Reviews
Interviews
Salaries
Users

