iOS Interview Questions and Answers, iOS Interview Questions and Answers Freshers, iOS Interview Questions and Answers, iOS Interview Questions
Before getting on to the iOS interview questions, the student must know that the iOS is a continuously varying field which needs the students as well as professionals to upgrade their skills with the new features and knowledge, to get fit for the jobs associated with iOS. This post related to iOS Interview Questions and Answers, iOS Interview Questions and Answers Freshers, iOS Interview Questions and Answers, iOS Interview Questions will help you let out find all the solutions that are frequently asked in you upcoming iOS interview.
Over thousands of vacancies available for the iOS developers, experts must be acquaintance with all the component of iOS technologies. This is necessary for the students in order to have in-depth knowledge of the subject so that they can have best employment opportunities in the future. Knowing every little detail about iOS is the best approach to solve the problems linked with problem.
APTRON has spent hours and hours in researching about the iOS Interview Questions and Answers, iOS Interview Questions and Answers Freshers, iOS Interview Questions and Answers, iOS Interview Questions that you might encounter in your upcoming interview. All these questions will alone help you to crack the interview and make you the best among all your competitors.
First of all, let us tell you about how the iOS technology is evolving in today’s world and how demanding it is in the upcoming years. In fact, according to one study, most of the companies and businesses have moved to the iOS . Now, you cannot predict how huge the future is going to be for the people experienced in the related technologies.
Hence, if you are looking for boosting up your profile and securing your future, iOS will help you in reaching the zenith of your career. Apart from this, you would also have a lot of opportunities as a fresher.
These questions alone are omnipotent. Read and re-read the questions and their solutions to get accustomed to what you will be asked in the interview. These iOS interview questions and answers will also help you on your way to mastering the skills and will take you to the giant world where worldwide and local businesses, huge or medium, are picking up the best and quality iOS professionals.
This ultimate list of best iOS interview questions will ride you through the quick knowledge of the subject and topics like iPhone SDK, the iPhone Simulator, Transitioning to Objective-C. This iOS interview questions and answers can be your next gateway to your next job as a iOS expert.
These are very Basic iOS Interview Questions and Answers for freshers and experienced both.
Q1: IOS Characteristics
A1:
Criteria | Result |
Type of Operating System | Apple Proprietary based on Macintosh OS X |
OS Fragmentation | Tightly integrated with Apple devices |
Security | Heightened security guaranteed |
Q2: What JSON framework is supported by iOS (iPhone OS)?
A2:
- SBJson framework is supported by iOS. It is a JSON parser and generator for Objective-C (Objective-C is the primary programming language you use when writing software for OS X and iOS. It’s a superset of the C programming language and provides object-oriented capabilities and a dynamic runtime).
- SBJson provides flexible APIs and additional control that makes JSON handling easy.
Q3: How can we prevent iOS 8 app’s streaming video media from being captured by QuickTime Player on Yosemite during screen recording?
A3: HTTP Live Streams that have their media encrypted will not be recorded by QuickTime Player on Yosemite while screen recording. These will black out in the recording.
• HTTP Live Streaming: – Send live and on‐demand audio and video to iPhone, iPad, Mac, Apple TV, and PC with HTTP Live Streaming (HLS) technology from Apple. Using the same protocol that powers the web, HLS lets you deploy content using ordinary web servers and content delivery networks. HLS is designed for reliability and dynamically adapts to network conditions by optimizing playback for the available speed of wired and wireless connections.
Q4: How can you respond to state transitions on your app?
A4: State transitions can be responded to state changes in an appropriate way by calling corresponding methods on app’s delegate object.
For example:
applicationDidBecomeActive( ) method can be used to prepare to run as the foreground app.
applicationDidEnterBackground( ) method can be used to execute some code when the app is running in the background and may be suspended at any time.
applicationWillEnterForeground( ) method can be used to execute some code when your app is moving out of the background
applicationWillTerminate( ) method is called when your app is being terminated.
Q5: What is the difference between atomic and non-atomic properties? Which is the default for synthesized properties? When would you use one over the other?
A5:
- Properties specified as atomic are guaranteed to always return a fully initialized object. This also happens to be the default state for synthesized properties.
- While it’s a good practice to specify atomic to remove the potential for confusion, if you leave it off, your properties will still be atomic.
- This guarantee of atomic properties comes at the cost of performance.
- However, if you have a property for which you know that retrieving an uninitialized value is not a risk (e.g. if all access to the property is already synchronized via other means), setting it to non-atomic can boost performance.
Q6: Does Objective-C contain private methods?
A6:
• NO, there is nothing called a private method in Object-C programming. If a method is defined in .m only then it becomes protected. If in .h,it is public.
If you really want a private method then you need to add a local category/ unnamed category/ class extension in the class and add the method in the category and define it in the class.m.
Q7: How could you setup Live Rendering ?
A7: The attribute @IBDesignable lets Interface Builder perform live updates on a particular view.
Q8: What is the difference between Synchronous & Asynchronous task ?
A8: Synchronous: waits until the task has completed Asynchronous: completes a task in background and can notify you when complete
Q9: What Are B-Trees?
A9: B-trees are search trees that provide an ordered key-value store with excellent performance characteristics. In principle, each node maintains a sorted array of its own elements, and another array for its children.
Q10: What is made up of NSError object?
A10: There are three parts of NSError object a domain, an error code, and a user info dictionary. The domain is a string that identifies what categories of errors this error is coming from.
Q11: What is Enum ?
A11: Enum is a type that basically contains a group of related values in same umbrella.
Q12: Why don’t we use strong for enum property in Objective-C ?
A12: Because enums aren’t objects, so we don’t specify strong or weak here.
Q13: What is @synthesize in Objective-C ?
A13: synthesize generates getter and setter methods for your property.
Q14: What is @dynamic in Objective-C ?
A14: We use dynamic for subclasses of NSManagedObject. @dynamic tells the compiler that getter and setters are implemented somewhere else.
Q15: Why do we use synchronized ?
A15: synchronized guarantees that only one thread can be executing that code in the block at any given time.
Q16: What Widgets can not do ?
A16:
• No keyboard entry
• Scroll views and multistep actions are discouraged
Q17: What are the limits of accessibility ?
A17: We can not use Dynamic Text with accessibility features.
Q18: What is ARC and how is it different from AutoRelease?
A18: Autorelease is still used ARC. ARC is used inside the scope, autorelease is used outside the scope of the function.
Q19: Explain differences between Foundation and CoreFoundation
Q19: The Foundation is a gathering of classes for running with numbers, strings, and collections. It also describes protocols, functions, data types, and constants. CoreFoundation is a C-based alternative to Foundation. Foundation essentially is a CoreFoundation. We have a free bridge with NS counterpart.
Q20: What’s accessibilityHint?
A20: accessibilityHint describes the results of interacting with a user interface element. A hint should be supplied only if the result of an interaction is not obvious from the element’s label.
Q21: Explain place holder constraint
A21: This tells Interface Builder to go ahead and remove the constraints when we build and run this code. It allows the layout engine to figure out a base layout, and then we can modify that base layout at run time.
Q22: Are you using CharlesProxy ? Why/why not ?
A22: If I need a proxy server that includes both complete requests and responses and the HTTP headers then I am using CharlesProxy. With CharlesProxy, we can support binary protocols, rewriting and traffic throttling.
Q23: What are different ways that you can specify the layout of elements in a UIView?
A23: Here are a few common ways to specify the layout of elements in a UIView:
- Using InterfaceBuilder, you can add a XIB file to your project, layout elements within it, and then load the XIB in your application code (either automatically, based on naming conventions, or manually). Also, using InterfaceBuilder you can create a storyboardfor your application.
- You can your own code to use NSLayoutConstraints to have elements in a view arranged by Auto Layout.
- You can create CGRects describing the exact coordinates for each element and pass them to UIView’s – (id)initWithFrame:(CGRect)frame method.
Q24: What’s the difference between an “app ID” and a “bundle ID” and what is each used for?
A24: An App ID is a two-part string used to identify one or more apps from a single development team. The string consists of a Team ID and a bundle ID search string, with a period (.) separating the two parts. The Team ID is supplied by Apple and is unique to a specific development team, while the bundle ID search string is supplied by teh developer to match either the bundle ID of a single app or a set of bundle IDs for a group of apps.
Because most people think of the App ID as a string, they think it is interchangeable with Bundle ID. It appears this way because once the App ID is created in the Member Center, you only ever use the App ID Prefix which matches the Bundle ID of the Application Bundle.
The bundle ID uniquely defines each App. It is specified in Xcode. A single Xcode project can have multiple Targets and therefore output multiple apps. A common use case for this is an app that has both lite/free and pro/full versions or is branded multiple ways.
Q25: What are “strong” and “weak” references? Why are they important and how can they be used to help control memory management and avoid memory leaks?
A25: By default, any variable that points to another object does so with what is referred to as a “strong” reference. A retain cycle occurs when two or more objects have reciprocal strong references (i.e., strong references to each other). Any such objects will never be destroyed by ARC (iOS’ Automatic Reference Counting). Even if every other object in the application releases ownership of these objects, these objects (and, in turn, any objects that reference them) will continue to exist by virtue of those mutual strong references. This therefore results in a memory leak.
Reciprocal strong references between objects should therefore be avoided to the extent possible. However, when they are necessary, a way to avoid this type of memory leak is to employ weak references. Declaring one of the two references as weak will break the retain cycle and thereby avoid the memory leak.
To decide which of the two references should be weak, think of the objects in the retain cycle as being in a parent-child relationship. In this relationship, the parent should maintain a strong reference (i.e., ownership of) its child, but the child should not maintain maintain a strong reference (i.e., ownership of) its parent.
For example, if you have Employer and Employee objects, which reference one another, you would most likely want to maintain a strong reference from the Employer to the Employee object, but have a weak reference from the Employee to thr Employer.
Q26: Compare and contrast the different ways of achieving concurrency in OS X and iOS.
A26: There are basically three ways of achieving concurrency in iOS:
• threads
• dispatch queues
• operation queues
The disadvantage of threads is that they relegate the burden of creating a scalable solution to the developer. You have to decide how many threads to create and adjust that number dynamically as conditions change. Also, the application assumes most of the costs associated with creating and maintaining the threads it uses.
OS X and iOS therefore prefer to take an asynchronous design approach to solving the concurrency problem rather than relying on threads.
One of the technologies for starting tasks asynchronously is Grand Central Dispatch (GCD) that relegates thread management down to the system level. All the developer has to do is define the tasks to be executed and add them to the appropriate dispatch queue. GCD takes care of creating the needed threads and scheduling tasks to run on those threads.
All dispatch queues are first-in, first-out (FIFO) data structures, so tasks are always started in the same order that they are added.
An operation queue is the Cocoa equivalent of a concurrent dispatch queue and is implemented by the NSOperationQueue class. Unlike dispatch queues, operation queues are not limited to executing tasks in FIFO order and support the creation of complex execution-order graphs for your tasks.
Q27: Explain the difference between copy and retain?
A27: Retaining an object means the retain count increases by one. This means the instance of the object will be kept in memory until it’s retain count drops to zero. The property will store a reference to this instance and will share the same instance with anyone else who retained it too. Copy means the object will be cloned with duplicate values. It is not shared with any one else.
Q28: What’s the difference between not-running, inactive, active, background and suspended execution states?
A28:
- Not running: The app has not been launched or was running but was terminated by the system.
- Inactive: The app is running in the foreground but is currently not receiving events. (It may be executing other code though.) An app usually stays in this state only briefly as it transitions to a different state.
- Active: The app is running in the foreground and is receiving events. This is the normal mode for foreground apps.
- Background: The app is in the background and executing code. Most apps enter this state briefly on their way to being suspended. However, an app that requests extra execution time may remain in this state for a period of time. In addition, an app being launched directly into the background enters this state instead of the inactive state.
- Suspended: The app is in the background but is not executing code. The system moves apps to this state automatically and does not notify them before doing so. While suspended, an app remains in memory but does not execute any code. When a low-memory condition occurs, the system may purge suspended apps without notice to make more space for the foreground app.
Q29: What is a category and when is it used?
A29: A category is a way of adding additional methods to a class without extending it. It is often used to add a collection of related methods. A common use case is to add additional methods to built in classes in the Cocoa frameworks. For example adding async download methods to the UIImage class.
Q30: What is the difference between viewDidLoad and viewDidAppear?
Which should you use to load data from a remote server to display in the view?
A30: viewDidLoad is called when the view is loaded, whether from a Xib file, storyboard or programmatically created in loadView. viewDidAppear is called every time the view is presented on the device. Which to use depends on the use case for your data. If the data is fairly static and not likely to change then it can be loaded in viewDidLoad and cached. However if the data changes regularly then using viewDidAppear to load it is better. In both situations, the data should be loaded asynchronously on a background thread to avoid blocking the UI.
Q31: What is a memory leak?
A31: A memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in such a way that memory which is no longer needed is not released. In object-oriented programming, a memory leak may happen when an object is stored in memory but cannot be accessed by the running code.
Q32: Describe what “app thinning” means ?
A32: The store and operating system optimize the installation of iOS, tvOS, and watchOS apps by tailoring app delivery to the capabilities of the user’s particular device, with minimal footprint. This optimization, called app thinning, lets you create apps that use the most device features, occupy minimum disk space, and accommodate future updates that can be applied by Apple.
3 – What is auto-layout?
Auto Layout dynamically calculates the size and position of all the views in your view hierarchy, based on constraints placed on those views.
Q33: What is GCD? How is it used?
A33: GCD is the most commonly used API to manage concurrent code and execute operations asynchronously at the Unix level of the system. GCD provides and manages queues of tasks. A good example is when an App fetch data from an API, this network call should be done in a background thread and the display of the data in the view should be executed in the main thread as well as any UI updates.
Q34: What are the benefits of Swift over Objective-C ?
A34:
• Swift is easier to read. (mmm really?)
• Swift is easier to maintain.
• Swift is safer.
• Swift is unified with memory management.
• Swift requires less code.
• Swift is faster.
• Fewer name collisions with open source projects.
• Swift support dynamic libraries.
• Swift Playgrounds encourages interactive coding.
• Swift is a future you can influence.
Here is a link where you can see these assertions in detail.
Q35: What is Synchronous vs. Asynchronous in GCD ?
A35: These terms describe when a function will return control to the caller, and how much work will have been done by that point.
A synchronous function returns only after the completion of a task that it orders.
An asynchronous function, on the other hand, returns immediately, ordering the task to be done but not waiting for it. Thus, an asynchronous function does not block the current thread of execution from proceeding on to the next function.
Q36: Why do you generally create a weak reference when using self in a block?
A36: To avoid retain cycles and memory leaks.
Q37: What is encapsulation?
A37: Encapsulation is an object-oriented design principle and hides the internal states and functionality of objects. That means the objects keep their state information private.
Q38: What is dependency management?
A38: If we want to integrate open source project, add a framework from a third party project, or even reuse code across our own products, dependency management helps us manage these relationships. Cocoa Pods and carthage are good examples of this.
Q39: What is the difference between bounds and frame?
A39:
– Frame: frame of view is the rectangle, represented as a location (X,Y) and size (width/height) corresponding to the superview it is contained within.
– Bounds: the bounds of a view of a rectangle, represented as a location (X,Y) and size (width/height) corresponding to its own coordinate system (0.0)
Q40: What is the ? in Swift?
Q40: The question mark is used during the declaration of property, as it tells the compiler that this property is optional. The property may hold a value or not, in the latter case it’s possible to avoid runtime errors when accessing that property by using ?. This is useful in option changing and a variant of of this example is in conditional clues.
Q41: What is the use of double question marks (“??”) ?
A41: To provide default value for a variable.
Q42: What is the difference between let and var in Swift?
A42: Price: The let keyword is used to declare constants while var is used for declaring variables.
Q43: What is a memory leak?
A43: A memory leak is a type of resource leak that occurs when a computer program incorrectly manages allocations in such a way that memory which is no longer needed is not released. In object-oriented programing, a memory leak may happen when an object is stored in memory but can’t be accessed by running code.
Q44: What is auto-layout?
A44: Auto layout dynamically calculates the size and position of all the views in your view hierarchy based on constraints placed on those views.
iOS Conclusion Interview FAQs
We know the list of iOS Interview Questions and Answers, iOS Interview Questions and Answers Freshers, iOS Interview Questions and Answers, iOS Interview Questions is overwhelming but the advantages of reading all the questions will maximize your potential and help you crack the interview. The surprising fact is that this iOS interview questions and answers post covers all the basic of the iOS technology and you have to check out the FAQs of different components of iOS too.
However, you will be asked with the questions in the interview related to the above mentioned questions. Preparing and understanding all the concept of iOS technology will help you strengthen the other little information around the topic.
After preparing these interview questions, we recommend you to go for a mock interview before facing the real one. You can take the help of your friend or a iOS expert to find the loop holes in your skills and knowledge. Moreover, this will also allow you in practicing and improving the communication skill which plays a vital role in getting placed and grabbing high salaries.
Remember, in the interview, the company or the business or you can say the examiner often checks your basic knowledge of the subject. If your basics is covered and strengthened, you can have the job of your dream. The industry experts understand that if the foundation of the student is already made up, it is easy for the company to educate the employ towards advance skills. If there are no basics, there is no meaning of having learnt the subject.
Therefore, it’s never too late to edge all the basics of any technology. If you think that you’ve not acquired the enough skills, you can join our upcoming batch of iOS Training in Noida. We are one of the best institute for iOS in noida which provide advance learning in the field of iOS Course. We’ve highly qualified professionals working with us and promise top quality education to the students.
We hope that you enjoyed reading iOS Interview Questions and Answers, iOS Interview Questions and Answers Freshers, iOS Interview Questions and Answers, iOS Interview Questions and all the FAQs associated with the interview. Do not forget to revise all the iOS interview questions and answers before going for the iOS interview. In addition to this, if you’ve any doubt or query associated with iOS, you can contact us anytime. We will be happy to help you out at our earliest convenience. At last, we wish you all the best for your upcoming interview on iOS Technology.