📜 ⬆️ ⬇️

Questions for an interview middle / senior iOS Developer

We all went to interviews. Each time we prepare for the next interview, we review the main topics, remember the questions we were asked in previous times, or the questions we asked ourselves. Below I want to present the main questions that are often (based on personal experience) can be obtained at an interview for the position of middle / senior iOS Developer. So say, cheat sheet. At the same time, you can check your level of knowledge of the platform.

General:
- How is the abstract class different from the interface?
- Tell us about the MVC pattern. What is the difference between the passive model and the active one?
- Implementing singleton in ARC and non-ARC?
- What other patterns do you know?
- Write code that expands a line in C ++.

Networking & Multithreading:
- What is deadlock?
- What is livelock?
- What is a semaphore?
- What is a mutex?
- Asynchrony vs multithreading. What is the difference?
- Advantages and disadvantages of synchronous and asynchronous connections?
- What does http, tcp mean?
- What are the differences between HEAD, GET, POST, PUT?
- What technologies in iOS can be used to work with streams. Advantages and disadvantages.
- What is the difference between dispatch_async and dispatch_sync?
- Will the “Hello world” appear in the debager? Why?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { dispatch_sync(dispatch_get_main_queue(), ^{ NSLog(@"Hello world"); }); /* Another implementation */ return YES; } 

- What will be displayed in the console?
  NSObject *object = [NSObject new]; dispatch_async(dispatch_get_main_queue(), ^ { NSLog(@"A %d", [object retainCount]); dispatch_async(dispatch_get_main_queue(), ^ { NSLog(@"B %d", [object retainCount]); }); NSLog(@"C %d", [object retainCount]); }); NSLog(@"D %d", [object retainCount]); 

CoreData:
- What is Core Data?
- When is it better to use SQLite, and in which Core Data?
- What is a managed object context?
- What is Persistent store coordinator?
- What are the nuances when using Core Data in different streams? How to synchronize data between threads?
- Have you used NSFetchedResultsController? Why?

Objective c
- What are the root classes in iOS? What are root classes for?
- What is the isa pointer? What is it for?
- What happens to the method after it is not found in the class object to which it was called?
- How does a category differ from an extension (extention, unnamed category)?
- Is it possible to add ivar to the category?
- When is it better to use a category, and when is inheritance?
- What is the difference between using delagates and notifications?
- How is the manual memory management in iOS?
- autorelease vs release?
- What does ARC mean?
- What to do if the project is written using ARC, and you need to use the classes of a third-party library written without ARC?
- Weak vs assign, strong vs copy?
- Atomic vs nonatomic. What is the difference? How to manually override the atomic / nonatomic setter in non-ARC code?
- Why all properties referring to the delegates strong / retain. :)))
- What is autorelease pool?
- How can autorelease pool be used on c ++?
- What is the difference between NSSet and NSArray? What operations happen quickly in NSSet and which ones in NSArray?
- Formal vs informal protocol.
- Are there any private or protected methods in Objective-C?
- How to imitate multiple inheritance?
- What is KVO? When should it be used?
- What is KVC? When should it be used?
- What are blocks? What are they needed for?
- When do I need to copy a block? Who is responsible for this: caller or reciever?
- What is the designated initializer?
- What's wrong with this code? Why do we need initializers?
 [[[SomeClass alloc] init] init]; 

- How to delete an object during the iteration of the cycle?
- Does the timer work? Why?
 void startTimer(void *threadId) { [NSTimer scheduleTimerWithTimeInterval:10.0f target:aTarget selector:@selector(tick: ) userInfo:nil repeats:NO]; } pthread_create(&thread, NULL, startTimer, (void *)t); 

- Which method will be called: class A or class B? How do I change the code to call a class A method?
 @interface A : NSObject - (void)someMethod; @end @implementation A - (void)someMethod { NSLog(@"This is class A"); } @end @interface B : A @end @implementation B - (void)someMethod { NSLog(@"This is class B"); } @end @interface C : NSObject @end @implementation C - (void)method { A *a = [B new]; [a someMethod]; } @end 

- In which cases it is better to use strong, and in which copy for NSString? Why?
 @property (nonatomic, strong) NSString *someString; @property (nonatomic, copy) NSString *anotherString; 

- What will be displayed in the console? Why?
 - (BOOL)objectsCount { NSMutableArray *array = [NSMutableArray new]; for (NSInteger i = 0; i < 1024; i++) { [array addObject:[NSNumber numberWithInt:i]]; } return array.count; } - (void)someMethod { if ([self objectsCount]) { NSLog(@"has objects"); } else { NSLog(@"no objects"); } } 

UIKit:
- What is a run loop?
- How does frame differ from bounds?
- What is the responder chain?
- If I call performSelector: withObject: afterDelay: - the object will be sent a message retain?
- What are the conditions of the application?
- How do push notifications work?
- Cycle life UIViewController?
- How is the memory warning processing? Does the processing depend on the iOS version?
- What is the best way to load UIImage from disk (from cache)?
- What content is better to store in Documents, and what in Cache?
')
And what questions were asked to you at the interviews?
PS Thanks to Vasily Mironchuk for assistance in preparing this material.

Source: https://habr.com/ru/post/198612/


All Articles