Significant IOS Interview Questions


Q11: What is Memento Pattern?

Ans: In Memento Pattern, your data gets stored somewhere. Following this, the externalized state can be reestablished without disturbing encapsulation that makes sure that the private data remains secure. It is a behavioral design pattern that permits the user to create snapshots of an object’s state that can be restored later.

With the object it is working with, Memento will never compromise on the internal structure and the data that is present inside the snapshot. In other words, they are similar to checkpoints that can be stored and restored in the future.

Q12: What is MVC?

Ans: MVC id the short form for Model-View-Controller. This method is used by Apple to design apps for their platforms. That’s why a majority of developers use this approach on Apple platforms. In MVC, every part of your code is one of three things that are mentioned below.

Models: work on the domain data or a data access layer that manipulates the data. Additionally, models are responsible for storing your data.

Views: is in charge of the presentation layer (GUI). They offer data for users. For example, a table that displays a list of products that are available.

Controller/Presenter/ViewModel: Controllers are the combination of the two, by requesting to access data from a database to manipulate it or retrieve it with the model. And, converting its data in a way that can be shown by views.

Q13: Briefly explain MVVM?

Ans: Model–view–view model is again a software architectural pattern. This ensures the segregation of the development of the graphical user interface that can be through a markup language or the GUI code. The view is independent of any specific model platform. UIKit is the representation of the view and its state that is independent. The View Model brings about changes in the Model and gets updated by itself with the updated Model.

The view model takes in the model, so it has the ability to format the information that’s is supposed to be shown on the view.

Q14: What are the main advantages of Swift?

Ans: There are numerous benefits of swift. Thus, it is extensively used.

  • Optional Types: due to this, the applications don’t crash.
  • With the built-in error handling, it guarantees smooth usage.
  • Closures: they are blocks of functionality that are self-contained. You can pass them and you can use them in your code.
  • If you draw a comparison between Swift and other programming languages, it is pretty fast.
  • This language is absolutely Type-safe.
  • It is useful as it supports pattern matching.
  • It puts an end to stack overflow and out of bounds.
  • There is a single file that contains the implementation and interface.

Q15: What is Cocoa and Cocoa Touch?

Ans:

Cocoa:

  • It helps you create robust application environments for OS X. Besides that, cocoa makes the creation of well-factored, full-featured applications in easy way.
  • It involves both, the Foundation and the AppKit frameworks.
  • They can be utilized to bring any class/object that is based on the Objective-C runtime.

Cocoa Touch

  • The first difference in this list is that it helps you create application development environments for iOS/
  • It has Foundation and UIKit frameworks/
  • As it uses the programmatic interface, it is utilized for referring to application development.