Special Offer - Enroll Now and Get 2 Course at ₹25000/- Only Explore Now!

All Courses
iOS Interview Questions and Answers

iOS Interview Questions and Answers

November 21st, 2018

In case you’re searching for iOS Interview Questions and answers for Experienced or Freshers, you are at the correct place. There is parcel of chances from many presumed organizations on the planet. The iOS advertise is relied upon to develop to more than $5 billion by 2021, from just $180 million, as per iOS industry gauges. In this way, despite everything you have the chance to push forward in your vocation in iOS Development. Gangboard offers Advanced iOS Interview Questions and answers that assist you in splitting your iOS interview and procure dream vocation as iOS Developer.

Best iOS Interview Questions and Answers

Do you believe that you have the right stuff to be a section in the advancement of future iOS, the GangBoard is here to control you to sustain your vocation. Various fortune 1000 organizations around the world are utilizing the innovation of iOS to meet the necessities of their customers. iOS is being utilized as a part of numerous businesses.

To have a great development in iOS work, our page furnishes you with nitty-gritty data as iOS prospective employee meeting questions and answers. iOS Interview Questions and answers are prepared by 10+ years experienced industry experts. iOS Interview Questions and answers are very useful to the Fresher or Experienced person who is looking for the new challenging job from the reputed company. Our iOS Questions and answers are very simple and have more examples for your better understanding.

By this iOS Interview Questions and answers, many students are got placed in many reputed companies with high package salary. So utilize our iOS Interview Questions and answers to grow in your career.  

Q1). What is the Output of the Following Program?

class Cricket
{
var score = 100
}
var player1 = Cricket() var player2 = player1 player2.score = 200 print((player1.score),(player2.score))
200,200

Q2). What is the output of the following Program? let numbers = [1, 2, 3, 4]

let numberSum = numbers.reduce(0, { $0 + $1})
10

Q3). Conversion of Error to optional Value is used as a method to handle Errors in Swift (True/False)

True

Q4). Structures can be inherited(True/False)

Flase

Q5). What is the Output of Following Program var randomly Array: [AnyObject] = [1,1.2,”Hello”] print (randomArray)

Compilation Error (1 is an Int not object)

Q6). What is the Output Of Following Program

class FirstClass {
func doFunction() {
print(“I am superclass")
}}
class SecondClass: Firstclass {
override func doFunction() {
print(“I am subclass")
}}
let object = SecondClass()
object.doFunction()
I am subclass

Q7). What is ARC?

Automatic Reference Counting

Q8). What is ARWorld Map?

An ARWorldMap object contains a snapshot of all the spatial mapping information that ARKit uses to locate the user’s device in real-world space.

Q9). How shared AR Experience is Created?

Once the AR world map created from once device is transferred to the other device using P2P connectivity or some other reliable source, the other devices can also have the same AR experience similar to the first device.
To create an ongoing shared AR experience, like placing an AR object, When one user taps in the scene, the app creates an anchor and adds it to the local ARSession, instead of sending the whole map we can serializes that ARAnchor using Data and sends it to other devices in the multipeer session.

Q10). What are the main UITableViewDataSource methods that are needed to display data in table view?

numberOfSection, numberOfRowsInSection, cellForRowAtIndexPath

Q11). What are the two basic things that are needed to create an NSFetchRequest in CoreData?

EntityName, SortDescriptor/NSPredicate

Q12). What are Tuples in Swift?

Tuples are Temporary container for Multiple Values. It is a comma-separated list of types, enclosed in parentheses. In other words, a tuple groups multiple values into a single compound value.

Q13). What are the Control Transfer Statements in swift?

break, continue, fallthrough, return, throw

Q14). What are closures and write an example program for closure?

Closures are self-contained blocks of functionality that can be passed around and used in code.

var addClosure = { (a: Int, b: Int) in
return a + b
}
let result = addClosure(1,2)
print(result)

Q15). Briefly explain reference types and value types with examples?

Classes are reference types and Structures are value types. When a class is assigned to variable and copied only the reference to the original value are passed and so any consecutive changes to the assigned values will also affect the original value.

But in struct when it is assigned to another variable a copy is generated which will not have any effect on the original value when changed.

Q16). What are the features of Swift ?

Variables are always initialized before use.
◦Memory is managed automatically.
◦Arrays and integers are checked for overflow.
◦Switch function can be used instead of using “if” statement.
◦It eliminates the classes that are in unsafe mode.

Q17). What is the significance of “?” in Swift?

The question mark (?) is used during the declaration of a property can make a property optional.

Q18). What Is Initialization ?

This process involves setting an initial value for each stored property on that instance and performing any other setup or it is required before the new instance is ready for use.
e.g.: keyword:

init() {
// code initialization here.
}

Q19). What is NSURL Session?

NSURL Session is a replacement for NSURL Connection, and similarly it is both a distinct class and also a group of related APIs.

Q20). What are the Session Configuration?

NSURL Session Configuration provides a few factory methods to create your session configuration.
The methods are:

  • Default Configuration – provides anccess to the global singleton storage and settings.
  • Ephemeral Session Configuration – a private, in-memory only storage
  • Background Session Configuration – out-of-process configuration that is keyed to the identifier string.

Q21). How to define kSomeConstant  ?

e.g.:let kSomeConstant: Int = 80
It is Implicitly defined as an integer. If you want to be more specific you can specify it like above e.g..

Q22). Define hash value vs raw value ?

HashValue:- If you had the enum as we had declared earlier without the type, there is no rawValue available but instead you get a member called hashValue.
RawValue:-  The rawValue on the other hand is a type value that you can assign to the enum members.

Q23). Define Static Binding and Dynamic Binding?

Static Binding: It is resolved at “Compile time” Method overloading is an example of static binding.
Dynamic Binding: It is virtual binding resolved at a “Run Time”. Method overriding is an example of Dynamic Binding.

Q24). What is Method Overloading?

It defines a method with the same name many times with different arguments. These kind of feature is known as Method Overloading.

Q25). What is Method Overriding?

If we define a method in a class, and we  know that a subclass might need to provide a different version of the method. When a subclass provides a different implementation of the method defined in a superclass, with the same name, arguments and return type, that is called Overriding. The implementation in the subclass overwrites the code provided in the superclass.

Q26). What is QOS?

QOS – Quality of Service
QOS can applied all over iOS as well. One can Prioritize queues, thread objects, dispatch queues and POSIX threads.By assigning the correct priority for the work, iOS apps remain quick, snappy and responsive.

Q27). What is User Interactive?

It works happened on the main thread, Immediately in order to provide a nice user experience. e.g run at while in Drawing and Ui animations.

Q28). What is User Initiated?

It works when the user kicks off and should yield immediate results. It Performs asynchronously that are initiated from the UI  This will get the mapped in to the high Priority Global Queue. This work must be complete for the user to continue.

Q29). What is DeadLock?

A deadlock is a situation where two different programs or processed depend on one another for completion, either because both are using. It is the situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process.

Q30).  Define Run Loop?

Run loop mode is a collection of input sources and times to be monitored and the collection of run loop observes to be notified.

Q31). What is iOS?

iOS (intelligent Operating System) is a mobile operating system created and developed      by Apple Inc. exclusively for its hardware with the help their own creating language called Objective C and Swift

Q32). What is the difference between the cocoa and cocoa Touch?

Cocoa  includes Foundation and AppKit frameworks for developing applications that run on Mac OS X.
Cocoa Touch  includes Foundation  and UI framework for developing applications that run on iPhone ,iPod Touch and iPad.

Q33). What are the different property types?

strong, weak, assign,copy,retain,atomic and non atomic.

Q34). Explain frame and bound of a View in ios?

Bound is the rectangle that relative to its own coordinate system (0,0).
Frame is the rectangle that relative to the superview .

Q35). What are the design patterns in ios?

  • Singleton
  • Delegate
  • Model View Controller
  • Observer
  • Facade
  • Command
  • Template Method

Q31). How to pass data between view controllers

  • Segue, in prepareForSegue method (Forward)
  • Delegate (Backward)
  • Setting variable directly (Forward)

Q36). Types of Dispatch Queues

Serial :execute one task at a time in the sequential order
Concurrent: execute one or more tasks concurrently.
Main dispatch queue: executes tasks on the application’s main thread.

Q37). key value coding(KVC) and key value observing (KVO)

Key-Value-Coding (KVC) : accessing a property or value using a string.
Key-Value-Observing (KVO) : observe changes to a property or value.

Q38). Application life cycle

  • application:willFinishLaunchingWithOptions
  • application:didFinishLaunchingWithOptions
  • applicationDidBecomeActive
  • applicationWillResignActive
  • applicationDidEnterBackground
  • applicationWillEnterForeground
  • applicationWillTerminate

Q39). Different states of application

  • Not running
  • Inactive
  • Active
  • Background
  • Suspended

Q40). View life cycle

  • loadView
  • loadViewIfNeeded
  • viewDidLoad
  • viewWillAppear
  • viewWillLayoutSubviews
  • viewDidLayoutSubviews
  • viewDidAppear
  • viewWillDisappear
  • viewDidDisappear

Q41). whats is delegate  and notification

Delegate: Creates the relationship between the objects. It is one to one communication.
Notification: These are used if an object wants to notify other objects of an event. It is one to multiple communication.

Q42). What is the significance of “?” in Swift?

The question mark (?) is used during the declaration of a property can make a property optional. If the property does not hold a value.

Q43).What are the Levels of Prority in QOS?

  • User Interactive
  • User Initiated
  • Utility
  • Background

Q44). How to write optional value in swift ?

An optional that can hold either a value or no value. Optionals are written by appending a ‘?’

Q45). How to unwrap the optional value in swift ?

The simplest way to unwrap an optional value  is to add a ‘!’ after the optional name. This is called “force unwrapping”.

Q46). Use of if -let statement in swift

By using if- let ,we can unwrap an optional in safe way, otherwise  nil it may crash the app sometimes.

Q47). What is id in Objective C?

id is a type of any data type. It specifies a reference to any Objective-C object .

Q48). What is Categories in Objective C?

Categories provide the ability to add functionality to an object without changing the actual object.

Q49). What is Extension in swift?

Extension add new functionality to an existing class, structure, enumeration, or protocol type. Extensions are similar to categories in Objective-C.

Q50). Define Class methods and instance methods .

An instance method  accessed an instance of the class
A class method accessed to the class itself.

Q51). How to add swift file to the existing Objective C project?

If you add a new swift file to the existing project xcode will ask you to add Objective-C bridging header.

Q52). What is auto layout and why it uses?

Auto Layout is a constraint-based layout system.By using this auto layout developers to create an adaptive interface that responds appropriately to changes in screen size and device orientation.

Q53).How many ways constraints can create programmatically?

Three ways  to creating constraints programmatically :

  •  layout anchors
  •  NSLayoutConstraint class
  •  Visual Format Language.

Q54). Is it possible to create multiple storyboards in single project. If yes how to switch from one storyboard to another?

Yes, By using segue and Storyboard Reference we can  switch from one storyboard to another storyboard.

Q55). What is let and var in swift?

Let is  immutable variable or a  constant that means it cannot changed where as var is mutable variable meaning that it can be changed.

Q56). What is IBOutlet and IBAction in ios ?

Interface Builder outlet(IBOutlet) is a variable which is a reference to a UI component.
Interface Builder action(IBAction) is a function which is called when a specific user interaction occurs.

Q57). What is bundle in ios?

A bundle is a directory in the file system that contains the all executable code and related resources such as images and sounds together in one place.

Q58). when  will use deinit  in swift?

deinit can be used if you need to do some action or cleanup before deallocating the object.

Q59). what is the responsibility of URLSession?

URLSession is responsible for sending and receiving HTTP requests.

Q60). what are the types of URLSessionTask?

  • URLSessionDataTask
  • URLSessionUploadTask
  • URLSessionDownloadTask

Q61). Main difference between NSURLSession and NSURLConnection

NSURLConnection:
when our App goes to background mode or  not running  mode  using  NSURLConnection, everything we have received or sent were lost.

NSURLSession: NSURLSession gives your app the ability to perform background downloads when your app is not running or app is suspended.

Q62). what is JSON?

JSON ( JavaScript Object Notation) is a text-based, lightweight and easy way for storing and exchanging data.

Q63). what is JSONSerialization ?

The  built in way of parsing JSON is called JSONSerialization and it can convert a JSON string into a collection of dictionaries, arrays, strings and numbers .

Q64). Difference between core  data and sqlite?

Core Data is a framework that can be used for managing an object graph. Core Data is not a database.Core Data can use a SQLite database as its persistent store, but it also has support for other persistent store types, including a binary store and an in-memory store. SQLite is a lightweight relational database.

Q65). Difference between Keychain and NSUserDefaults?

In Keychain: If user removed the app from device  the saved  UserName and Password still is there.
In NSUserDefaults: If user removed the app from device  the saved  UserName and Password  also removed.

Q66). what is app thinning. How to reduce app size?

App thinning is concept of reducing the app size while downloading.Using the below methods we can reduce the app size

  1. App Slicing
  2. Bitcode
  3. On-Demand Resource

Q67). what is Bundle ID?

The Bundle ID  is the unique string that identifies your application to the system.

Q68). What are the types of certificates required for developing and distributing apps?

Development and distributing certificates.
Development certificate: used for development
Distribution certificates: used for submitting apps to app store or in house

Q69). what are binaries required to install  the app to device?

.ipa,
.app

Q70). what are the advantages of swift over Objective C?

  • Readability
  • Maintenance
  • Safer Platform
  • Less Code & Less Legacy
  • Speed

Q71). What is latest xcode version and its features?

Xcode latest version is 10.1

  • The Dark Mode
  • instantly Swift Source Code Editor
  • Debugging the Tools
  • Playground for Machine Learning
  • Source Control

Q72).What are new features in ios 12 for developers ?

  • ARKit 2
  • Siri Shortcuts
  • CarPlay for Navigation Apps
  • Health Records
  • Natural Language