iOS Developer interview questions 2020
We all know how interviews might be stressful, it does not really matter if it is your first interview ever or you are experienced developer with a few years of development on your back. As an interviewee, you must be prepared to present yourself in a good light and it is really hard to do it within 1 hour or so of conversation. We, developers, usually rather not learn documentation by the hearth and we even google simple things. It is okay though, no one expects from us to remember everything... unless it's an interview 🙂 As an interviewer, it might be not that simple either. You want to recruit for your company someone that will fit well in your team and there is not much time to get to know the other person. You must know what to ask and how to behave, you do not want to make the interviewee uncomfortable as you might judge someone incorrectly because of that and miss on a great developer. Pretty much, both parties need to prepare for interviews and I hope with this article I will help you to prepare for your future conversations a little bit better.
Just a small notice. I am not giving you full answers for those questions (just some basic information that I would personally expect from you at least to know about the specific question) as in my opinion you will prepare for the interview better if you find the answers yourself. A good option would be to read an article about a specific topic which will give you a lot more information which you can use fo your advantage during the interview. Also, I will most likely cover everything on my blog sooner or later.
Interviews for iOS (or any other platform) is not just about technical questions. Even though you might put some information about your previous jobs and projects in your resume, there is no enough space to write some more details about that. Prepare yourself for some of those questions as well as being surprised by those is never good for you.
- What are the projects you were involved in so far? What technologies did you use there? - just give some more details about some interesting projects, like what technologies, what frameworks have you used, etc.
- Are you involved in any open source projects? What is your role there? - that would be a big plus, even if you are just a contributor. If you are trying to get your first job it's a good way to prove your skills. Even better if you are a maintainer of the popular repository.
- How big were the teams? Have you been a leader in any of those projects? - just to know if you used to work alone, in big teams, remotely or only with local people, etc.
- What are the sources of your knowledge? Do you read any blogs or listen to any podcasts? Name a few. - if you do then that might mean programming is not just your job but also a hobby and it's usually better to hire you instead of someone who doesn't do that
- Have you worked with Scrum/Agile? What do you think about that? When in your opinion it can be good and when rather harmful? - just a quick question to see if you understand that scrum has its place and doesn't have to be used ALWAYS
- What is your opinion on Code Review? - another quick question to check if you are either in a group of people who think it's important or in the other one :)
- Do you go to conferences and local meetups sometimes? Do you have any favorite one? - nothing serious in my opinion, it doesn't mean that you are a bad developer because you do not go there, you might be just an introvert. But it's sometimes good to see if you are a person that might promote the company on conferences or even do a speech
Swift and Objective-C
iOS is not just about Swift. Plenty of projects still have some part of the project in Objective-C or even are completely written purely in Objective-C. And there is even more... C, C++ skills might be useful as well in some (rare) cases. But I would rather not worry about that since most likely it would be mentioned in the job offer if the interview is for a specific project that needs knowledge about those languages as well. Also, some basic knowledge about bash and ruby might be a great advantage as we might need to write some scripts sometimes.
Those questions are listed in random order.
- How would you describe a Swift language? - type-safe language, protocol-oriented programming. Expect some follow up questions to explain further what does it mean that it's protocol-oriented etc.
- What is the difference between
let? Which one would you choose for properties in a
struct and why? - the first one is quite basic and the second one might be tricky as "it depends"
- What are lazy properties? - if you are writing Swift code for quite some time you most likely had to use lazy properties at least once, so better know what advantages and disadvantages come with it
- What is optional? What mechanism lays behind that? What is Unconditional Unwrapping? - you probably already know that
- How can we unwrap optional value? (Can ask some additional questions, like...) What is optional chaining, optional binding, and Nil-Coalescing Operator? Give some examples which and when method would you choose? - it's an easy one but it's just to see if you know the difference and that
guard is not always the first option to choose
- What is the difference between
struct? Give some examples when to use which - can go deep with this one, ie. how they are kept in the memory (stack/heap), etc.
- What are closures? - you know that, right?
- What do weak and unowned mean? What is the difference? - it's good to know the difference and when to use
unowned. You might be fine using
weak in every case scenario but
unowned has its purpose as well
- Give some examples of methods for collection operations from the standard library - what does
reduce do and how those methods can be helpful in day to day development
- What is autoclosure? - it might look like a simple question but there is more about autoclosures than you might think, ie. how they affect the performance?
- What does
mutating keyword mean? - give some examples
- What do escaping and unescaping mean? - a simple question but do you remember which one is default?
- (if the candidate knows Objective-C) What is the difference between Swift and Objective-C? What do you like about each language? - just say anything, if you have experience with both languages you probably know what you love or miss the most in each language
- Have you heard about method swizzling? What is that? Can it be done in Swift? - magic... 🧙♂️ say anything you know, why it's dangerous etc.
- What is a difference between NSArray and NSSet? - not just that set contains unique elements, but how it performs in different scenarios
- (if the candidate knows Objective-C) What is atomic/nonatomic in Objective-C?
- What is KVO and KVC? - another quite big topics so know basics at least
- What is the application and controller life cycle? - quick one
- What is CoreData? - big topic, you might never have a chance to use CoreData but know some basics
- What architectures do you have experience with? What is your favorite and why? - you probably need to know MVVM as it's the most common one so read a lot about that as well as MVVM with Coordinators
- Would you use a struct or a class for a view model in MVVM? - view model doesn't have to always be a class
- How do you manage dependencies in your code? - do you use any dependency injection framework/tool or do it manually? or maybe you just use singletons?
- What is REST? What is a difference between the POST and GET? - must have knowledge
- Have you ever written a networking layer? Describe shortly how did/would you do that? - just explain according to your own experience
- Have you used Alamofire or any other network framework? - some people use networking frameworks, some don't, how about you?
- How to parse JSON in Swift? How to parse XML in Swift? - JSON is an easy one, tell about keys decoding strategy as well if you know about that. XML is kinda forgotten but for some projects, you might still need that
- What is a Certificate Pinning and how to implement it in the iOS application? - it's okay if you do now know about that but it's great if you do!
- How to allow unsecured connections? Can we do that? Will it pass an app review? - say anything you know... in which cases can we do that?
- How can we handle background operations? - know at least one method
- What are differences and similarities between GCD and NSOperation? - GCD might be more convenient to use but it's good to know when NSOperation might be useful
- What is a serial/concurrent queue? - give some examples when to use which
- What is a dispatch group? - good to know
- What's your favorite way of creating views and why? - interface builder, constraints in code, manual frame calculating - what are advantages and disadvantages of each and which one do you prefer and why?
- How can we build views that support different screen sizes etc? - size classes, user interface idiom...
- What is
reuseIdentifier in cells and what
prepareForReuse method is for? - must know as tables and collections are usually a core element in most applications
- What is a
UIStackView? Did you use it? - you probably know about stack views by now, just say anything you know about this topic, ie. how to do animations, etc.
- What is intrinsicContentSize? - it's really handy...
- Did you ever had a chance to write a custom controller transition? How can we do that? - we do not do that often but if we do it's good to remember about "back gesture" and know how to implement that
- What is a difference between
frame and a
bounds 🙂? - the "every interview" question? some developers do not know the answer though
- Constraint priorities, hugging priority and compression resistance priority. What is that and how does it work? - hopefully, you are not the one that resolves constraints conflicts by setting all constraints to 999 priority ;)
- What is the most complex animation you have ever made in iOS? How did you do that? - say it loud if you did something fancy 🔈
- How can we do complex animations without nesting multiple
UIView.animate methods? - I guess we rarely have a chance (a need) to do that though but maybe you will have to...
- (if the candidate knows Objective-C) What is a difference between
retain? - probably fewer people each year know the answer but anyway, if you know Objective-C you probably do
- How would you store sensitive user data? - just to check if know anything about data security
- What is
defer? - in what order are they executed etc.
- What are generics? - describe how generics can improve our lives and maybe give some examples from the swift standard library
Questions might not be strictly about the code so be prepared for general knowledge about iOS development as well.
- Name your first few steps you do after creating a new project - please, just don't say you set up CocoaPods... don't get me wrong. There is nothing wrong using CocoaPods as dependency manager but there are better things to do first 🙉
- Do you use any dependency manager? Which one do you prefer? - there is no good or bad answer, it's just to see your preferences but it's good to know the advantages or disadvantages of each manager
- What are Configurations (Debug, Release)? Do you create custom ones? - I wonder how many projects use custom ones? Anyway, we might need those in some cases
- Do you use Xcode's instruments? Which ones? - hopefully, you use Leaks at least
- How do you find and resolve memory leaks? - if you have experience with reactive programming you might talk about that as well as it is harder to fix those
- What is Continous Integration? Do you know and use any? Have you ever configured any? - there is plenty of them and it's good if you know at least one or two
- Do you have any experience with releasing an application to the AppStore? Did you ever had any issues with App Review? - just say anything from your experience, if you had a chance to release an application with IAP you can mention that. If you had any interesting conversations with reviewers say that as well ^^
- Do you have experience with unit testing? How about UI testing? - everyone says they write tests but are they? if you used any frameworks to help with tests, mention that as well
- Have you ever developed a test-driven project (TDD)? - hands up who does that 😅
- Are there any tools you use daily for development? - maybe some code formatters, linters... just anything. If you have written your tool mention that for sure!
- What is SOLID? Can you name and describe those principles? - if you know what it means you have prepared for interview but if you can give some examples that would be nice
- What is declarative programming? Have you tried SwiftUI yet? - it is getting more and more popular and who knows... maybe in a few years it will be the only way to write iOS applications. So better know that it exists at least. I think nobody expects a huge experience with SwiftUI yet but would be nice if you have tried it.
- What is reactive programming? Do you have experience with Rx framework and/or Apple's Combine? - Apple goes this way as well so if you haven't already it's a good time to get some basics about that
- Why do you want to change your current job? What do you expect from the new one? - just be honest. Bigger salary is the most probable thing you go after but c'mon, there must be something else!
That is just some small part of possible questions interviewers might come up with.
It's best for you if you always just stay up to date with changes in the iOS world. Read blogs, listen do podcasts, follow Apple developer news and even though you mostly like won't need all that knowledge in your new job, it's good to be open for new knowledge and show the interviewer that you keep on learning new things.
If you have doubts about any of the questions feel free to contact me and I will try to help you as soon as possible. Good luck during your interviews, no matter which side you are 👍
Thank you for reading.