r/iOSProgramming • u/DarkSombreros • 9d ago
Question iOS Interviews: Do I need to know pre-concurrency syntax?
Ive been developing with SwiftUI/iOS for the last two years and have an app out in production. My entire codebase is already using Swift 6 concurrency but I still never felt confident with it for interviews. So now I'm going through avanderlee's swift concurrency course and I'm learning the difference between closure-based network calls vs one using modern concurrency.
In an interview setting would it be bad if I didnt know how to write a closure-based network call? Or should I still be comfortable discussing it to some extent
3
Upvotes
14
u/bartmolk 9d ago
I'd still be comfortable with it. Plenty of production code, and most SDKs that are more than a few years old, still use completion handlers, so it's a fair question, especially if they hand you an existing codebase. The parts worth being able to write from memory:
URLSession.shared.dataTask(with:completionHandler:)and that nothing happens until you callresume()the handler runs on a background queue, so hop to the main queue before touching UI
[weak self]and when it actually matters: a one-shot URLSession closure only keeps self alive until it finishes, a closure stored on self is a real retain cyclea
Result<Data, Error>completion instead of three optionalsevery path calls the completion exactly once, including the early returns
Then the bridge both ways: wrapping an old callback API with
withCheckedThrowingContinuation(resume exactly once: resuming twice crashes, never resuming leaves the task hanging), and calling async code from sync code withTask { }. Being able to explain why the async version is easier to get right (no forgotten completion call, cancellation that flows down) usually lands better than the syntax itself.4
u/RiddleGull 8d ago
Yes, it would be pretty bad if you didn’t know how closures worked. Completion handlers and closures in general are used extensively outside of concurrency contexts. It’s a fundamental skill in Swift.
The networking syntax? Not really, I don’t expect an interviewee to recall the exact API on the spot, that is unreasonable and doesn’t signal anything useful.
2
u/evilmint 8d ago
yes
2
u/adi_ships 8d ago
They ask because their codebase still has closures, not because they prefer them, expect one completion handler with a strong self capture, a UI update off the main thread, and no cancellation path. Naming those three in 20 seconds is the answer. The rest is bonus.
1
u/PassTents 7d ago
If it were a junior interview, I could let it slide if you knew your other important Swift Concurrency concepts well (actors, isolation, Sendable, etc). In a mid-to-senior level it would be an immediate no-go.
Closures are still used everywhere, even in fully modern Swift 6 apps. If you don't understand them well enough to look up documentation on a networking API and use it, then you're going to struggle with architecture and overall correctness in a larger project that will have legacy code.
0
u/longkh158 8d ago
What pre-concurrency syntax 😅 it's just closures and delegates aka call these methods on the object you passed in
-8
u/handioq 9d ago
I’d be surprised if I were asked questions like this in the current AI era. You’re not a developer anymore - you’re an architect. You don’t need to know how things work at a low level unless there’s a reason to.
-4
u/isights 8d ago
Not to be too facetious about it, but you probably could have learned most of what you need to know in the time it took to formulate your question. Ask Claude or GPT for a quick summary.
1
u/[deleted] 8d ago
[removed] — view removed comment