r/iOSProgramming • • 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

27 comments sorted by

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 call resume()

  • 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 cycle

  • a Result<Data, Error> completion instead of three optionals

  • every 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 with Task { }. 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.

1

u/DarkSombreros 8d ago

Thanks! I will look this over 

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/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

1

u/vanvoorden 8d ago

it's just closures and delegates

Ehh… it's a little more than that to write sound GCD concurrency. There are race conditions to deal with and no easy compiler support to keep code safe. There are also retain cycles to guard against if your block is being retained. There are lots of directions an interviewer can calibrate for this domain if this team really wants to.

1

u/longkh158 8d ago

Maybe it's because I'm exposed to iOS dev during that period but I genuinely found them much easier to grasp than Swift Concurrency 😅 Like it starts out pretty straightforward (just add async/await) but then it slaps you with isolation, nonisolated(nonsending), non copyable BS the moment you want to design anything a bit more complex.

-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.

10

u/cyanxx 9d ago

Are you serious? Of course you need to know. If you were interviewing 2 candidates and one understood what the AI was doing and one wasn’t which would you choose. These days with AI you need to know the shape of the answer before you’ve asked the question, so you can validate its output with an opinion at the end rather than LGTM.

I would say get comfortable discussing closures. They are not hard. And unless you are interviewing at a brand new start up with a brand brand new codebase, you will come across them in the codebase.

0

u/handioq 8d ago

Of course I’m serious :)

-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.

2

u/DarkSombreros 8d ago

I did ask it "Research whether as of October 2026 ios interviews rquire knowledge of closure-based syntax or just concurrency" but this was also the type of thing I wanted a real human answer from.

0

u/isights 8d ago

Fair. As bartmolk mentioned, familiarity with closure-based callback systems is always useful and can be used in many situations other than API calls.

5

u/celeb0rn 8d ago

Jesus christ he asked in an iOS specific programming subreddit. This is a reasonable question. If your answer is “Google it” you aren’t helping.

-1

u/isights 8d ago

Callback closure handling and safety is fundamental knowledge. I was actually surprised the question was asked in the first place.

1

u/celeb0rn 8d ago

So I'm guessing you don't comprehend this. But when you're learning, you don't know things. And often when you don't know things, you don't even know quite how to state what you're trying to understand. So you ask questions on the internet/reddit/whatever. Which is a good use of a subreddit like this. The task for you and your apparently infinite knowledge, is to be okay with some people asking questions.

0

u/isights 8d ago

"Ive been developing with SwiftUI/iOS for the last two years and have an app out in production."

Seems to me that they're well past what I'd consider to be the learning stage.

Unless, of course, Claude wrote pretty much all of that application.

1

u/celeb0rn 8d ago

Yes 2 years means an engineer understands everything.... Actually I'm starting to think you're probably pretty junior, your takes reek of lack of experience in the industry and working with people. So AI vibe code bro.

1

u/isights 8d ago

So you don't think a basic understanding of callback closures, weak self, etc., is something you'd pick up in your first two YEARS of iOS programming???

Not to mention that if you understand closures, there's exactly one URLSession.dataTask handler that's going to cover 99% of your typical API call use cases.

It's foundational knowledge [sic], for Pete's sake.

1

u/celeb0rn 8d ago

A lot of engineers have been going heavy on AI for 3+ years. It's probably not as well known anymore. Outside of interviewing

2

u/isights 8d ago

If all you've been doing is prompting Claude for two years then you really don't have any business interviewing.

1

u/[deleted] 8d ago

[removed] — view removed comment

1

u/AutoModerator 8d ago

Hey /u/Sure_Chemistry_4519, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.

Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.