iOS interview questions
iOS is a mobile operating system designed, developed and distributed by Apple, it runs on Apple's devices like iphones, ipads, ipods touch or Apple TVs, and unlike Windows CE or Android is not licensed to be installed on a not apple device. On this section you are going to find a very useful compilation of iOS interview questions, so if you are an interviewer or an applicant then this website is perfect for you.
iOS interview questions and answers
What is iOS?
Besides all written above, the control elements on iOS interfaces are formed by sliders, switches and buttons.
What's fast enumeration?
It is a language feature that allows you to enumerate the contents of a collection, thanks to the internal implementation; your code will run faster.
What are the differences between categories and extensions?
- Categories: Allows you to add methods on existing classes.
- Extensions: Allows you to increase the functionality (extend) of an existing class without using subclasses.
What is a singleton?
A singleton class returns the same instance always, but take into account that there can exist only one instance of this class per process, are ideal to offer a general resource or service.
Name and explain the iOS app states.
- Not Running: The app was running but was terminated, or was not launched.
- Inactive: The app is running in the foreground, but is not receiving any events, apps turn into this state for several reasons, it can be transitioning to another state, if the user locks the screen, calls or receives a call or SMS.
- Active: The app is receiving events and is running in the foreground.
- Background: Apps go to this state before being terminated, they are in the background but still execute code. You should know that this is not the only reason, they can go this state also to be launched directly from this state, so they do not need to turn into inactive state.
- Suspended: Apps in this state are in the background but are not executing code, the system do not notify before doing this and apps are still in memory.
What are the memory management rules?
As its name indicates, are rules that help you to explicit manage the memory.
Name the memory management rules and their related methods.
- The object you created is owned by you by allocating memory for it, or is owned by you by copying it.
Related Methods: alloc, allocWithZone, copy, copyWithZone, mutableCopy, mutableCopyWithZone.
- If you are not the creator of an object but you want it to stay in memory, you can express an ownership interest.
Related Methods: retain.
- If you created or expressed ownership interest on an object, and now you are its owner, then you are responsible to release it once you don't need it anymore.
Related Methods: release, autorelease.
- If you are not the owner of an object (you did not created it or did not expressed ownership interest) then you must not release it.
Explain why delegates and notifications are different.
Notifications inform other objects about program events and they react after the event occurs.
Delegations provide the chance to reject or modify the proposed operation.
What is lazy loading?
It is very popular in computer programming, it consists in loading the elements only when they are needed, the rule says something similar to: "do not load anything until you have to load it".
Explain shallow copying and depth copying.
According to apple's definition:"A deep copy duplicates the objects referenced while a shallow copy duplicates only the references to those objects".
What is a struct?
Struct is a special data type which encapsulates into only one cohesive unit other pieces of data.
Is the object retained if I call performSelector:withObject:afterDelay:?
Very simple question. Yes.
What is posing in iOS?
Into iOS, you can replace a entirely class with another one, so it is said that the class "pose as" the other class (the target one).
Where do you test the developed apps if you do not have the device?
You can test them on an iOS simulator, for example the Xcode tool comes with a iOS simulator.
Does iOs supports multitasking?
Yes, allows multitasking and allows apps to stay in the background.
What is the use of the UI Automation API?
What is UIApplication?
Is a object controller, it manages the application event loop without subclassing.
What happens when IApplication does not handle an event?
The event is dispatched to the app delegate.
Remember to focus your preparation on the specific requirements, that way you will be ready not only in the things you know, but also in the specific requirements, the same goes for interviewers, focus the iOS interview questions on the company's requirements, this way you will find the employee you need.