InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What is plist? |
| Answer» | |
| 2. |
What is NSUserDefaults? |
| Answer» | |
| 3. |
How to handle concurrency problems in Core Data? |
| Answer» | |
| 4. |
How to use Core Data Objects between two threads? |
| Answer» | |
| 5. |
Is Core Data is thread safe? |
| Answer» | |
| 6. |
How Core Data differs from SQLite? |
| Answer» | |
| 7. |
What persistent storage Core data uses to save data? |
| Answer» | |
| 8. |
How core Data Works to save data in Persistent storage? |
| Answer» | |
| 9. |
What are transient properties? |
| Answer» | |
| 10. |
What is a fault? |
| Answer» | |
| 11. |
When a NSFetchRequest fetches an entity object from store, does it fetch all of its data at once? |
| Answer» | |
| 12. |
Why do all model object attributes get marked with @dynamic and not synthesised? What does @dynamic mean? |
| Answer» | |
| 13. |
What are fetched properties? How do you create a fetched property? |
| Answer» | |
| 14. |
Can I have relationship between entities in separate stores (in case of configurations)? (No) |
| Answer» | |
| 15. |
In NSFetchRequest can we fetch only a selective few attributes of an entity? How? |
| Answer» | |
| 16. |
What are the different delete rules that a relationship can have? Which one takes ownership? |
| Answer» | |
| 17. |
How to implement "load more" using NSFetchedResultsController? (Hint: Set fetch offset and fetch limit on the NSFetchRequest of the controller, change the request to fetch more results) |
| Answer» | |
| 18. |
What is NSFetchedResultsController? How do you turn on content monitoring? |
| Answer» | |
| 19. |
What performance issues can you face when using CoreData? |
| Answer» | |
| 20. |
Can you pass same core data objects between different threads and modify? |
| Answer» | |
| 21. |
Are the NSManagedObjectContext queues serial or concurrent? |
| Answer» | |
| 22. |
What is difference between performBlock: and performBlockAndWait:? |
| Answer» | |
| 23. |
Explain parent-child context setup. How does it work? What are the advantages? |
| Answer» | |
| 24. |
What are the different store migration options? When are they used? How do they work? What is mapping model? |
| Answer» | |
| 25. |
In a single model, can I have few entities in one sqlite db file and remaining in another sqlite db file? (Yes, Hint: configurations) |
| Answer» | |
| 26. |
Can my application have multiple models? (Yes) |
| Answer» | |
| 27. |
Different types of persistent stores? Which all types can we have on iOS? |
| Answer» | |
| 28. |
What is NSManagedObjectModel? |
| Answer» 37. What is NSManagedObject? | |
| 29. |
What is NSManagedObjectContext? What are the different concurrency types? Explain them. |
| Answer» | |
| 30. |
What is NSPersistentStore? Is it thread safe? |
| Answer» | |
| 31. |
What is NSPersistentStoreCoordinator? What duties does it perform? |
| Answer» | |
| 32. |
How do you setup/initialise a core data stack in your application? Is this activity performed on main thread? If not, why? |
| Answer» | |
| 33. |
What is ORM? |
| Answer» | |
| 34. |
What Persistent storage used in Mobile Apps - iOS? |
|
Answer» Persistent storage is keeping the information you are working with around. In software ENGINEERING, PERSISTENCE refers to the NORMAL for the expression that outlasts the procedure that made it. This is ACCOMPLISHED practically speaking by putting AWAY the state as information in PC information storage. When it comes to information diligence in IOS, there are Five huge approaches to accomplish information steadiness:-
|
|
| 35. |
Common reasons for app rejection from App store review process? |
Answer»
There are a couple of needed links as a part of the App Store application method. For example, your app must have a link to your privacy policy. You’ve additionally ought to have a link to app support in order that users will contact you. If these links don’t go anyplace, your app is rejected. Make sure these pages square measure in operating order before submission.
Obviously, you wouldn’t need an automobile you were pondering shopping for to interrupt down on the check drive. That’s an excellent thanks to making sure that the automobile isn’t going get oversubscribed. By that very same token, a bug that rears its ugly head throughout the review method can place your app on the main road to rejection. Each app goes to POSSESS some problems once it’s initial free, however, try and catch as several as available throughput testing to avoid rejections and delays.
Moment dismissal anticipates your application on the off chance that it crashes all through the review technique. Obviously, the App Store is trying to find apps that truly work. If they don’t, they’re obtaining thrown the “no” pile.
Your app has precisely fifteen seconds to load, or Apple goes to reject it. you'll reduce your app load time by ensuring any pictures used square measure the adequate measure and prioritizing any bugs that reason the application to crash after loading. For a lot of insight in decreasing load times, examine this text on important. measure and prioritizing any bugs that reason the application to crash after loading.
Apps on the app store should supply worth and value to finish users. Apple is explicit regarding the top quality of its applications. Look to satisfy the high-level style demand of Apple, just as content size, content configuration, differentiate, arrangement, goals, mutilation, hit controls, association, and so forth. Cohesive user expertise is essential to obtain through the App Store.
Demos aren’t happy with the Apple App Store. Words like “demo,” “test” and “beta” square measure reaching to get flagged for rejection as a result of the App Store needs final versions of apps. This is often simply inevitable and best observe anyway. You don’t wish users are downloading associate imperfect version of your app.
Apple is that the sole guy on the block which will use a private API. ALL Apple apps have to be compelled to use a public API so as to create it through the approval method. The rationale is that Apple needs to make sure that public arthropod genus square measure in use is to shield user KNOWLEDGE from being abused.
Ads square measure a part of the method of building a lot of apps, however, if you UTILIZE IDFA (the iOS advertising identifier) on something that isn’t an advertisement, then you’re reaching to get rejected right away.
Keywords square measure; however, users notice your app. However, mistreatment keywords that square measure incorrect or square measure unrelated to the particular mobile application square measure cause for fast rejection from Apple. It’s not legal to use proprietary words, or titles that square measure deceptive. Apps got to gift themselves honestly so as to create it through the app store approval method.
Gambling and creative activity don't seem to be allowed within the App Store.
Content in mobile apps is supposed to be distinctive. Apps that square measure merely aggregates of content which will be FOUND elsewhere square measure the net goes to induce kicked out by Apple. What goes informed any Apple application should be content that’s usable and original for finish users. Plagiarism and aggregation can get your app showed within the blink of a watch.
Apple is supposed to be a secure area for folks of all non-secular faiths, ages, orientations, etc. It’s ought to all be clean and on top of the board. Something that's meant to arouse anger or to elicit a violent reaction can get thrown out right away.
It’s a tough and quick demand that each Apple app has a privacy policy in situ so as to induce approval.
Any app that shares personal user knowledge, from names to photos to contact info, are rejected. Privacy could be a massive deal to Apple, and they’ve created a large QUANTITY of trust with users so as to spice up their whole and create the foremost out of their client loyalty. Incursive privacy is simply not allowed.
Another privacy policy issue is mistreatment Apple Pay while not the privacy policy for it. That features any of the weather of stigmatization or the interface generally.
A major demand for apps within the Apple Store is that they need information. Meaning as well as screenshots, descriptions, etc. If the information isn’t there, then the app goes to induce rejected. |
|
| 36. |
What is Dependency Management Tools : Cocoapods etc? |
| Answer» | |
| 37. |
Ideas of notification center, nearby and remote notifications? |
|
Answer» Notification center is a MECHANISM that allows the publisher of knowledge to registered observers. Objects register with a notification center to receive notifications (NSNotification objects). Once associate object adds itself as an assistant observer, it specifies that notifications it ought to receive. The associate object might, therefore, the decision this methodology many times so as to register itself as an associate observer for many totally different notifications. Local notifications and remote notifications square measure ways that to tell users once new knowledge becomes on the market for your app, even once your app isn't running within the foreground. For instance, an electronic communication app would possibly let the user apprehend once a replacement message has arrived, associated a calendar app would probably inform the user of an impending appointment. The DISTINCTION between native and remote notifications is straightforward:
|
|
| 38. |
How do you check if your code has memory leaks? |
|
Answer» There are some ways to ASCERTAIN or observe memory leaks: -
It is an open source library launched by Facebook in 2016 F8 Conference. Its goal is to observe all doable retain cycles in Objective-C CODEBASE throughout the runtime.
Actually, Xcode offers us a native way — debug memory graph to observe memory leaks. It a tool INITIAL introduced in Xcode eight and is ready to grab leaks LIKE retain cycles
Instruments are powerful debugging and identification tools that come packaged with Xcode. For memory PROBLEMS, we have a tendency sometimes to use allocations and leaks tools. Allocations instrument tracks all of the objects that app allocates over the course of its run; leaks instrument checks all memory and figures out the leaked objects. Compared to rectify memory graph, these instruments provide a lot of in-depth check out memory leaks. |
|
| 39. |
Who calls the dealloc strategy? Would we be able to implement dealloc in ARC? In the event that indeed, what is the need to do that? |
|
Answer» Dealloc is termed as a result of memory management. Once an objects “retainCount” reaches zero, then a dealloc message is mechanically sent there to OBJECT. You should never DECISION dealloc on objects unless it's a decision to [super dealloc]; at the tip of Associate in Nursing OVERRIDDEN dealloc. ExampleOverridden dealloc. (Void) dealloc { [ivar release]; //Release any retained VARIABLES before super dealloc [super dealloc]; //Only place in your code you should ever CALL dealloc } |
|
| 40. |
Does Objective C have multiple inheritances? Why not? How to imitate various inheritances? |
|
Answer» Objective-C does not SUPPORT multiple inheritances. You’ll use a protocol, COMPOSITION and message forwarding to attain a similar result. Multiple inheritances allow a category to INHERIT behaviors and OPTIONS from over one parent. However, issues will arise with multiple inheritances as a result of it permits for ambiguities to occur. Because of this, Objective-C will don’t implement various inheritances. |
|
| 41. |
What is messaging? How does the runtime handle message passing? What is message forwarding? |
| Answer» | |
| 42. |
Does Objective C have function overloading? |
|
Answer» Objective-C doesn't support technique overloading. Thus you have GOT to USE TOTALLY different technique names. |
|
| 43. |
What major changes released in iOS7, iOS8, iOS9+? |
| Answer» | |
| 44. |
What are the different types of iOS Application States: Not running, Inactive, Active, Background, Suspended. |
|
Answer» The application has not been propelled or was running but instead was ended by the framework.
The application is running in the foreground area yet is presently not getting events. It might execute other code, however. An application typically remains in this state just quickly as it changes to an alternate state.
The application is running in the foreground area and is accepting events. This is the ordinary mode for frontal area APPLICATIONS.
The application is out of sight and executing code. Most applications enter this state quickly on their approach to being suspended. In any case, an application that demands ADDITIONAL EXECUTION time may stay in this state for a TIMEFRAME. What's more, an application being launched directly into the background enters this state rather than the idle state. For data about how to execute code while out of sight, see Background Execution.
The application is in the background yet isn't executing code. The framework moves applications to this state NATURALLY and does not inform them before doing as such. While suspended, an application stays in memory yet does not execute any code. |
|
| 45. |
Differentiate ‘app ID’ from ‘bundle ID.’ Explain why they are used? |
|
Answer» An App ID is a two-section string WANT to build up one or a lot of applications from one advancement GROUP. The string comprises of a Team ID, and a pack ID seeks string, with a period (.) isolating the 2 components. The Team ID is provided by Apple and is exclusive to a SELECTED development team, whereas the bundle ID search string is provided by the developer to match either the bundle ID of one app or a collection of bundle IDs for a bunch of apps. As a result of the majority consider the App ID as a string, they SUPPOSE it's interchangeable withBundle ID. It seems this manner as a result of once the App ID is formed within the Member Center, you merely ever use the App ID Prefix that matches the Bundle ID of the applying Bundle. The bundle ID unambiguously defines every App. it's laid out in Xcode. One Xcode project will have multiple Targets and thus output different apps. A typical use case for this can be associate degree app that has each lite/free and pro/full versions or is branded in various ways that. |
|
| 46. |
What is the purpose of reuseIdentifier? What is the benefit of setting it to a non-nil value? |
|
Answer» It groups together similar rows that differ in content, but have similar layouts in a UITableView. A UITableView ALLOCATES SUFFICIENT UITableViewCell objects to just DISPLAY the content that is visible in the table. |
|
| 47. |
What is Category and class extension? How these differ? |
|
Answer» Category: You rarely utilize a classification to ADD strategies to a current class, for example, one characterized in the Cocoa systems. The consolidated procedures are acquired by subclasses and are vague at runtime from the first techniques for the class. You can likewise utilize classifications of your own classes to Distribute the usage of your private classes into independent source files — for example; you could ASSEMBLE the techniques for an expansive class into a few classes and put every class in an ALTERNATE record. Announce private procedures. Extension - Extensions add new usefulness to a current class, structure, count, or convention type. This incorporates the capacity to broaden TYPES for which you do not approach the original source code (known as retroactive DEMONSTRATING). Expansions are like classifications in Objective-C. (Unlike Objective-C types, Swift extensions do not have names.) |
|
| 48. |
Name the framework that is used to construct application’s user interface for iOS? |
|
Answer» You can use the UIKit FRAMEWORK to develop application’s UI. This framework PROVIDES drawing model, event handling, views, windows and controls, designed for touch SCREEN interfaces. |
|
| 49. |
What JSON Framework supported by iOS? |
|
Answer» SBJson structure is UPHELD by iOS. It is a JSON PARSER and GENERATOR for Objective-C. SBJson gives adaptable APIS and extra control that makes JSON taking care of simpler. |
|
| 50. |
What are the lifecycle events of UIViewController? |
|
Answer» There are some events of the UI view controller:-
This event creates the view that the controller manages. It’s only known as once the view controller is made programmatically. This makes it a superb place to create your views in code.
If just in case the reader of current viewController has not been set nevertheless then this methodology can load the view; however bear in mind, this is OFTEN solely out there in iOS >=9.0. Thus if you're supporting iOS <9.0 then do not expect it to come back into the image.
The viewDidLoad event is merely known as once the view is made and loaded into memory. However, the bounds for the view aren't outlined nevertheless. This is often a superb place to initialize the objects that the view controller goes to use.
This event notifies the view Controller whenever the view seems on the screen. During this step, the read has bounds that are outlined. However, the orientation isn't set.
This is the primary step within the lifecycle wherever the boundaries are finalized. If you're not victimization constraints or Auto Layout, you most likely wish to update the subviews here. This is often solely out there in iOS >=5.0. Thus if you're supporting iOS <5.0 then do not expect it to come back into the image.
This event notifies the view controller that the subviews are got the wind off. It’s a superb place to form any changes to the subviews once they need to be set. This is often only out there in iOS >=5.0. Thus if you're supporting iOS <5.0 then do not expect it to come back into the image.
The viewDidAppear occasion fires after the view are introduced on the screen. Which makes it an amazing place to get information from a backend ADMINISTRATION or database.
The ViewWillDisappear occasion fires when the PERSPECTIVE on introduced see controller is going to DISAPPEAR, reject, spread or hole up behind other viewController. This is a correct place where you can confine your system calls, negate clock or discharge objects which are bound to that viewController.
This is the final step of the lifecycle that anybody can address as this occasion fires soon after the perspective on exhibited see controller has been DISAPPEARED, rejected, secured or covered up. |
|