Mastering iOS Interviews: What Not to Ask Candidates

G. Abhisek
4 min readOct 23, 2023

--

As someone who has been on both sides of the interview table in iOS development, I’ve come to appreciate the nuances involved in the process. While the candidate’s performance is undoubtedly crucial, the interviewer’s skill in asking the right questions is equally significant.

In this blog, we will explore questions and practices that may not be the best ones. We will uncover the reasons for steering clear of these questions and discuss more effective approaches for evaluating iOS candidates.

The DispatchQueue Hell 🔥

Question: What would be the output of the following code:

let queue = DispatchQueue(label: "concurrent-hell", attributes: .concurrent)
queue.async {
print("1")
queue.sync {
print("2")
}
sleep(2)
queue.async {
print("3")
}
}
queue.sync {
print("4")
}
sleep(2)
print("5")

This scary-looking piece of code tops my list of most unfavoured questions. This is asked by many interviewers to gauge the candidate’s understanding of GCD and its operation. Interviews are meant to be practical and this question is far from being one.

  • This complex question with unconventional code can be intimidating and reduce a candidate’s confidence.
  • This code displays practices that are commonly discouraged in a real-world scenario.
  • As well in a concurrent environment, predicting output like a serial operation is difficult.
  • To make things worse, this question can be further complicated by adding more and more dispatch blocks.

Alternate Question 💡

A few alternate questions to understand a candidate’s understanding of Concurrency and GCD could be:

  • Downloading and Displaying Multiple Images: Develop an algorithm for downloading and displaying multiple images concurrently. Assume the image undergoes a time-consuming transformation post-downloading such as applying filters.
  • Analytics Engine for User Events: Create an analytics engine that captures and sends user events based on priorities in the background.

The Defer Dilemma ⏳

Question: Guess the output of the following code

func deferExample() {
func someInnerFunction() {
defer {
print(1)
}
}

defer {
print(2)
defer {
print(3)
}
}

defer {
print(4)
someInnerFunction()
}
print(5)
}

This question intends to analyze the candidate’s understanding of the swift defer keyword. As the previous example, this question is impractical and might end up confusing and demoralizing the candidate. In practicality, using multiple defer statements is not advised.

Alternate Question 💡

Write down a function that performs a file operation and ensures cleanup activities such as closing the file or any other such activities are performed once you move out from the function’s scope of execution.

The Mighty Singleton 💪

Question: Singletons are not bad. Why?

This question may not be ideal for an interview because it touches on a topic that is highly subjective and nuanced. Whether Singletons are considered “bad” or not can vary based on the specific use case and the implementation details.

Interview questions are typically more effective when they have answers that are objective or widely accepted, as this makes it easier to evaluate a candidate’s knowledge and problem-solving abilities.

Alternate question 💡

Instead, it might be more suitable to ask candidates about their understanding of design patterns, including the Singleton pattern, and stress to discuss scenarios where Singletons can be advantageous and situations where alternative design patterns might be preferable. This approach can lead to a more insightful and informative conversation during the interview.

Few more…

How does Swift compilation work?

The Swift compilation process is an intricate process that involves many steps. It is impractical for an iOS engineer to understand such a low-level construct as they often work with high-level APIs.

Why @objc is needed for the compiler to identify a Swift code exposed to Objective C runtime?

This question dives deep into the intricacies of Swift and Objective-C language design and their interoperability. It explores the inner workings of these languages rather than evaluating a candidate’s practical iOS app development skills. Consequently, it may not accurately assess a candidate’s capability to effectively create iOS applications.

Syntax obsession

Mastering syntax remains important, yet modern code editors with helpful auto-completion features have reduced the necessity for memorizing every syntax nuance. Developers can now allocate their energy to writing clear, testable code. Regrettably, some interviewers fixate on syntax while neglecting to evaluate a candidate’s grasp of core APIs. This narrow focus can result in misunderstandings about a candidate’s actual abilities, disrupting the interview process.

Advice to Interviewers 🎙️

Interviewing candidates for iOS positions can be a challenging task. As an interviewer, your goal is not only to evaluate a candidate’s technical knowledge but also to create an interview experience that is insightful, fair, and encouraging. Here are some tips for conducting more effective iOS interviews:

  • Focus on formulating questions and tasks that directly mirror the job’s day-to-day responsibilities.
  • Assess candidates across various facets of iOS development to ensure a well-rounded evaluation.
  • Pose challenges that demand creativity and problem-solving to evaluate critical thinking under pressure.
  • Maintain an environment of respect and support to help candidates feel at ease and perform their best.
  • Take into account cultural fit and collaboration skills alongside technical proficiency. We should always remember, that technical skills can be taught, but not cultural skills.

I would love to connect with you 🤝

If you have any questions, or feedback, or just want to have a discussion, please feel free to reach out through these channels:

Don’t hesitate to share this with your fellow developers.

--

--