iOS & Swift Most Important Interview Questions and Answers
Question 1. What Is Latest Xcode Version?
Answer :
The latest Xcode version is Xcode- 4.6.2 (At the time of writing this edition of book. Please refer the latest version before attending the interview)
Question 2. What Is Latest Mac Os Version?
Answer :
The latest Mac os is Mac- Mountain Lion (At the time of writing this edition of book. Please refer the latest version before attending the interview)
Question 3. What Is Ipad Screen Size?
Answer :
The ipad screen size is 1024X768
Question 4. What are the features in Ios6?
Answer :
1. Map :beautifully designed from the ground up (and the sky down)
2. Integration of Facebook with iOS
3. Shared photo streams.
4. Passbook — boarding passes, loyalty cards, retail coupons, cinema tickets and more all in one place.
5. Facetime — on mobile network as wifi.
6. Changed Phone app — *remind me later,*reply with message.
7. Mail — redesigned more streamline interface.
8. Camera with panorama .
Question 5. Who Invented Objective C?
Answer :
Objective c is invented by Broad cox and Tom Love
Question 6. What Is Cocoa And Cocoa Touch?
Answer :
Cocoa is for Mac App development and cocoa touch is for apples touch devices — that provide all development environment.
Question 7. What Is Property In Objective C?
Answer :
Property allow declared variables with specification like atomic/nonatomic, or retain/assign.
Question 8. What Is Meaning Of “copy” Keyword?
Answer :
copy object during assignment and increases retain count by 1
Question 9. What Is Meaning Of “retain” Keyword?
Answer :
Specifies that retain should be invoked on the object upon assignment. takes ownership of an object.
Question 10. What Is The Meaning Of “assign” Keyword?
Answer :
Specifies that the setter uses simple assignment. Uses on attribute of scalar type like float,int.
Question 11. What Is The Meaning Of “atomic” Keyword?
Answer :
“atomic”, the synthesized setter/getter will ensure that a whole value is always returned from the getter or set by the setter, only single thread can access variable to get or set value at a time.
Question 12. What Is The Meaning Of “nonatomic” Keyword?
Answer :
In non atomic no such guarantee that value is returned from variable is same that setter sets at same time.
Question 13. Define Fast Enumeration?
Answer :
Fast enumeration is a language feature that allows you to enumerate over the contents of a collection. (Your code will also run faster because the internal implementation reduces message send overhead and increases pipe lining potential.)
Question 14. What Is The Meaning Of “synthesize” Keyword?
Answer :
In this keyword specifies the ask the compiler to generate the setter and getter methods according to the specification in the declaration.
THIS QUESTION ANSWERS ARE TAKEN FROM THE BOOK
Question 15. What Is “protocol” On Objective C?
Answer :
A protocol declares methods that can be implemented by any class. Protocols are not classes themselves. They simply define an interface that other objects are responsible for implementing. Protocols have many advantages. The idea is to provide a way for classes to share the same method and property declarations without inheriting them from a common ancestor.
Question 16. What Is Use Of Uiapplication Class?
Answer :
The UIApplication class implements the required behavior of an application.
Question 17. What Type Of Compilers Apple Using?
Answer :
The Apple compilers are used based on the compilers of the GNU Compiler Collection.
Question 18. What Is Synchronized() Block In Objective C? What Is The Use Of That?
Answer :
The @synchronized()directive locks a section of code for use by a single thread. Other threads are blocked until the thread exits the protected code.
Question 19. What Is The Use Of “dynamic” Keyword?
Answer :
Instructs the compiler not to generate a warning if it cannot find implementations of accessor methods associated with the properties whose names follow.
Question 20. Define App Bundle?
Answer :
When you build your iOS app, Xcode packages it as a bundle. A bundle is a directory in the file system that groups related resources together in one place. An iOS app bundle contains the app executable file and supporting resource files such as app icons, image files, and localized content.
Question 21. Name The Application Thread From Where Uikit Classes Should Be Used?
Answer :
UIKIT classes should be used only from an application’s main thread.
Note: The derived classes of UIResponder and the classes which manipulate application’s user interface should be used from application’s main thread.
Question 22. What Is The Main Difference Between Nsarray And Nsmutablearray ?
Answer :
NSArrayʼs contents can not be modified once itʼs been created whereas a NSMutable Array can be modified as needed, i.e items can be added/removed from it.
Question 23. Explain Retain Counts?
Answer :
Retain counts are the way in which memory is managed in Objective-C. When you create an object, it has a retain count of 1. When you send an object a retain message, its retain count is incremented by 1. When you send an object a release message, its retain count is decremented by 1. When you send an object a auto release message, its retain count is decremented by 1 at some stage in the future. If an objectʼs retain count is reduced to 0, it is deallocated.
Question 24. What Is The Main Difference Between Frame And Bounds?
Answer :
The frame of a view is the rectangle, expressed as a location (x,y) and size (width,height) relative to the super view it is contained within. The bounds of a view is the rectangle, expressed as a location (x,y) and size (width,height) relative to its own coordinate system (0,0).
Question 25. What Is Outline The Class Hierarchy For A Uibutton Until Nsobject ?
Answer :
UIButton inherits from UIControl
UIControl inherits from UIView
UIView inherits from UIResponder
UIResponder inherits from the root class NSObject.
Question 26. What Are The App States. Explain Them?
Answer :
Not running State: The app has not been launched or was running but was terminated by the system.
Inactive state: 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. The only time it stays inactive for any period of time is when the user locks the screen or the system prompts the user to respond to some event, such as an incoming phone call or SMS message.
Active state: The app is running in the foreground and is receiving events. This is the normal mode for foreground apps.
Background state: 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. For information Answer :
iOS 4.0 version is supports multitasking.
Question 32. Explain The Difference Between Nsoperation Queue Concurrent And Non-concurrent?
Answer :
In the context of an NSOperation object, which runs in an NSOperation Queue, the terms concurrent and non-concurrent do not necessarily refer to the side-by-side execution of threads. Instead, a non-concurrent operation is one that executes using the environment that is provided for it while a concurrent operation is responsible for setting up its own execution environment.
Question 33. What Are The Features Of Iphone 3gs?
Answer :
Video: Videos can be edited, shared. High quality VGA video can be shot in portrait or landscape.
3 Mega pixel Camera: Still photos with greater quality can be taken.
Voice control: It recognizes the names in contacts and recognizes the music on iPod.
Compass: iPhone 3GS has built-in digital compass, used to point the way.
Internet Tethering: Internet surfing can be done from anywhere. A 3G connection can be shared on iphone3 with Mac notebook or laptop.
Question 34. Why Iphone Apps Are Popular?
Answer :
Give our business a whole new way of transacting business for millions of users. iPhones are the market leaders in the smart phone segment. The iPhone has become a great device to surf the internet, play games, interact with social networks and transact business.
Question 35. Where Can You Test Apple Iphone Apps If You Don’t Have The Device?
Answer :
iOS Simulator can be used to test mobile applications. Xcode tool that comes along with iOS SDK includes Xcode IDE as well as the iOS Simulator. Xcode also includes all required tools and frameworks for building iOS apps. However, it is strongly recommended to test the app on the real device before publishing it.
Question 36. Does Ios Support Multitasking?
Answer :
iOS 4 and above supports multitasking and allows apps to remain in the background until they are launched again or until they are terminated.
Question 37. What Is The Nscoder Class Used For?
Answer :
NSCoder is an abstract Class which represents a stream of data. They are used in Archiving and Unarchiving objects. NS Coder objects are usually used in a method that is being implemented so that the class conforms to the protocol. (which has something like encode Object and decode Object methods in them).
Question 38. What Is Iphone Os?
Answer :
iPhone OS runs on iPhone and iPod touch devices.
Hardware devices are managed by iPhone OS and provides the technologies needed for implementing native applications on the phone.
The OS ships with several system applications such as Mail, Safari, Phone, which provide standard services to the user.
Question 39. What Is The Difference Between Shallow Copy And Deep Copy?
Answer :
Shallow copy is also known as address copy. In this process you only copy address not actual data while in deep copy you copy data.
Suppose there are two objects A and B. A is pointing to a different array while B is pointing to different array. Now what I will do is following to do shallow copy. Char *A = {‘a’,’b’,’c’}; Char *B = {‘x’,’y’,’z’}; B = A; Now B is pointing is at same location where A pointer is pointing.Both A and B in this case sharing same data. if change is made both will get altered value of data.Advantage is that coping process is very fast and is independent of size of array.
while in deep copy data is also copied. This process is slow but Both A and B have their own copies and changes made to any copy, other will copy will not be affected.
Question 40. What Are The Requirements For Developing Iphone Apps?
Answer : Mac OS 10.5/10.6 iPhone SDK (Software Development Kit 3.0/4.0).
IPhone SDK consists of:
a. IDE to develop iPhone Apps is XCode(This tool is inbuilt in iPhone SDK)
b. Interface Builder This is used to design GUI of Apps(Inbuilt feature of iPhone SDK)
c. Instruments This is used to check any memory leaks in our apps (Inbuilt in SDK)
d. Simulator This is used to test our apps before deploying into real device.
Question 41. What Are The Popular Apps Of Iphone?
Answer :
iphone apps are
a. Facebook-Social networking
b. Doodle Buddy-drawing
c. Pandora Radio-radio on our iPhone
d. Help-restaurant reviews
Question 42. What Is Iphone Reference Library?
Answer :
iPhone reference library is a set of reference documents for iPhone OS. It can be downloaded by subscribing to the iPhone OS Library doc set. Select Help>Documentation from X code, and click the subscribe button next to the iPhone OS Library doc set, which appears in the left column.
Question 43. What Is Iphone Sdk?
Answer :
iPhone SDK is available with tools and interfaces needed for developing, installing and running custom native applications. Native applications are built using the iPhone OS’s system frameworks and Objective-C language and run directly on iPhone OS. Native applications are installed physically on a device and can run in presence or absence of network connection.
Question 44. What Is Iphone Architecture?
Answer :
iPhone architecture is similar to Mac OS X architecture
It acts as an intermediary between the iPhone and iPod hardware an the appearing applications on the screen.
The user created applications never interact directly with the appropriate drivers, which protects the user applications from changes to the hardware.
Question 45. What Are The Location Services?
Answer :
Applications such as Maps, camera and compass are allowed to use the information from cellular, WiFi and Global Positioning System networks for determining the approximate locations.
The location is displayed on the screen, using a blue marker.
Question 46. Describe The Functionality Of Accelerometer Of An Iphone?
Answer :
iPhone responds to motion using a built-in accelerometer. The accelerometer detects the movement and changes the display accordingly, at the time of rotating iPhone from portrait to landscape.
THIS QUESTION ANSWERS ARE TAKEN FROM THE BOOK
Question 47. What Is Synchronous Vs. Asynchronous In Gcd?
Answer :
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.
Question 48. What Is Mvc?
Answer :
MVC is a design pattern that stands for Model View Controller. This design pattern separates the data from its display, mediated by a View Controller.
Question 49. What Are Delegates?
Answer :
Delegates are a design pattern. A delegate is just an object that another object sends messages to when certain things happen.
Question 50. What Is Core Data?
Answer :
Core Data is an object graph manager, which also has the ability to persist object graphs to a persistent store, on a disk.
for more IT stuff go here
Comments
Post a Comment