ios interview questions Essay

1. 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.

2. How Synchronous & Asynchronous task works?

Synchronous: If you want to move to other task Wait for the current task complete.If it completes then it will execute next task.

Asynchronous: You can move to another task before the current task finishes.

3.Difference between synthesize and dynamic in Objective-C ?

synthesize generates getter and setter methods for your property.

dynamic tells the compiler that getter and setters are implemented somewhere else.

4.What are the different property types?

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

5. 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 .

6.what is MVC

Model : data wrapper

View: user interface(UI)

Controller: controls the model and view

7. What are the design patterns in ios?

Singleton

Delegate

Model View Controller

Observer

Facade

Command

Template Method

8.How to pass data between view controllers

Segue, in prepareForSegue method (Forward)

Delegate (Backward)

Setting variable directly (Forward)

9. 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.

10. 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.

11.Application life cycle

application:willFinishLaunchingWithOptions

application:didFinishLaunchingWithOptions

applicationDidBecomeActive

applicationWillResignActive

applicationDidEnterBackground

applicationWillEnterForeground

applicationWillTerminate

12.Different states of application

Not running

Inactive

Active

Background

Suspended

13.View life cycle

loadView

loadViewIfNeeded

viewDidLoad

viewWillAppear

viewWillLayoutSubviews

viewDidLayoutSubviews

viewDidAppear

viewWillDisappear

viewDidDisappear

14.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.

15. What is defer in swift ?

defer statement to execute a set of statements just before code execution leaves the current block of code.

16. What is guard in swift ?

It checks for some condition and if it evaluates to be false, then the else statement executes which normally will exit a method .

17. How to write optional value in swift ?

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

18. 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”.

19. 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.

20. What is id in Objective C?

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

21. What is Categories in Objective C?

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

22. 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.

23. Define Class methods and instance methods .

An instance method accessed an instance of the class

A class method accessed to the class itself.

24. 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.

25. What is UUID and UDID ?

UUID is Universally Unique IDentifier. It is on a per-app basis that identifies an app on a device. If the user completely deletes and then reinstalls the app then the ID will change otherwise same ID will be there.

UDID is Unique Device Identifier). It consists of a sequence of 40 hexadecimal characters that uniquely identify an ios device. This value can be found in iTunes or UIDevice -uniqueIdentifier.

26.What are Size Classes?

Size Classes are nothing but a groups of screen sizes that are applied to the width and height of the device screen. It has 2 types i.e Compact and Regular.

The Compact Size Class has a constrained space. In Xcode we noted as Compact width(wC) and Compact height(hC).

The Regular Size Class has a non-constrained space. In Xcode we noted as Regular width(wR) and Regular height(hR).

27.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.

28. How many ways constraints can create programmatically?

Three ways to creating constraints programmatically :

layout anchors

NSLayoutConstraint class

Visual Format Language.

29.Difference between XIB and Storyboard

Storyboard :

Storyboard is one single file which contains all the views or screens that in yours apps. It transitions one screen to another screen.

XIB :

In XIB there is no flow of control and transition between the view and controller. In XIB the result is stored as a NIB file.

30. 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.

31.What is mutable and immutable object in ios?

mutable object can be changed or mutated where as immutable object cannot be changed. The mutable and immutable objects may contains array, string, dictionary.

32.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.

33.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.

34. 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.

35.when will use deinit in swift?

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

36.what is the responsibility of URLSession?

URLSession is responsible for sending and receiving requests.

37. what are the types of URLSessionTask?

URLSessionDataTask

URLSessionUploadTask

URLSessionDownloadTask

38.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.

39.what is JSON?

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

40. 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 .

41.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.

42.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.

43. What is the purpose of reuseIdentifier?

The reuseIdentifier is used to group together similar rows in an UITableView.A UITableView will normally allocate just enough UITableViewCell objects to display the content visible in the table.

If reuseIdentifier has not been set, the UITableView will be forced to allocate new UITableViewCell objects for each new item that scrolls into view, potentially leading to laggy animations.

44.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

App Slicing

Bitcode

On-Demand Resource

45.what is Bundle ID?

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

46. 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

47.what are binaries required to install the app to device?

.ipa,

.app

48. what are the advantages of swift over Objective C?

Readability

Maintenance

Safer Platform

Less Code & Less Legacy

Speed

49. 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

50. What are new features in ios 12 for developers ?

ARKit 2

Siri Shortcuts

CarPlay for Navigation Apps

Health Records

Natural Language

Still stressed from student homework?
Get quality assistance from academic writers!