InterViei

  • Upload
    hemant

  • View
    5

  • Download
    3

Embed Size (px)

DESCRIPTION

Questions

Citation preview

link-https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011210-CH1-SW1http://stackoverflow.com/questions/13421361/self-propertyname-vs-propertyname-in-objective-chttp://stackoverflow.com/questions/9859719/objective-c-declared-property-attributes-nonatomic-copy-strong-weakhttp://stackoverflow.com/questions/9262535/explanation-of-strong-and-weak-storage-in-ios5https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaEncyclopedia/Outlets/Outlets.htmlhttp://www.cs.colorado.edu/~kena/classes/5448/f12/presentation-materials/myrose.pdfProperty:Suppose there is an atomic string property called "name", and if you call [self setName:@"A"] from thread A, call [self setName:@"B"] from thread B, and call [self name] from thread C, then all operation on different thread will be performed serially which means if one thread is executing setter or getter, then other threads will wait. This makes property "name" read/write safe but if another thread D calls [name release] simultaneously then this operation might produce a crash because there is no setter/getter call involved here. Which means an object is read/write safe (ATOMIC) but not thread safe as another threads can simultaneously send any type of messages to the object. Developer should ensure thread safety for such objects.If the property "name" was nonatomic, then all threads in above example - A,B, C and D will execute simultaneously producing any unpredictable result. In case of atomic, Either one of A, B or C will execute first but D can still execute in parallel.strong (iOS4 = retain ) -it says "keep this in the heap until I don't point to it anymore" -in other words " I'am the owner, you cannot dealloc this before aim fine with that same as retain" -You use strong only if you need to retain the object. -By default all instance variables and local variables are strong pointers. -We generally use strong for UIViewControllers (UI item's parents) -strong is used with ARC and it basically helps you , by not having to worry about the retain count of an object. ARC automatically releases it for you when you are done with it.Using the keyword strong means that you own the object.weak (iOS4 = unsafe_unretained ) -it says "keep this as long as someone else points to it strongly" -the same thing as assign, no retain or release -A "weak" reference is a reference that you do not retain. -We generally use weak for IBOutlets (UIViewController's Childs).This works because the child object only needs to exist as long as the parent object does. -a weak reference is a reference that does not protect the referenced object from collection by a garbage collector. -Weak is essentially assign, a unretained property. Except the when the object is deallocated the weak pointer is automatically set to nilassign -assign is the default and simply performs a variable assignment -assign is a property attribute that tells the compiler how to synthesize the property's setter implementation -I would use assign for C primitive properties and weak for weak references to Objective-C objects.unsafe_unretained-unsafe_unretained is an ownership qualifier that tells ARC how to insert retain/release calls -unsafe_unretained is the ARC version of assign. Final Link:http://rdcworld-iphone.blogspot.in/2012/12/variable-property-attributes-or.htmlhttp://stackoverflow.com/questions/2255861/property-and-retain-assign-copy-nonatomic-in-objective-chttp://rdcworld-iphone.blogspot.in/2012/12/variable-property-attributes-or.htmlhttp://stackoverflow.com/questions/2255861/property-and-retain-assign-copy-nonatomic-in-objective-cQuestionsMemory concept, CFLoopnonatomic. atomic, copy, mutable copy, Assign and weak me diff,http://sarojsblog.blogspot.in/2011/07/difference-between-copy-and-mutablecopy.htmlhttp://sarojsblog.blogspot.in/2011/07/difference-between-copy-and-mutablecopy.htmlhttps://iphonecodecenter.wordpress.com/2013/08/26/difference-between-shallow-copy-and-deep-copy/core data & sqlite me difflife cycle of Apphttp://stackoverflow.com/questions/6519847/what-is-the-life-cycle-of-an-iphone-applicationhttp://www.dummies.com/how-to/content/basics-of-states-in-the-lifecycle-of-an-ios-app.htmlHow an iOS Application Responds to Interrupts like SMS, Incoming Call, Calendar, etc.?When the Active application is interrupted by an incoming phone call, SMS, or calendar notification, the application moves to the inactive state temporarily.It remains in this state until the user decides whether to accept or ignore the interruption.If the user ignores the interruption, the application is reactivated.If the user accepts the interruption, the application moves into the suspended state.life cycle of a Viewhttps://medium.com/@SergiGracia/ios-uiviewcontroller-lifecycle-261e3e2f6133Push NotificationsDesign patternshttp://www.cse.chalmers.se/research/group/idc/ituniv/courses/10/iphonedev/le3.pdfhttp://www.raywenderlich.com/46988/ios-design-patternsCreational: Singleton and Abstract Factory.Structural: MVC, Decorator, Adapter, Facade and Composite.Behavioral: Observer, Memento, Chain of Responsibility and Command.KVO and KVC me diffMain feature of Objective-c multiple server request kese kare geconcurrent request to client sirverNSArray & CFArray, NSDictionary & CFDictionary diffinternal mechanism of NSDictionary,Memory heap me how variables are stored. What is stored in stack and what is stored in heapcopyWith Zoneformal and informal protocolssearchingWhat does SetNeedsToDisplay Does. layout and other related methods related to ViewCOntrollerDiff b/w Objective C and C++Class and Struct diffAbstraction and OPPSConstraints in Core data, advantages of core dataIBOutlet weak in Xib conceptif u receive a call or open notification centre above ur app what state it goes in.NSURlConnection GCD and NSOperation Queue diffHow to save Model in NSUSerDefaults1. CGD and sync and a sync2. categories and extensions3. NSURLCOnnection4. object and instance diff5. Push notifications functionality and architecture6. In App purchase functionality7. tableview delegate methods and data source8. SD web cache images kahan save kite hai9. Image processing k liyea apple ki library10. Difference between SOAP and REST. JSON ko NSJSOnSerilization parse krta hai den how RESt apis are fast?11. delegate and notifications me difference12. strong and assign me difference. are weak and assign same?13. App Store- app submission related questions14. iOS 7 & 8 new features15, how u get access to particular view of storyboard16. blocks17. core data & sqlite18. Life cycle of app and view19. Procedure of app signing and certificate and how it is identified which app needs to be installed on device20-Why is difference between NSCache and Document directory.- (void)viewDidLoad{[super viewDidLoad];// Do any additional setup after loading the view, typically from a nib.NSLog(@"--Hello--"); NSLog(@"Step 1: view did load");}- (void)viewWillAppear:(BOOL)animated{[super viewWillAppear:animated];NSLog(@"Step 2: view will appear");}- (void)viewDidAppear:(BOOL)animated{[super viewDidAppear:animated];NSLog(@"Step 3: view did appear");}- (void)viewWillDisappear:(BOOL)animated{[super viewWillDisappear:animated];NSLog(@"Step 4: view will disappear");}- (void)viewDidDisappear:(BOOL)animated{[super viewDidDisappear:animated];NSLog(@"Step 5: view did disappear");NSLog(@"--Bye--");}+(ExClass *) singleton{static ExClass *sharedInstance = nil;if ( sharedInstance == nil){sharedInstance = [[ExClass alloc] init];}return sharedInstance;}Beyond that, here are a few differences off the top of my head:Objective C uses message passing to execute methods on objects, so the object on which the method will be called is always decided at runtime. In C++, the compiler tries to decide at compile time on what object a method will be called.C++ has multiple inheritance. Objective C does notObjective C has protocols, which is a language facility to specify an interface that one must implement if they are to adhere to a protocol. A class can adhere to as many protocols as it wants. C++ uses pure virtual methods and multiple inheritance to achieve the same goalObjective C has categories, which allows you to add or replace methods on a class that already exists. C++ has no such facility//Using GCD+ (LibraryAPI*)sharedInstance{ // 1 static LibraryAPI *_sharedInstance = nil; // 2 static dispatch_once_t oncePredicate; // 3 dispatch_once(&oncePredicate, ^{ _sharedInstance = [[LibraryAPI alloc] init]; }); return _sharedInstance;}http://code.tutsplus.com/tutorials/core-data-from-scratch-core-data-stack--cms-20926Sr S/W Eng1. What steps you followed to convert iOS 6 compatible app to make it work for iOS 7?2. Any quick way to convert iOS 6 app to iOS 7.3. What are deltas in iOS?4. What is difference between ARC and Garbage collector?5. When you plan to start a project, will you prefer to use ARC or manually memory management?6. With ARC, is it guaranteed that there will be no leaks?7. What are disadvantages of ARC?8. What are __bridge, __bridge_transfer, __bridge_retained, __unsafe_unretained:.9. What are threads in Objective-C. What are thread types like UI thread and background thread? How you create a new thread ?10. If you want to update UIWebView, will you perform this operation in main thread or background thread?11. Can you perform main thread or UI thread operation in background thread?12. If you want to download 10 MB file quickly from remote server, how you will tackle this issue?13. Write custom setter for assign,retain,copy .14. Difference between error and exception?15. How you handle exceptions in objective-C applications?16. Have you used blocks? What are their advantages?17. Advantages of using storyboard? Can we use multiple storyboards in one application?18. What design patterns that you used in Objective-C?19. What are protocols in Objective-C. How delegation works?20. Differentiate between KVO, Notifications, Delegate? Describe in which scenario you will prefer which technique?21. What are push notifications? For example you have 100 users in app and you want to send notification to 20 users, how you will do it. Describe flow in terms of push notifications?22. Is Core Data multi threaded? How will you handle multi threading in Core Data?23. We have already application on Appstore and we want to add one entity to our core data and we also dont want to crash existing users applications and integrate this also. How you will solve this problem?24. If you want to design an app which takes data from webservices ,parse data and dump it into core data? What technique you will use to design such app?25. You have audio or video file to upload to remote server through webservice. Give a solution to upload file quickly and without blocking other flows of applications?26. How you gather analytics of applications?27. View Controller life cycle method execution sequence?28. Any changes in view controller life cycle methods in iOS 6 or iOS 7?29. What problem you face when you run iOS 6 app on iOS 7 ?30. How you design architecture for RESTful services based app?31. There are multiple libraries for handling Web requests like (ASIHTTP, AFNetworking, REST Kit). Which one you have used and your preference?32. If You say you have worked with REST Kit they will ask questions regarding RestKit for example describe flow of sending request, receiving response, mapping.33. If you have web request with 50 different urls, how you design a solution for this in RestKit?App This:http://spvarma.blogspot.in/2012/07/ios-interview-questions-part-2.htmlInterview Latest:http://www.geekinterview.com/Interview-Questions/iOShttp://ideezumapp.maps.arcgis.com/home/@interface LoginViewController : UIViewController@property (weak, nonatomic) IBOutlet UITextField *loginField;@property (weak, nonatomic) IBOutlet UITextField *passField;- (IBAction) login;- (IBAction) registerUser;@endImportant Links:https://www.linkedin.com/groups/Hi-I-faced-Interview-Question-121874.S.233493617http://cocoainterviews.blogspot.in/13. Category vs InheritanceCategory allows adding methods only; no data members can be added as in Inheritance both data and methods can be added. Categorys scope is full application whereas inheritances scope that particular file. However in new compilers using associatedObjects you can add data members using category. Dynamic typingdetermining the class of an object at runtime Dynamic bindingdetermining the method to invoke at runtime Dynamic loadingadding new modules to a program at runtime31. @property @synthesize @dyanamic Properties are a feature in Objective-C that allow us to automatically generate accessors The@synthesizedirective automatically generates the setters and getters for us, so all we have to implement for this class is the dealloc method. @synthesize will generate getter and setter methods for your property. @dynamic just tells the compiler that the getter and setter methods are implemented not by the class itself but somewhere else (like the superclass) Uses for @dynamic are e.g. with subclasses ofNSManagedObject(CoreData) or when you want to create an outlet for a property defined by a superclass that was not defined as an outlet:34. Differnce between boxName and self.boxName.boxName: Accessing directly.self. boxName: Accessing boxName through accessors. If property/synthesize is not there it will throw error.35. What it does @synthesize boxDescription=boxName; ?Here you can use boxName or self.boxName. We cant use boxDescription.