iOS Interview Questions and Answers
Intermediate / 1 to 5 years experienced level questions & answers
Ques 1. What are the methods to achieve concurrency in iOS?
The methods to achieve concurrency are:
- Dispatch queues
- Threads
- Operation Queues
Ques 2. Define Cocoa/Cocoa touch.
It is used for building software codes to run on iOS for the iPad and iPhone. Cocoa Touch is written in the objective-C language and has a different set of graphical control elements to Cocoa.
Ques 3. What is iBeacon?
iBeacon enables mobile apps to listen to signals from beacons in the physical world and respond accordingly. It comprises two parts: a broadcaster and a receiver.
Ques 4. What is Method Swizzling?
The process of changing the implementation of an existing domain, Method Swizzling, enables you to write that code that can be executed before or after the original method.
Ques 5. What is the difference between Viewdidload and Viewdidappear?
Viewdidload:
- It is called when it is loaded into memory.
- Data can be loaded in Viewdidload if it is fairly static and likely to change.
Viewdidappear:
- It is called when the view is visible and presented on the device.
- You can perform any layout functions or draw in the UI.
Ques 6. Which JSON framework is supported by iOS (iPhone OS)?
- SBJson framework is supported by iOS. It is a JSON parser and generator for Objective-C (Objective-C is the primary programming language we use when writing software for OS X and iOS. It is a superset of the C programming language and provides object-oriented capabilities and a dynamic runtime).
- SBJson provides flexible APIs and additional control that makes JSON handling easy.
Ques 7. What is the difference between Synchronous & Asynchronous tasks?
- Synchronous can also be defined as In order. When you perform the synchronous operation, all that follows must wait for the operation to complete before proceeding.
- In contrast, “asynchronous” can also be defined as “out of order.” When you do something asynchronously, you can run the following code right away, and the asynchronous process will happen someday. It could be run on a separate thread from the rest of the code. It could easily be rescheduled on the same thread at a later date and you can notify you when it is done.
Ques 8. What are the different ways to specify the layout of elements in UIView?
Here are a few common ways to specify the layout of elements in UIView:
- Using InterfaceBuilder, we can add a XIB file to our project, layout elements within it, and then load XIB in our application code (either automatically, based on naming conventions, or manually). Also, using InterfaceBuilder, we can create a storyboard for our application.
- We can write our own code to use NSLayoutConstraints and have elements in a view arranged by Auto Layout.
- We can create CGRects describing the exact coordinates for each element and pass them to UIView’s (id)initWithFrame:(CGRect)frame method.
Ques 9. Explain a singleton class.
When only one instance of a class is created in the application, that class is called a singleton class.
Ques 10. Differentiate between a frame and a bound.
A UIView’s bounds are a rectangle with a size (width, height) and position (x,y) relative to its own coordinate system (0,0).
A UIView’s frame is a rectangle with a scale (width, height) and position (x,y) relative to the superview it is located within.
Ques 11. How to Prioritize Usability in Design?
To prioritize usability, the design process has broken down into 4 steps:
- Consider the user’s perspective when designing the user experience.
- Users, not demographics, are what you should focus on.
- Consider all of the scenarios in which an app might be useful when promoting it.
- Even after the app has been released, continue to improve its functionality.
Ques 12. What is meant by Enumerations or Enum?
A class type containing a group of related items under the same umbrella, but it is impossible to create an instance of it.
Ques 13. What is the lazy property in swift?
When the property is called for the first time, an initial value of the lazy stored properties is calculated. In many situations, lazy properties come handy to developers.
Ques 14. What is the difference between 'bundle ID' and 'app ID'?
The bundle ID is specified in Xcode, and it defines each App. A single project can have multiple targets and can output multiple apps. Use: it is branded multiple ways and has both free/lite and full/pro versions.
App ID is used to identify one or more apps from a single development team. It is a two-part string with a period(.) separating Team ID and bundle IF search string. The bundle ID search string is supplied by the developer, while Apple supplies the Team ID.
Ques 15. When an app is launched, what are its state transitions like?
Before launch, an app is not said to be running. After a brief transition through the inactive state, it moves to the background or the active state when it is launched.
Ques 16. What are the essential certificates for issuing and developing apps, either Android or iOS?
The certificate types are:
- Development Certificate
- Distribution Certificate
- Development and Distributing Certificates
Ques 17. What is ‘assign’ in iOS?
In iOS, ‘assign’ is used to create an orientation from one object to the other without raising the retain count of the source object.
Ques 18. Why is 'reuseIdentifier' used in iOS?
The ‘reuseIdentifier’ is used to group all the similar rows from UITableView.
Ques 19. How can you reduce the size of the App?
The three different methods to reduce app size are:
- Bit code
- On-demand Resource
- App Slicing
Ques 20. What is meant by the ‘defer’ keyword?
The 'defer' keyword provides a block of code executed in cases when execution leaves the current scope.
Most helpful rated by users:
- What does KVO stand for?
- Which is the application thread from where UIKit classes should be used?
- What is iOS?
Related differences
Related interview subjects
iOS interview questions and answers - Total 52 questions |
Ionic interview questions and answers - Total 32 questions |
Android interview questions and answers - Total 14 questions |
Mobile Computing interview questions and answers - Total 20 questions |
Xamarin interview questions and answers - Total 31 questions |