IOS interview Question Answer for freshers/IOS Interview Questions and Answers for Freshers & Experienced

Explain what is defer ?

defer keyword which provides a block of code that will be executed in the case when execution is leaving the current scope.

Posted Date:- 2022-07-09 08:08:15

Explain generics in Swift ?

Generics create code that does not get specific about underlying data types. Don’t catch this article. Generics allow us to know what type it is going to contain. Generics also provides optimization for our code.

Posted Date:- 2022-07-09 08:07:10

What is the Swift main advantage ?

To mention some of the main advantages of Swift:

<> Optional Types, which make applications crash-resistant
<> Built-in error handling
<> Closures
<> Much faster compared to other languages
<> Type-safe language
<> Supports pattern matching

Posted Date:- 2022-07-09 08:00:25

How many are there APIs for battery-efficient location tracking ?

There are 3 apis.

<> Significant location changes — the location is delivered approximately every 500 metres (usually up to 1 km)
<> Region monitoring — track enter/exit events from circular regions with a radius equal to 100m or more. Region monitoring is the most precise API after GPS.
<> Visit events — monitor place Visit events which are enters/exits from a place (home/office).

Posted Date:- 2022-07-09 07:57:08

What is JSON/PLIST limits ?

<> We create your objects and then serialized them to disk..
<> It’s great and very limited use cases.
<> We can’t obviously use complex queries to filter your results.
<> It’s very slow.
<> Each time we need something, we need to either serialize or deserialize it.
it’s not thread-safe.

Posted Date:- 2022-07-09 07:39:51

How many different annotations available in Objective-C ?

<> _Null_unspecified, which bridges to a Swift implicitly unwrapped optional. This is the default.
<> _Nonnull, the value won’t be nil it bridges to a regular reference.
<> _Nullable the value can be nil, it bridges to an optional.
<> _Null_resettable the value can never be nil, when read but you can set it to know to reset it. This is only apply property.

Posted Date:- 2022-07-09 07:30:44

What is Observer Pattern?

In the Observer pattern, one object notifies other objects of any state changes.

Cocoa implements the observer pattern in two ways: Notifications and Key-Value Observing (KVO).

30- What is Memento Pattern?
In Memento Pattern saves your stuff somewhere. Later on, this externalized state can be restored without violating encapsulation; that is, private data remains private. One of Apple’s specialized implementations of the Memento pattern is Archiving other hand iOS uses the Memento pattern as part of State Restoration.

Posted Date:- 2022-07-09 07:25:48

What is Adapter Pattern?

An Adapter allows classes with incompatible interfaces to work together. It wraps itself around an object and exposes a standard interface to interact with that object.

Posted Date:- 2022-07-09 07:24:12

What is Facade Design Pattern?

The Facade design pattern provides a single interface to a complex subsystem. Instead of exposing the user to a set of classes and their APIs, you only expose one simple unified API.

Posted Date:- 2022-07-09 07:03:11

What is Singleton Pattern ?

The Singleton design pattern ensures that only one instance exists for a given class and that there’s a global access point to that instance. It usually uses lazy loading to create the single instance when it’s needed the first time.

Posted Date:- 2022-07-09 07:01:57

Why is design pattern very important ?

Design patterns are reusable solutions to common problems in software design. They’re templates designed to help you write code that’s easy to understand and reuse. Most common Cocoa design patterns:

Creational: Singleton.
Structural: Decorator, Adapter, Facade.
Behavioral: Observer, and, Memento

Posted Date:- 2022-07-09 06:57:33

What is ABI?

ABIs are important when it comes to applications that use external libraries. If a program is built to use a particular library and that library is later updated, you don’t want to have to re-compile that application (and from the end user's standpoint, you may not have the source). If the updated library uses the same ABI, then your program will not need to change. ABI stability will come with Swift 5.0

Posted Date:- 2022-07-09 06:56:29

What is Functions?

Functions let us group a series of statements together to perform some task. Once a function is created, it can be reused over and over in your code. If you find yourself repeating statements in your code, then a function may be the answer to avoid that repetition.

Pro Tip, Good functions accept input and return output. Bad functions set global variables and rely on other functions to work.

Posted Date:- 2022-07-09 06:55:47

What is Platform limitations of tvOS?

First, tvOS provides no browser support of any kind, nor is there any WebKit or other web-based rendering engine you can program against. This means your app can’t link out to a web browser for anything, including web links, OAuth, or social media sites.

Second, tvOS apps cannot explicitly use local storage. At product launch, the devices ship with either 32 GB or 64 GB of hard drive space, but apps are not permitted to write directly to the onboard storage.

tvOS app bundle cannot exceed 4 GB.

Posted Date:- 2022-07-09 06:54:58

What is TVMLKit?

TVMLKit is the glue between TVML, JavaScript, and your native tvOS application.

Posted Date:- 2022-07-09 06:54:23

What is Operator Overloading?

Operator overloading allows us to change how existing operators behave with types that both already exist. Operators are those little symbols like +, *, and /

Posted Date:- 2022-07-09 06:53:35

What is Regular expressions?

Regular expressions are special string patterns that describe how to search through a string.

Posted Date:- 2022-07-09 06:52:45

What is Responder Chain ?

A ResponderChain is a hierarchy of objects that have the opportunity to respond to events received.

Posted Date:- 2022-07-09 06:52:14

What’s the difference between the frame and the bounds?

The bounds of a UIView is the rectangle, expressed as a location (x,y) and size (width, height) relative to its own coordinate system (0,0).
The frame of a UIView is the rectangle, expressed as a location (x,y) and size (width, height) relative to the superview it is contained within.

Posted Date:- 2022-07-09 06:51:46

What is the difference between a process and a thread?

Process:

1.Process is a heavy weight process.
2.Process is a separate program that has separate memory,data,resources ect.
3.Process are created using fork() method.
4.Context switch between the process is time consuming.

Posted Date:- 2022-07-09 06:46:11

What’s Completion Handler?

Completion handlers are super convenient when our app is making an API call, and we need to do something when that task is done, like updating the UI to show the data from the API call. We’ll see completion handlers in Apple’s APIs like dataTaskWithRequest and they can be pretty handy in your own code.

Posted Date:- 2022-07-09 06:45:09

What’s Code Coverage?

Code coverage is a metric that helps us to measure the value of our unit tests.

Posted Date:- 2022-07-09 06:43:34

What is Dynamic Dispatch?

Dynamic Dispatch is the process of selecting which implementation
of a polymorphic operation that’s a method or a function to call at run time. This means, that when we wanna invoke our methods like object method. but Swift does not default to dynamic dispatch.

Posted Date:- 2022-07-09 06:41:31

What is the difference strong, weaks, read only and copy?

strong, weak, assign property attributes define how memory for that property will be managed.

Strong means that the reference count will be increased and
the reference to it will be maintained through the life of the object

Weak ( non-strong reference ), means that we are pointing to an object but not increasing its reference count. It’s often used when creating a parent child relationship. The parent has a strong reference to the child but the child only has a weak reference to the parent.

<> Every time used on var
<> Every time used on an optional type
<> Automatically changes itself to nil

Posted Date:- 2022-07-09 06:39:45

Why do we use synchronized?

synchronized guarantees that only one thread can be executing that code in the block at any given time.

Posted Date:- 2022-07-09 06:38:57

What are synchronous and asynchronous tasks in iOS? In what way can you execute asynchronous tasks in iOS?

Apple's iOS supports both synchronous and asynchronous tasks. In synchronous operations, tasks are performed one at a time. Therefore, other tasks must wait until the previous task is completed before continuing. Asynchronous tasks run simultaneously in the background. If background tasks are completed, you will be notified. Asynchronous programming allows you to process multiple requests at the same time, so you can accomplish more tasks in a shorter amount of time.

Posted Date:- 2022-07-09 06:30:47

How can you implement storage and persistence in iOS?

Persistence means storing data on the disk so that it can be retrieved without being altered the next time the app is opened. From simple to complex, there are the following methods for storing data:

<> Data structures such as arrays, dictionaries, sets, and other data structures are perfect for storing data intermediately.
<> NSUserDefaults and Keychains are both simple key-value stores. NSUserDefaults is insecure, whereas Keychains is secure.
<> A file or disk storage is a way to store data (serialized or not) to or from a disk using NSFileManager.
<> Relational databases, such as SQLite, are good for implementing complex querying mechanisms.

Posted Date:- 2022-07-09 06:30:26

What do you mean by dynamic dispatch?

In simple terms, dynamic dispatch means that the program decides at runtime which implementation of a particular method or function it needs to invoke. In the case where a subclass overrides a method of its superclass, dynamic dispatch determines whether to invoke the subclass implementation of the method or the parents.

Posted Date:- 2022-07-09 06:26:57

State the difference between strong, weak, read only and copy.

The difference between strong, weak, read-only and copy is as follows:

<> Strong: This property maintains a reference to property throughout the lifetime of an object. When you declare strong, you intend to "own" the object you are referencing. Data you assign to this property will not be destroyed as long as you or any other object references it strongly.
<> Weak: It means that the object should be kept in memory as long as someone points to it strongly, and you don't need control over its lifetime.
<> Read-only: An object's property can be defined initially, but it cannot be altered or modified.
<> Copy: This attribute is an alternative to strong. In place of taking ownership of a current object, it creates a copy of whatever you assign to the property, then takes ownership of that copy.

Posted Date:- 2022-07-09 06:26:19

Explain the function of the completion handler.

Completion handlers are basically just functions passed as parameters to other functions. They are used to dealing with the response of asynchronous tasks since we do not know when they will end. Completion handlers inform an application when an operation, such as an API call, has been completed. The program is informed that the next step needs to be executed.

Posted Date:- 2022-07-09 06:21:09

Explain TDD (Test-Driven Development).

Software developers can use testing-driven development (TDD) in the development of software. In TDD, developers plan the features of the software that they want to create and then write test cases for each feature before implementing it. Through test-driven development, we can gain insight into both the quality of the implementation (does it work) and the quality of the design (is it well structured).

Posted Date:- 2022-07-09 06:20:34

State the difference between KVC and KVO in Swift.

KVC (Key-Value Coding): It enables object properties to be accessed at runtime using strings rather than knowing the property names statically during development.

KVO (Key-Value Observing): In Objective-C and Swift, KVO is one of the methods for observing program state changes. If an object has instance variables, KVO enables other objects to observe the changes to those variables.

Posted Date:- 2022-07-09 06:20:12

Explain iBeacons in iOS.

iBeacon, Apple's new low-energy Bluetooth wireless technology, allows iPhone and other iOS users to receive location-based information and services on smartphones. IBeacons are small, wireless transmitters that transmit signals to nearby smart devices via Bluetooth low energy technology.

Posted Date:- 2022-07-09 06:19:49

What is the JSON framework supported by iOS?

iOS supports the SBJson framework as the JSON framework. Humans and computers alike can easily read and write this lightweight data exchange formatter. JSON handling is simplified with SBJson's flexible APIs and additional control.

Posted Date:- 2022-07-09 06:19:28

Explain dictionary in Swift.

Swift programming defines a dictionary as an unordered collection of items. It stores items in key-value pairs. A dictionary uses a unique identifier called a key to store an associated value which can later be referenced and retrieved through the same key.

Posted Date:- 2022-07-09 06:18:51

What are generics in swift and write its usage?

A major feature of Swift is generics, and much of the Swift standard library is written in generic code. Swift's 'Array' and 'Dictionary' types, for example, constitute generic collections. Generic code allows you to create flexible, reusable functions and types that work with any data type. You can create code that does not get too specific about underlying data types, resulting in cleaner code.

Posted Date:- 2022-07-09 06:18:33

What do you mean by lazy property in iOS?

Lazy properties are properties whose initial value isn't computed until the first time they are used. Including the lazy modifier/keyword before the declaration of a stored property indicates it is lazy. This lets you delay the initialization of stored properties. This could be a great way to streamline your code and reduce unnecessary work. When a code is expensive and unlikely to be called consistently, a lazy variable can be a great solution.

Posted Date:- 2022-07-09 06:17:53

Explain NSError in Swift.

Information about an error condition is encapsulated within an NSError object in an extendable and object-oriented manner. An NSError object is comprised of three basic attributes: a predefined error domain (represented as a string), a domain-specific error code, and a user info dictionary containing application-specific information.

Example: The examples below show how to create custom errors.

<> NSString *domain = @"com.MyCompany.MyApplication.ErrorDomain";

<> NSString *desc = NSLocalizedString(@"Unable to complete the process", @"");

<> NSDictionary *userInfo = @{ NSLocalizedDescriptionKey : desc };

<> NSError *error = [NSError errorWithDomain:domain code:-101 userInfo:userInfo];

Posted Date:- 2022-07-09 06:17:31

What are the important features of Swift?

Swift programming language is being designed so that developers can write correct programs and maintain them easily. It offers the following features:

<> Safety: Swift is an efficient way to write programs. Checking code before it is used in production is very important. Apple Swift removes any unsafe code before it is used in production.
<> Simple syntax: Swift's syntax is simple and easy-to-use, just as developers would expect it. The syntax features of Swift enable you to write more expressive code.
<> Readability: Swift has a simple syntax, which is easier to read and write. It is easier for developers to write Swift code since it is more similar to plain English, enabling them to spend less time looking for problematic code.
<> Multiplatform support: Swift is fully compatible with iOS, macOS, tvOS, watchOS, Linux, and many other platforms. This means you are able to develop software that is compatible with all operating systems.
<> Open-source: Swift is developed at swift.org, an open-source framework. For Swift to become a defining programming language, the technology had to be open to all. Swift supports all Apple platforms and makes programming easier, faster, and safer.
<> Compatible with Objective C: Swift has full compatibility with Objective-C. Swift enables programmers to import frameworks from Objective-C using the Swift syntax. Programmers can utilize Objective-C libraries and classes inside Swift code

Posted Date:- 2022-07-09 06:16:18

Explain Swift in iOS?

Swift is the fastest-growing programming language today, created by Apple. With a significant advantage pool over the well-known Objective-C, Swift holds a leading position in iOS development. It's an entirely new language created specifically to develop software for Apple's operating systems. Since Swift implements all the features of other modern languages, you can find type inference, optional, generics, and such higher-order functions. It is compatible with macOS, iOS, watchOS, and tvOS.

Posted Date:- 2022-07-09 06:14:23

Explain Objective-C in OS.

Since the 1990s, Objective-C has been used by Apple as an object-oriented programming language. This language combines the advantages of two earlier languages - C and Smalltalk. As a superset of C, it provides object-oriented functionality and a dynamic runtime environment.

Posted Date:- 2022-07-09 06:13:55

What do you mean by the SpriteKit and SceneKit framework in the context of game development?

<> SpriteKit: This framework is designed to make it easier and faster for game developers to create animated 2D assets/objects in casual games. With it, you can draw shapes, particles, text, images, and videos in two dimensions.

<> SceneKit: It is an iOS framework inherited from OS X, which helps to create 3D graphics. With SceneKit, you can build 3D animated scenes and effects for your iOS games and apps.

Posted Date:- 2022-07-09 06:13:19

State the difference between App ID and Bundle ID?

Bundle ID: They are the unique identifiers of applications in Apple's ecosystem. In other words, no two applications can have the same identifier. The bundling ID is used for both OS X and iOS apps and can be used to recognize app updates.
Example:
If our organization’s domain is scaler.com and we create an app named Edge, you could assign the string com.scaler.edge as our app’s bundle ID.
App ID: This string uniquely identifies one or more apps from the same development team. There are two components to the string, the Team ID and the Bundle ID, separated by a period (.). Apple supplies a Team ID to identify a specific development team, whereas developers supply Bundle IDs to identify a single app or a collection of apps.
Example:
ABCDE12345.com.scaler.edge
In the above example, ABCDE12345 is the Team ID and com.scaler.edge is the Bundle ID.

Posted Date:- 2022-07-09 06:11:33

Write different ways to achieve concurrency in iOS?

Concurrency means "running multiple tasks simultaneously". Concurrency allows iOS devices to handle background tasks (such as downloading or processing data) while maintaining a responsive user interface. In iOS, you can manage concurrent tasks using Grand Central Dispatch (or GCD), and Operations (formally known as NSOperation). In order to achieve concurrency, iOS provides three ways as follows:

<> Dispatch queues: They are used to manage tasks in first-in-first-out (FIFO) order and execute tasks sequentially or concurrently. This is an easy way to handle asynchronous (not occurring at the same time) and concurrent tasks in your application.
<> Threads: An independent sequence of instructions can be executed separately from other code within a program. Through threads, one can execute multiple code paths simultaneously in a single application. Having a thread is especially useful when you need to perform a lengthy task without affecting the execution of the rest of the program.
<> Operation Queues: Operation queue objects are invoked in accordance with their priority and readiness. Essentially, operation queues are high-level abstractions of queueing models, built on top of GCD (Grand Central Dispatch). It is possible, therefore, to execute tasks concurrently, just like GCD, but in an object-oriented manner.

Posted Date:- 2022-07-09 06:10:44

What is the framework that is utilized to build an application's interface for iOS?

Contrary to the Foundation framework that defines classes, protocols, and functions for both iOS and OS X development, UIKit is specifically designed for iOS development. In iOS, the user interface and graphical infrastructure of the application are developed using UIKit. It includes:

<> Event handling (handle different gestures like input gestures, button-tap gestures, multi-touch gestures, etc.)
<> App structure (Manages the interaction between the system and user)
<> User Interface (Provides user interactions, the ability to share text and content, select images, edit videos, print files, etc.)
<> Graphic, Drawing, and Printing

Posted Date:- 2022-07-09 06:09:50

Which programming languages are used for iOS development?

iOS development is done using the following programming languages:

* HTML5
* NET
* C
* C++
* Swift
* JavaScript
* Objective-C

Posted Date:- 2022-07-09 06:09:11

What is ARC (Automatic Reference Counting)?

In the Swift programming language, automatic reference counting (ARC) is used to manage apps' memory usage. It initializes and deinitializes system resources, thereby releasing memory reserved by a class instance when it no longer needs it. ARC keeps track of how many properties, constants, and variables currently refer to each class instance. When there is at least one active reference to an instance, ARC will not deallocate that instance. The use of ARC concepts is an essential part of iOS development.

Posted Date:- 2022-07-09 06:08:07

what is GCD (Grand Central Dispatch) in iOS.

Grand Central Dispatch (GCD) is a low-level API that enables users to run concurrent tasks (occurring simultaneously) by managing threads in the background. Grand Central Dispatch is Apple's solution to build concurrency and parallelism into iOS applications, so multiple background tasks can be run concurrently in the background without affecting the main thread. It was introduced in iOS 4 to avoid the tedious process of serial execution of tasks.

Posted Date:- 2022-07-09 06:07:27

What do you mean by deep linking in iOS?

Deep links are links that send users directly to an app directly instead of a website or store using URI (Uniform resource locator) or universal links. The URL scheme is a well-known method of having deep links, but Universal Links are Apple's new approach to connecting your web page and your app under the same link. Deep linking involves not only creating a clickable link that opens up your app, but also a smart one that navigates to the resource you desire. Users are directed straight to in-app locations using these links, which saves them the time and effort of finding those pages themselves thus improving their user experience tremendously.

Posted Date:- 2022-07-09 05:41:36

State the difference between Android and iOS.

Android: It is the mobile operating system for Android devices offered by Google LLC (limited liability company) and is focused on touchscreen mobile devices like smartphones and tablets. Several programming languages were used in its development, including C, Java, C++, and others.

iOS: It is the operating system for Apple devices offered by Apple incorporation and it is considered the second most popular mobile operating system globally after Android. It is primarily designed for Apple mobile devices like the iPhone, iPod Touch, etc. Several programming languages were used in its development, including Objective-C, Swift, C++, and others.

Posted Date:- 2022-07-09 05:38:07

What is an iOS developer and what are his responsibilities?

An iOS developer is a programmer or software engineer who designs and develops applications that run Apple's iOS on iOS devices. Ideally, the iOS developer should be skilled in two programming languages i.e., Objective-C and Swift.

Posted Date:- 2022-07-09 05:36:03

What are different types of iOS Application States?

During the course of its execution, an iOS application goes through a series of states. Each of these states is referred to as an application's lifecycle state. Below are the five possible states for an iOS app:

Not running: In the Not Running state, an application has either not been launched or has been closed/shut down by the system.
Inactive: A brief state of inactivity occurs while the app is leaving or entering its active state. Despite running in the foreground, it isn't yet ready to accept user input or events. This means that the application remains inactive at this time.
Active: The Active state indicates that the app is running in the foreground and receiving events. This is usually the normal mode for foreground apps and the User Interface is accessible.
Background: During this state, the application's user interface is hidden, but it continues to run in the background of the iOS system. Applications usually pass through this state prior to being suspended.
Suspended: In this case, the application is in the background but is not running code. However, it stays in my memory. Under low memory conditions, the system can delete apps in the suspended state without warning.

Posted Date:- 2022-07-09 05:34:00

Can you explain the difference between atomic and nonatomic properties? What is the default for synthesized properties?

<> Atomic Property: It is the default property and ensures a valid value will be returned from the getter or set by the setter. This ensures that only one thread can access the getter/setter of a given property at a time and that all other threads must wait until the first thread releases the getter/setter. Despite being thread-safe, it is not fast, since it ensures that the process is completely completed.

<> Non-Atomic Property: With non-atomic properties, multiple threads can access the getter/setter method of a given property at the same time, so the potential for inconsistency between values exists. They come with enhanced access, but no guarantee of the return value.

Posted Date:- 2022-07-09 05:32:54

What is @synthesize in Objective-C?

synthesize generates getter and setter methods for your property.

Posted Date:- 2022-07-09 05:28:35

Why don’t we use strong for enum property in Objective-C?

Because enums aren’t objects, so we don’t specify strong or weak here.

Posted Date:- 2022-07-09 05:28:07

What is the bounding box?

The bounding box is a term used in geometry; it refers to the smallest measure (area or volume) within which a given set of points.

Posted Date:- 2022-07-09 05:27:46

What is made up of NSError object?

There are three parts of NSError object a domain, an error code, and a user info dictionary. The domain is a string that identifies what categories of errors this error is coming from.

Posted Date:- 2022-07-09 05:26:32

Explain Compilation Conditions

Compilation Conditions to use if DEBUG … endif structure to include or disable given block of code ve separate targets.

Posted Date:- 2022-07-09 05:24:21

What is the difference between Synchronous & Asynchronous task?

Synchronous: waits until the task have completed Asynchronous: completes a task in the background and can notify you when complete

Posted Date:- 2022-07-09 05:23:00

How could you set up Live Rendering?

The attribute @IBDesignable lets Interface Builder perform live updates on a particular view. IBDesignable requires Init frame to be defined as well in UIView class.

Posted Date:- 2022-07-09 05:22:44

Search
R4R Team
R4R provides IOS Freshers questions and answers (IOS Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,IOS interview Question Answer for freshers,IOS Freshers & Experienced Interview Questions and Answers,IOS Objetive choice questions and answers,IOS Multiple choice questions and answers,IOS objective, IOS questions , IOS answers,IOS MCQs questions and answers R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for IOS fresher interview questions ,IOS Experienced interview questions,IOS fresher interview questions and answers ,IOS Experienced interview questions and answers,tricky IOS queries for interview pdf,complex IOS for practice with answers,IOS for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .