Top iOS interview questions for Beginners
Categories: Python
Top iOS interview questions for Beginners
Q1. What is meant by Enumerations or Enum?
Ans. A class type containing a group of related items under the same umbrella, but it is impossible to create an instance of it.
Q2. What do you understand by Memento Pattern?
Ans. A design pattern in which you can save stuff somewhere. This externalized state can be later restored without violating encapsulation and maintaining the privacy of data. iOS has specialized implementations of the pattern and uses it as a part of State Restoration.
Q3. What is the lazy property in swift?
Ans. 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.
Q4. What do you know about TVMLKit?
Ans. TVMLKit is the glue between JavaScript, TVML, and the native tvOS application.
Q5. What are the three significant benefits of guard statement?
Ans. The benefits are:
There are no nested if let statements
An early exit out of the function using return or using break
Guard statement safely unwrap optionals.
Q6. What is the difference between ‘bundle ID’ and ‘app ID’?
Ans. 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.
Q7. From where should UIKit classes be used?
Ans. UIKit classes should be used from the application’s main thread only.
Q8. When an app is launched, what are its state transitions like?
Ans. 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.
Q9. What do you understand by iBeacons?
Ans. iBeacon is the technology standard by Apple that allows mobile apps to listen from signs from beacons and react accordingly. This technology allows Mobile Apps to understand their position and deliver hyper-contextual content to users based on their location. The underlying technology is Bluetooth Low Energy.
Q10. List class hierarchy of a UIButton until NSObject.
Ans. NSObject->UIResponder_>UIView->UIControl->UIButton.
Q11. Give the difference between nonatomic and atomic properties. Which is preferred
Ans. Atomic properties always return a fully initialized object. However, it comes at the cost of performance. If there is a property that you know has no risk on initializing value, then set it to nonatomic can gain a bit of performance.
Q12. What is the use of application:willFinishLaunchingWithOptions and application:didFinishLaunchingWithOptions?
Ans. Both of these methods are present in AppDelegate.swift file and are used to add functionality to the App when the App is going to be launched.
Q13. Specify the three rendering options for JSONSerialization.
Ans. The rendering options are:
MutableLeaves: Lead strings in the JSON object graph are created as variable strings’ instances.
Allow fragments: The parser allows top-level objects that are not array or dictionaries’ instances.
MutableContainers: Dictionaries and arrays are not constants but variable objects.
Q14. What is a tuple in swift?
Ans. A temporary container for multiple values is called a tuple. It is a list comma-separated type and is enclosed in parentheses.
Q15. What is meant by QOS in app development?
Ans. QOS stands for Quality of Service.