Interview questions and answers

  1. What is category? Can you have properties or ivars in a category?
  2. What is protocol? What is formal and informal protocol?
  3. What is ARC? Is it garbage collection?
  4. Difference between atomic and nonatomic properties?
  5. Difference between strong and retain?
  6. What is unsafe_unretained? Difference between unsafe_unretained, assign and weak?
  7. What does a copy property do? Is it deep copy or shallow copy?
  8. Does ObjectiveC have function overloading?
  9. What is messaging? How does the runtime handle message passing? What is message forwarding?
  10. What is 'id'?
  11. What is performSelector:withObject:? What if I have to performSelector:withObject:but pass 3-4 arguments to the method? (Hint: NSInvocationOperation)
  12. What is delegate? Can delegates be retained?
  13. What is retain cycle?
  14. Does ObjectiveC have multiple inheritance? Why not? How to imitate multiple inheritance?
  15. What is class extension? Why do we require them?
  16. Who calls dealloc method? Can we implement dealloc in ARC? If yes, what is the need to do that?
  17. Can you write setter method for a retain property?
  18. Can you write a singleton class in ObjectiveC?
  19. What is GCD? What are advantages over NSThread?
  20. What is NSOperation and NSOperationQueue?
  21. How does dispatch_once manages to run only once?
  22. What are blocks?
  23. What are NSAutoreleasePool? When to use them?
  24. Does a thread created using performSelectorInBackground:withObject: creates its own autorelease pool?
  25. ObjectiveC is dynamic language? True/False, explain.
  26. An NSArray containing Employee model object which has properties like empId, salary, age, designation, rating etc. Write a function that,
  1. Returns average salary
  2. Returns minimum age
  3. Returns maximum rating
Purpose of this question is to know if candidate knows about collection operators: Key-Value Coding Programming Guide

iOS questions

  1. What is the output binary format? Explain .app structure.
  2. What are the CPU architectures supported by iOS devices?
  3. What iOS version onwards ARC can be used?
  4. Can we support same application for iPhone3GS and iPhone5? Why not?
  5. Can I write some C++ function in same .m file? Will it compile? If no, what changes should I do to compile it?
  6. What are the types of iOS binaries you can create using XCode? (.app, .ipa, .a, .framework)
  7. Can a static library (.a) contain resources like images, sound files etc?
  8. What is bundle?
  9. Explain application life cycle.
  10. What is responder chain?
  11. Tell me hierarchy of UIButton.
  12. Why create a custom view?
  13. Why UIControl is provided if we can create custom UIView?
  14. What are lifecycle events of UIViewController?
  15. Difference between viewDidLoad and viewDidAppear?
  16. Is UIKit thread safe?
  17. Why do we override drawRect: method?
  18. What are layers?
  19. What are various singleton instances provided by frameworks? (UIApplication,NSFileManagerNSUserDefaults, etc.)
  20. What is NSUserDefaults? What type of data can we store there?
  21. How do you check if your code has memory leaks?
  22. What does static analyser do?
  23. What are different Instruments Xcode supports for app profiling?
  24. Concepts of notification center, local and remote notifications.
  25. Have you uploaded app on Appstore? What is the process?
  26. Difference between Developer and Enterprise Developer accounts?
  27. Common reasons for app rejection from Appstore review process?
  28. UITableView cell reuse. How to get it working (w/ or w/o XIB)? How would you implement reuse on a UIScrollView?

Few questions on CoreData which I may ask in an interview to some one brave enough to venture :) 

  1. How do you setup/initialise a core data stack in your application? Is this activity performed on main thread? If not, why?
  2. What is NSPersistentStoreCoordinator? What duties does it perform?
  3. What is NSPersistentStore? Is it thread safe?
  4. What is NSManagedObjectContext? What are the different concurrency types? Explain them.
  5. Different types of persistent stores? Which all types can we have on iOS?
  6. Can my application have multiple models? (Yes)
  7. In a single model, can I have few entities in one sqlite db file and remaining  in another sqlite db file? (Yes, Hint: configurations)
  8. What are the different store migration options? When are they used? How do they work? What is mapping model?
  9. Explain parent-child context setup. How does it work? What are the advantages?
  10. What is difference between performBlock: and performBlockAndWait:?
  11. Are the NSManagedObjectContext queues serial or concurrent?
  12. Can you pass same core data objects between different threads and modify?
  13. What performance issues can you face when using CoreData?
  14. What is NSFetchedResultsController? How do you turn on content monitoring?
  15. 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)
  16. What are the different delete rules that a relationship can have? Which one takes ownership?
  17. In NSFetchRequest can we fetch only a selective few attributes of an entity? How?
  18. Can I have relationship between entities in separate stores (in case of configurations)? (No)
  19. What are fetched properties? How do you create a fetched property?
  20. What does $FETCH_SOURCE and $FETCHED_PROPERTY in the predicate mean?
  21. Why do all model object attributes get marked with @dynamic and not synthesised? What does @dynamic mean?
  22. When a NSFetchRequest fetches an entity object from store, does it fetch all of its data at once?
  23. What is a fault?
  24. What are transient properties?

2 Comments

Previous Post Next Post