Top interview questions for iOS developer for Objective-C and Swift Page 3
Let's Begin....
Q: Explain the Facade Design Pattern?
A: The design pattern on the Facade provides a complex subsystem with a single interface. Instead of exposing the user to a collection of classes and their APIs, only one single unified API is exposed to that.
Q: Explain the Decorator Design Pattern?
A: The pattern decorator dynamically adds behaviours and obligations to an object without altering its code. It is an alternative to sub classifying where you change the actions of a class by wrapping it in with a specific entity. Two very common implementations of this pattern exist in Objective-C: Category and Delegation. There are two very popular implementations of this pattern in Swift too: Extensions and Delegation.
Q: Explain the Adapter Pattern?
A: An Adapter allows the working together of classes with incompatible interfaces. It wraps itself around an object and provides a standard interface for the object to communicate with.
Q: Explain the Observer Pattern?
A: One object in the Observer pattern notifies other objects of any changes in the state. Cocoa applies the pattern of observation in two ways: alerts and key-value observation (KVO).
Q: Explain the Memento Pattern?
A: Save your things someplace in Memento Template. This outsourced state can be restored later, without infringing encapsulation; that is, private data remains private. One of the specialised Memento pattern implementations by Apple is Archiving other hand iOS uses the Memento pattern as part of State Restoration.
Q: Explain the MVC ?
A: Check the below points:
- Models — accountable for the domain information or a data access layer that manipulates the data, think of classes named 'Guy' or 'PersonDataProvider.'
- Views — liable for the interface layer (GUI), think about all for the iOS world beginning with the prefix 'UI.'
- Controller / Presenter / ViewModel — the Controller-View glue or mediator, usually responsible for altering the Object by responding to the actions of the user executed on the View and modifying the View with alterations from the Controller.
Q: Explain the MVVM
A: UIKit autonomous reflection of your View and its condition. The View Model provokes improvements to the Model and adjusts itself with the revised One, and because we have a link between View and View One, the first one is updated accordingly.
In fact, your view model will take into your model, and it can template the knowledge that will be showcased on your view.
Q: What other separate annotations in Objective-C are present?
A: Null-unspecified, which literally unwrapped optional bridges to a Swift. That's by nature.
Non-null, the meaning it bridges to a standard relation will not be zero.
Null-resettable will never be zero when you read it, but you can set the value to know how to reset it. This refers to land only.
Q: What are the limitations of JSON / PLIST?
A: We create and serialize your objects to the disk. It's great cases of use, and very limited. Obviously we can not use complex queries to filter out your results. It is a very slow operation. We have to either serialize or deserialize it every time we need it. It's not safe on thread.
Q: What are SQLite Boundaries?
A: Developers have to specify the tables relations. Defines all tables scheme. To fetch data, we need to write queries manually. Developers have to question outcomes and map that to models.
Q: Which are the advantages of Realm?
A: It's an open-source platform for the database. Built from scratch. Negligible store copy object. Its very much Quick.
Q: How many APIs are available to map battery-efficient locations?
A: As per my knowledge its 2:
- Substantial improvements in location — the position is transmitted about every 500 meters (usually up to 1 km away)
- Regional monitoring — monitor in / out events from circular areas with a distance equal to or higher than 100 metres. Tracking of the area is the most reliable API following GPS.
Q: Which is the biggest benefit of Swift?
A: And list some of Swift's key advantages:
- Built in Error Prevention/Handling
- Type-safe language
- Closures
- Far faster than in other languages
- Provides matching patterns
Q: In Swift, describe generics?
A: Generics create code that isn't specific about the underlying types of data. Generics lets us know what type it will contain. Generics also offers our code optimisation.
Q: In Swift, describe lazy?
A: The initial value of the lazy stored properties shall only be determined whenever the property will be first called. There's many times when developers get really creative with the lazy properties.
Q: In Swift, How to transfer as a reference a variable?
A: We should mention that there are two types of variables: reference and value type. The key difference between these two types would be that the variable will build a copy of its data by transferring value sort, and the reference type variable will simply point to the source information in the memory.
Want to do a quick revision for some general iOS topics, iOS interview general topics
Ok great, we are done with this post,
Now if you like my way of talk, lets explore more blogs written by me and my inner knowledge,
Get to know answers for common search on Google : A blog for posts which can help you for daily life problems, such as where to get free images, Topic suggestion for the blog.
Computer Science algorithms and other knowledge share : A blog for posts such as best search algorithm, Top interview questions for diffrent technologies, knowledge share for some frameworks or programming languages for the interview or in general terms.
My ideas to solve real world problems : A blog where me shared and presented my ideas to solve a real world problems, this will be interesting for me.
Future of computer science technology discussed : A blog where me discussed about the future of computer science and new technologies which will change our way for looking to solve problems.
Ruby on Rails Web development Blog : As the name suggest, it is the blog for sharing few knowledge about RoR web development framework.
Liked my blogs, wanna to connect:
Thanks for reading this post, Have a good day :)
Image Credit: People photo created by wirestock - www.freepik.com
Comments
Post a Comment