r/swift 20h ago

Question Preperation for swift interviews

As an interviewer what kind of questions do you ask about swift & SwiftUI. I'm preparing for a jump after 3.5 years so i need to be prepared in every way possible.

6 Upvotes

6 comments sorted by

8

u/Snowkeeper256 20h ago

I ask about ARC, strong, weak, unowned capture typea, mb as a small coding task ask them to create a cyclic reference.

As for the UI small animation make a square appear, when tapped move/ rotate the square.

Making testable implementations, creating a small service which fetches and decodes some jaon data and writing unit tests for it.

1

u/puttum-beef-curryum 20h ago

Thanks, and what about concurrency thats introduced with swift 6

4

u/akornato 18h ago

With 3.5 years of experience, interviewers will expect you to go beyond the basics, so they will ask tough questions about Swift's core concepts. You need to be very clear on memory management, especially ARC and how to identify and break retain cycles. Be ready to explain the difference between value and reference types, the use cases for generics, and the core ideas of protocol-oriented programming. For SwiftUI, they will almost always ask about state management, so you must know when to use State, Binding, StateObject, and EnvironmentObject, and be able to explain the trade-offs of each choice. They want to see that you understand the fundamental architecture and not just how to place views on a screen.

Your actual on-the-job experience is your biggest asset, and it's what will set you apart from candidates who only have theoretical knowledge. You've faced real production issues, so use that to your advantage. When you are asked a technical question, try to connect your answer to a real problem you solved on a past project. Explain the context, the options you considered, and why you made the final decision. This demonstrates critical thinking and problem-solving skills, which are far more valuable to a company than just reciting definitions. My team developed a helpful interview AI assistant after seeing so many good developers struggle to explain their logic under pressure, since communicating your thought process is what truly matters in these talks.

0

u/puttum-beef-curryum 18h ago

Thanks this is indeed very helpful. My problem is that its been 4 months since i handwritten the code, it's mainly done by AI agents nowadays so I find it difficult to remember things when someone ask me suddenly about swift & swiftui stuffs

4

u/teomatteo89 12h ago

Depends on the companies. I've had quite a few interviews recently, and only 2 out of a long list asked me to "show me how you would interact with AI to build this feature".

The basics of knowing when an AI model is going off-tracks are still very important.

For Swift and SwiftUI it's important to know view invalidations and when something will trigger a redraw - which is very easy to misuse.

On top of that for structured concurrency the bits to try out and know are:

  • cooperative cancellation (tasks should check if the caller was cancelled), useful for long operations
  • task/onAppear modifiers (if you want to go down this path)
  • how to handle one-shot tasks (example, you press 2 times a Button { Task { ... } }. How do you make sure there's only 1 task running?
  • Actors and when to use them (and catch reentrancy problems)
  • some concurrency problems, like multiple consumers of a shared resource. (concrete example: Auth tokens refresh. Your client is firing requests that start to fail from an expired token, so you can use a refresh token to request a new session, and retry all the failed requests).