iOS Interview Questions For Senior Developers

_Update: I had written a book on the topic of iOS interviews The iOS Interviews Guide.
Also there's a revised version of this article that you can find here.
_

Recently I’ve been interviewing iOS developers for a senior dev position at a fellow consultancy.
It is not an easy task to evaluate the level of knowledge and experience of another developer. You need to put aside your own subjective judgment and what is the most important—shut up and listen.

After going through several rounds of such interviews here are the questions I typically ask:

What was the latest version of iOS you worked with? what do you like about it and why?

Have you worked with Swift? What do you like about it? What you don’t like?

How memory management is handled on iOS?

What do you know about singletons? Where would you use one and where you wouldn't?

Could you explain what is the difference between Delegate and KVO?

How do you usually persist data on iOS?

How do you typically do networking?

How do you serialize data on iOS (JSON from the web or local app data to Core Data and other storages) ?

What design patterns do you know and use on iOS?

What is Autolayout?

How do you handle async tasks?

How do you manage dependencies?

How do you debug and profile things on iOS?

Do you code review?

Do you test your code? What do you do to make your code testable?

Let’s go through each of them individually to get a sense what answers for each tell us about the interviewee.

1. What was the latest version of iOS you worked with? What do you like about it and why?

The purpose of this question is to inquire if the interviewee actually keeps up with the latest development from Apple.

Expected answer: He/she tells you what the latest version of the system is and what he/she has worked with lately. And tells you about one of the new features of the system that he/she is excited about (i.e. I love new multitasking on iPad because it’s going to make user experience way better and opens up a lot of opportunities for us developers to build new cool things, etc.).

2. Have you worked with Swift? What do you like about it? What don't you like?

This question will give you a sense of several things:

Is he cautious with using something as unstable as Swift. For example, 2.0/2.1 releases broke a lot of things/libraries and a senior developer would think twice about using Swift on a production application. Because a lot of libraries and frameworks necessary for production ready iOS development either do not exist yet in pure Swift or do not work anymore with newer versions of the language (as of today - 11/11/15).

Whether the developer is bold enough to play with the cutting edge stuff

What’s his long terms plans and expectations (is he optimistic or pessimistic or somewhere in between)

Expected answer: be cautious, use Swift along with Objective-C for now and move to pure Swift down the road in several years when it and the ecosystem of libraries around it mature enough.

3. How is memory management handled on iOS?

This question will give you an idea of how long the person was working with iOS, whether she/he’s a newcomer who’s worked only with ARC or he/she’s worked with manual retain count (MRC) and has a deeper knowledge/experience with memory management on iOS.

Expected answer: It is great if interviewee knows MRC but it's not necessary. It is more important that he/she understands strong, weak, assign, etc. directives on properties and can confidently tell you what those directives imply and how it’s handled with blocks.

4. What do you know about singletons? Where would you use one and where you wouldn't?

This is a typical objective oriented programming question. In the case of iOS, you can get a feel of how the interviewee is using it in his/her apps. You’ll be able to weed out those people who came from Java/PHP and such and use it as a “global” store or something similar.

Expected answer: Singletons should be avoided and used only for objects that need to be shared throughout your application for same reason. It should be used carefully, instantiated lazily, if it’s possible, and passed into other objects as a dependency using Inversion of Control and Dependency Injection principles.Red flag: is when the interviewee talks about global variables and stores.

5. Could you explain what is the difference between Delegate and KVO?

With this question, you are assessing their knowledge of different types of messaging patterns used in iOS. A senior developer should’ve used both of those many times in his/her applications.

Expected answer: Both are ways to have relationships between objects. Delegation is a one to one relationship where one object implements a delegate protocol and another uses it and sends messages to assuming that those methods are implemented since the receiver promised to comply with the protocol. KVO is a many-to-many relationship where one object could broadcast a message and one or multiple other objects can listen to it and react.

6. How do you usually persist data on iOS?

This will tell you if they just played with rudimentary ways to store data locally on iOS like NSUserDefaults, Plists, disk file storage, etc. or if they have used more advanced storages like Core Data and Realm. Ideally, they should know when it is appropriate to use all of the above persistence tools.

Expected answer: A senior developer should at least be able to tell you when it is appropriate to use NSUserDefaults, Core Data, and disk file storage. ****Core Data is what you’re expecting them to explain you the most. Other possible options are Realm and similar third party (non-Apple) solutions but make sure they know why they would want to use them instead of Core Data.
With Core Data they should be able to explain how it works and how it’s different from SQLite (i.e. it’s an object graph rather than a relational database, etc.).

7. How do you typically do networking?

Networking is a vital part of almost any application these days. In fact, the majority of them is useless without an internet connection. Any decent iOS developer should know how to initiate various networking requests (GET, POST, PUT, DELETE, etc.) using Apple’s frameworks or third party tools such as [AFNetworking](https://github.com/AFNetworking/AFNetworking).

Expected answer: Interviewee should be able to explain how to do not just basic networking but more advanced things like HTTP headers and token handling. But in general look for developers who use either [AFNetworking](https://github.com/AFNetworking/AFNetworking) or [Alamofire](https://github.com/Alamofire/Alamofire) or similar. The reason is these libraries are used very extensively by the iOS community and are utilized in many other tools. A senior developer should be able to utilize that instead of reinventing a wheel.

8. How do you serialize data on iOS (JSON from the web or local app data to Core Data and other storages) ?

Data serialization is an important task for every iOS application. JSON is defacto standard of data serialization on the web and every developer should know how to effectively work with it without spending a lot of time writing boilerplate code. Same applies to data serialization for local storage. It can be handled in multiple ways but a good developer should at least be aware of the challenges with these tasks.

Expected answer: This is a tricky question. A naive developer would say that he/she parses JSON data using Apple’s [NSJSONSerialization](https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSJSONSerialization_Class/) and then takes the resulting dictionary and assigns the data from each key to respective properties on his/her model object. This is not what you expect a senior developer to tell you. Senior developer should be aware of the issues that could arise with data serialization such as data validation and conversion. A good answer would be clear understanding that in general there are two types of data serialization: JSON to domain model, and domain model to persistence. Utilization of pods like Mantle or ObjectMapper or a similar library/pod is expected.

9. What design patterns do you know and use on iOS?

This could be a very simple or a very complicated answer. Every iOS developer should know about MVC but if you’re looking for a senior developer than he/she should have a lot of patterns and best practices on how to organize code under his belt.

Expected answer: At least MVVM. This is the holy grail that saves iOS developers from Massive View Controllers. A senior developer should be able to explain to you what MVVM is, why it’s better than MVC, and should be able to tell you what other patterns he/she uses along with MVVM (Inversion of Control, Dependency Injection, etc.).Red flags: If interviewee tells you that he uses only MVC because Apple said so and he/she never tried MVVM than that person is definitely not a senior iOS developer.

10. What is Autolayout?

Autolayout is one of the technologies on iOS that helps us build scalable UI that can be used on many devices of different shape and size. This is a must-know for any iOS developer, especially for a senior one.

Expected answer: Do not expect proficiency with this technology but the interviewee should be able to tell you when and how he/she would use it and what benefits it gives them (i.e. scalable adjustable declarative UI).

11. How do you handle async tasks?

Asynchronous programming is a vital part of any iOS application. Networking, local storage, and other heavy computation tasks should be handled in the background to avoid blocking UI and having users wait or system-kill your application.

Expected answer: Answers to this questions may vary from NSOperations and GCD to Promises and RAC. A good developer knows multiple ways to execute async operations and knows when they are necessary (i.e. with networking, local persistence, etc. see above). From a senior developer though we expect a higher and broader level of tools they use such as ReactiveCocoa and PromiseKit.

12. How do you manage dependencies?

Dependencies management is a vital but daunting task. It was very difficult and error prone to do before but these days we have several tools to help us out with it. Every iOS dev should know how to handle dependencies and collaborate with other teammates.

Expected answer: CocoaPods and/or Carthage.Red flags: if the say that they don’t use any dependency manager and just copy files to the project folder. Also, a red flag if the use git submodules (it leads to project configuration issues and inconsistencies between local setups for different developers on the team).

13. How do you debug and profile things on iOS?

No one writes perfect code and debugging and profiling is one of the tools that we use to figure out the right technical solution. On iOS, we have all the typical “manual” debugging tools such as NSLog/print functions to output things in the console. But Apple also provides us with a more advanced variety of tools and instruments to help with identifying where problems lie.

Expected answer: Every iOS developer should be able to explain how he/she would use breakpoints and logs to get the runtime data but from a senior developer you should expect to hear things about Instruments and Crash Logs.

14. Do you code review?

Code reviews are one of the most effective development methodologies. It helps understand the problem better, share knowledge, share techniques, catch bugs, share ownership of the codebase, etc. This style of development is not for everyone but every development should be able to do that effectively.

Expected answer: Senior developer should be more or less proficient in this type of code collaboration. Again, this is not for everyone (depends on personality, compatibility, and other factors), but that is a skill that should show you if the candidate is able to work with other people and communicate his thoughts and ideas clearly to another teammate.

15. Do you test your code? What do you do to make your code testable?

This is embarrassing but we admit that we don’t do testing as much as we should. We know we really really should do it more. We are talking about Unit Testing and Integration Testing specifically here.

Expected answer: There is only one right answer here: either they do it or they wish they would. In general iOS community isn’t as big on testing as say Ruby community. Partially it is due to inherited lack of testing culture and partially due to lack of good tools for testing but things seem to be improving on that front.

Conclusion

This set of questions will help you identify a good senior developer. They touch upon the most of the concepts and things that a senior developer will work with on a typical iOS project. Keep the interview more or less conversational, it is easier to get answers when the other person feels relaxed. Also, do not expect precise answers but they should be in close vicinity of what I’ve talked about above. Always ask for code samples, it is very helpful to look at what a person actually had done and maybe even ask them to walk you through it.

I’m curious how do you conduct your interviews? What questions do you ask? What do you look for?
Feel free to ask questions about interviewing senior iOS developers below.

This is originally posted by the author on a different website. This version has been edited for clarity and some parts may appear different from the original post.