Q/A library

iOS interview questions

Search by title or keywords, narrow by topic, difficulty, or tag, then open a question for a full write-up with code to practice your answer.

What is the difference between let and var in Swift?

Explain that let creates an immutable binding while var creates a mutable one, then separate how that rule behaves for value types versus reference types

What is a closure in Swift?

A closure is a block of code you can pass and store like a value, and it can capture constants and variables from the surrounding scope

What is the difference between print and debugPrint in Swift?

Explain that print prefers a user-facing string while debugPrint prefers a debug representation, then show when their output is identical and when it diverges