Nailing Your iOS Interview in Silicon Valley

I recently built myself a study plan to prepare for six onsite iOS interview loops at companies like Facebook and Apple. Here’s what I studied to land all six offers.

Bay Area Belletrist
The Startup
8 min readJan 10, 2019

--

Introduction

While there are tons and tons of resources online if you’re looking to study for a “typical backend” job (defined loosely here as “not the iOS gig I was aiming for at the time”), I find that there’s a dearth of iOS study material available online. This extends from algorithm problems (specifically idiomatic solutions to them in Objective-C) and system design problems to general iOS knowledge questions.

You should never be studying with the goal of only being asked things that you studied. But you should know where the gaps in your knowledge are ahead of time and educate yourself appropriately. I wanted to put together a post assembling all of the study material I put together for myself before my interviews. While I can’t divulge information about questions I’ve received in interviews, I can give a broad overlook of fundamental iOS concepts that you can use to check yourself.

Algorithms

Below I’ll show some of the solutions I did in Objective-C while I was practicing. Keep in mind I uploaded these solutions before my interviews so they may or may not include actual interview questions. You should also be spending at least 15 minutes trying to solve these before seeing my maybe-suboptimal solutions. I spent a lot longer on many, and a lot of the actual learning I did was in that period where I was trying to figure things out.

I’ll only include link problems that have a matching Leetcode problem for simplicity, although these were almost always taken from a resource other than Leetcode (CtCI/EPI). The harder problems I did on whiteboards so I don’t have those listed.

While the above makes for a nice starting point, your goal should be to build a list like the above by yourself. Find similar problems. Code them out in Objective-C (or your language of choice). Think of your own test cases. Try them out. Practicing on Leetcode using Java (assuming you’re prepping for an iOS interview) and spamming “Run Code” isn’t going to be as effective as methodically building out a solution in the language you’re going to interview with.

For more clarity on how I picked and chose which problems to do, see my previous post, but what I have above prepared me pretty well.

System Design

System design questions in iOS are essentially all variations of “design this app on the whiteboard”. There’s no trick to them; everyone has varying levels of design skill and it usually scales with experience. As a result, practicing for system design interviews, in my mind, involves sitting with another developer who can repeatedly ask you to justify parts about your design/add new features/question certain design decisions. I may be able to spare time to help people practice as well — check out the CS Career Hackers community on Discord, as I’ll float around there sometimes. If I’m not there, others will be. :)

Just going through my phone, here are a few things I would ask if I were doing an interview, along with the follow-ups I would ask; keep in mind I was not asked any of these questions specifically:

  • Design the Messages app on iPhone. How will you update messages? What do your models look like? How do you persist them (if you do at all)? How would you lay out the UI from a UIKit perspective?
  • Design the Gmail app on iPhone. How will you update your email list? What APIs do you need from the backend? Will you paginate? Why? How will you persist data? Do you need to? What are your models? What does your UI infrastructure look like?
  • Design the Spotify app on iPhone. What do your models look like? What APIs do you need? What does your client infrastructure/class diagram look like for all of the pieces you need? Will you persist data? Why or why not?
  • Design the Instagram app on iPhone. How would you set up the UI? Will you cache images? How? Will you persist images? How? What APIs do you need? How can you ensure that your app is performant?
  • Design the Pinterest app on iPhone. How would you build the trademark UI? What sort of persistence would you employ? Where is persistence appropriate? What APIs would make sense?

I came up with all of those on the fly by looking at my home screen and thinking of the first questions that came to my head. Feel free to pick any random app and do the same, but I would practice with a friend if possible. If you practice by yourself you won’t (by definition) find out the areas you don’t normally think about.

iOS Knowledge

First off, I think it would benefit all parties if you learned the basics of at least one of Swift/Objective-C and knew a lot about the other. That more closely simulates the job that you’ll be doing at one of these companies; you may strongly prefer and know one language, but you’ll definitely see the other. It may be a lot to ask for, but it makes you more employable and a better developer overall.

Below I’ve listed a bunch of things I’d expect someone to know if I were interviewing them. You should be able to answer all of these with multiple sentences if you were pressed to go into detail. If you don’t know one of them, make sure you do. These are not necessarily the questions I was asked in interviews, but they’re basics I would expect all iOS interviewees to know with a reasonable amount of depth. They were largely plucked from Matt Galloway’s Effective Objective-C 2.0.

  • Property attributes: what does strong mean? What does weak mean? When would you use one over the other? Where is weak commonly used? What does nonatomic mean? What about atomic? When would you use one over the other?
  • KVO: what is KVO? When would you use it? When would you not use it? How can you make something KVO-compliant? What are the gotchas associated with KVO?
  • Class decoupling: what are the different ways you can decouple units of code? What are the advantages to each? What are the disadvantages to each?
  • Runtime: what’s unique about how methods are called in Objective-C compared to C? If a subclass doesn’t override a method in Objective-C, how does the superclass’s implementation get called? What happens if you call a method on something that doesn’t implement the method? What if you call a method on nil?
  • UIKit: what are the lifecycle methods of a UIViewController? How do you add a view as a subview and how would you make it adaptive to size changes?
  • Memory management: how does memory management work in iOS? Make sure you understand this thoroughly and don’t just memorize a sentence!
  • Concurrency: what are the different ways to handle concurrency on iOS? What are the common use cases? What are the gotchas?
  • Blocks: what are the pitfalls of blocks in Objective-C? Where are they commonly used? How can you avoid retain cycles?
  • Categories/extensions: what are they? When do you use them? What are the restrictions associated with them? What’s a class continuation category? What special rules does it have?

Critical Resources

Everything below I would say is a critical piece of knowledge when it comes to iOS interviews. I would make sure you know each and every link below. If something was only somewhat useful I omitted it from this list. You don’t need to memorize everything in every link, but you should definitely get the gist of all of it. I studied all of the below before my interviews and I’m glad I did.

I’d also recommend checking out App Architecture: iOS Application Design Patterns in Swift from objc.io, but it’s not required reading. It’s just interesting and may get you in the right thinking mood.

Wrap-Up

There’s a recurring theme in my guidance as it pertains to interviewing: practice with a friend, and practice consistently. I’ll keep emphasizing it wherever appropriate, because the advantages you gain by simulating an interview environment are impossible to overstate. I highly recommend using all of the questions above and interviewing a friend (who could look up the answer ahead of time if they aren’t sure).

Happy studying, everyone!

This story is published in The Startup, Medium’s largest entrepreneurship publication followed by +419,678 people.

Subscribe to receive our top stories here.

--

--

Bay Area Belletrist
The Startup

twitter.com/bayareabell — DM me on Twitter if you have any questions on anything, iOS or otherwise. I’m no industry vet but I’ll help if I can :)