IOS Interview Questions

Whether you are a candidate or an interviewer you may always find it difficult to lay hands on the best kind of questions for an interview, especially such an important one. iOS interview questions are all technology-based that is very straightforward if you have the basic idea of what you are dealing with. Any amount of preparation is a waste of time if you are not through with the basics. Here is a list of important questions that will refresh your brain to prepare for the iOS interview.

The questions will give you an idea about the pattern and the right way to answer the questions that may be thrown your way during the interview. So, without adieu lets' start with the questions and answers that may come in the iOS interview.

Read Few Important iOS interview questions and answers

#1 Define Decoding or Deserialization and Encoding or Serialization,

The process of data conversion into a single JSON or string is called Serialization. It can be transmitted or stored easily. Another word for Serialization is encoding. A single string when through the reversible process is turned into a data is known as deserialization or decoding.
In swift we use the Codable protocol that a type can conform to, to declare that it can be encoded and decoded. It’s basically an alias for the Encodable and Decodable protocols.

#2 Provide an explanation for rethrows keyword

Rethrows is a very special keyword that can be used in conjunction beside closures that can throw errors. Generally, with rethrow exception we can throw inside the closure as and when the error handlers are summoned inside the function. The keyword indicates to the compiler that if the closure is passed in throws, which is basically a throwing function of outer function then an error is propagated to the current scope.

#3 What is the difference Stack and Heap?

Our code takes up some space in the iOS. The size of this is sometimes fixed and sometimes it can change according to what the user will enter during the program. Basically, we have two different methods because of this difference: Stack and Heap.

A stack is used and automatically removes itself from memory after work is finished. But in Heap, the user could do it by writing manual code for deleting from memory.

• A stack is easy to use.• Compared to Stack, it is quite slow.
• It’s kept in RAM on the computer.• It creates memory problems if not used correctly.
• Created variables are automatically deleted when they exit the stack.• Variables are used with pointers.
• It is quite fast compared to Heap.• It is created at runtime.
• Constructed variables can be used without a pointer. 

#4 What is Main Thread Checker?

The Main Thread Checker is a new tool launched with Xcode 9 is Main thread checker, which detects the invalid use of Apple’s frameworks like AppKit, UIKit, etc., that supposed to be used from main thread but accidentally used in the background thread. The effect of the invalid usage can result in missed visual defects, UI updates, crashes, and data corruption.

#5 Does Objective-C contain private methods?

Absolutely no, the private method in Object-C programming is not a method. The method becomes protected only when it is defined in .m. If a method is in .h, then it becomes public.
If you are really looking for a private method then you will have to add an unnamed category /local category/class extension in the class and add the method in the category and define it in the class.m.

#6 What’s the difference between MKAnnotation and MKPointAnnotation?

The major difference between MKAnnotation and MKPointAnnotation is that MKAnnotation is a protocol whereas MKPointAnnotation is a class that implements MKAnnotation. MKAnnotation protocol is implemented by NSOject subclass that is created by us. Instances of this custom class will then serve as your map annotation.

We can use MKPointAnnotation directly if we want our own business logic on the annotation.

#7 Explain IGListKit?

The IGListKit is known to provide for different objects automatically that can be used to create deletions, moves, and insertions before it starts performing the batch updates on collection view. If a user happens to delete an update, which is in the queue that is being viewed, then we make sure that it fades out without the requirement of pulling down to refresh.
This way we can say goodbye to UICollectionViewDatasource, instead, we can use an IGListAdapterDataSource with IGListAdapter. The data source provides the array of Selection Controllers and doesn’t return counts or cells.
The Section Controllers are used to control cells and configure within the given collection view section.

#8 Describe @objc inference

To indicate the availability of Swift declaration to Objective-C it is tagged with make it readily available to Objective-C, in Swift 3 many declarations inferred automatically. The most common place for this is any Swift method we want to refer to using a selector.

#9 Ellaborate Viper Architecture

Viper architecture is another design pattern, which has five layers namely, Interactor, View, Router, Entity, and Presenter. It is completely based on Single Responsibility Principle.

The main advantage of viper architecture is its ability for communication from one entity to another that is made known through protocols. The idea is to isolate the app’s dependencies by balancing the delegation of responsibilities among the entities.

#10 What is managed object context and what are its functions?

 A managed object context is a provisional ‘scratchpad’ of sorts in any application for a collection or set of related objects. It is represented generally by an instance of the method NSManagedObjectContext( ). These related objects together represent a consistent view from the inside of one or even more persistent stores.
  • Multiple copies of any object could exist in various contexts but a singular instance of the managed object exists in not more than one context.

The chief functions of a managed object context comprise of the following:

  • Management of life cycle: In this case, the context delivers proof, undo/redo and handling of the inverse relationship.
  • Notifications: These denote the context posts notices at different points which can be observed from another part of the application.
  • Concurrency: When the Core Data makes use of confinement of threads or serialized queues in order to protect the managed object contexts and the managed objects too.

#11 What is the purpose of using IBAction and IBOutlet?

IBOutlet and IBAction are macros that are defined to denote methods and variables that can be referred to in the Interface Builder.
IBAction resolves to void whereas IBOutlet resolves to nothing, but yes, they signify to Xcode and Interface Builder that these methods and variables can be used in Interface builder to link UI elements to your code.

#12  What is the method for preventing the QuickTime Player from capturing streaming videos of iOS 8 apps on Yosemite while screen recording is on?

The QuickTime Player on Yosemite cannot record encrypted media by the HTTP Live Streams during screen recording. As a result, these will simply black out in the recorded video.

The HTTP Live Streaming tech (HLS) from Apple allows you to send and receive on-demand and live video and audio media on your iPad, iPhone, Apple TV, Mac and PC. HLS uses the very same properties and procedures which drive the web and thus, lets the user make use of content with the help of ordinary content delivery networks and web servers. HLS is exclusively designed for high reliability and it dynamically modifies itself to suit the network conditions. This is done by optimization of playback according to the available connection speed offered by wired or wireless devices.

Also Prepare: Frequently Asked Swift Interview Questions

#13 Define Content offset

While scrolling a scrollView the properties may get modified in the process and it is known as content offset. The scrollView can compute the new bounds and redraw any of its subviews. It is a point at which the origin of the contentView, i.e., the bounds rectangle, is offset from the origin of the scrollView.

#14 What is OAuth?

Open Authorization is often referred to as OAuth, which is generally an authorization protocol and not used for authentication. As OAuth is an authorization protocol, it is just concerned with authorization of third-party application that can be used to access user data without identifying the user or exposing its credentials. It has two libraries namely, OAuth2 and OAuthSwift

#15 What are extra features added in iOS 9?

Learning user habits and most importantly, acting on the information gathered has never been easier! With the excellent mechanisms of Intelligent Search as well as Siri-Intelligent Search, life is much more tech dependent and hence, easier. These can basically be used to open apps directly without command, for recommendations on restaurants or any kind of reservations and for guiding the user through the daily lives in order to ensure a smooth routine. Siri is a famous personal assistant to the iOS users.

It is capable of creating contextual reminders and even employ search to find a particular photo or video from the gallery in innovative ways. It does more than ensuring that we are where we need to be at any particular time. Going right from the home screen of the device shows “Siri Suggestions”. This screen is home to all your favourite apps and contacts, restaurants, information about the location and more important news from the web.

For more extensive search, Siri can display capabilities for deeper search and come up with results like videos, sports scores, content from other third-party apps, and more. Simple conversations and calculations can also be done using the handy search tools available on iPad or iPhone. Many inbuilt apps have also been upgraded for improved performance.

  • ✓ The app for Notes has new sketching features and checklists.
  • ✓ The maps include transit directions in addition to the usual features.
  • ✓ File attachments are possible with Mail.
  • ✓ The brand new app for News intelligently studies your interests and then personalizes the news to relevant content which is of interest to you.
  • ✓ The transaction app, Apple Pay, now comes with added store credit cards as well as loyalty cards.
  • ✓ iOS 9 has updated the leading app “Passbook” to “Wallet”.
  • In addition to these, the operating system has updated to wireless CarPlay support for an elective app from iCloud Drive, San Fransico type font, inbuilt two-factor type authentication as well as elective longer passwords for improved security.
Ask a Question