Closures interview questions

15 real Closures questions from the Swift bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is Closure?

Junior
  1. A.the way a block grabs and retains outside constants and variables it references
  2. B.a self-contained block of code that can be passed around and captures references from its surrounding scope
  3. C.the default for a block guaranteed to run before the enclosing function returns, allowing optimizations
  4. D.syntax that moves a function's final block argument outside the parentheses for readability
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.Closure — an attribute marking a block that may be stored and called after the function it was passed to returns
  2. B.Closure — a self-contained block of code that can be passed around and captures references from its surrounding scope
  3. C.Closure — syntax that moves a function's final block argument outside the parentheses for readability
  4. D.Closure — the way a block grabs and retains outside constants and variables it references
Reveal the answer + AI explanation — free account

4. What is Trailing closure?

Mid
  1. A.a self-contained block of code that can be passed around and captures references from its surrounding scope
  2. B.the default for a block guaranteed to run before the enclosing function returns, allowing optimizations
  3. C.syntax that moves a function's final block argument outside the parentheses for readability
  4. D.an attribute marking a block that may be stored and called after the function it was passed to returns
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Mid
  1. A.Trailing closure — an attribute marking a block that may be stored and called after the function it was passed to returns
  2. B.Trailing closure — the default for a block guaranteed to run before the enclosing function returns, allowing optimizations
  3. C.Trailing closure — syntax that moves a function's final block argument outside the parentheses for readability
  4. D.Trailing closure — a self-contained block of code that can be passed around and captures references from its surrounding scope
Reveal the answer + AI explanation — free account

7. What is escaping?

Senior
  1. A.syntax that moves a function's final block argument outside the parentheses for readability
  2. B.the way a block grabs and retains outside constants and variables it references
  3. C.an attribute marking a block that may be stored and called after the function it was passed to returns
  4. D.the default for a block guaranteed to run before the enclosing function returns, allowing optimizations
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Senior
  1. A.escaping — an attribute marking a block that may be stored and called after the function it was passed to returns
  2. B.escaping — the way a block grabs and retains outside constants and variables it references
  3. C.escaping — the default for a block guaranteed to run before the enclosing function returns, allowing optimizations
  4. D.escaping — a self-contained block of code that can be passed around and captures references from its surrounding scope
Reveal the answer + AI explanation — free account

10. What is non-escaping?

Senior
  1. A.a self-contained block of code that can be passed around and captures references from its surrounding scope
  2. B.the default for a block guaranteed to run before the enclosing function returns, allowing optimizations
  3. C.syntax that moves a function's final block argument outside the parentheses for readability
  4. D.the way a block grabs and retains outside constants and variables it references
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Senior
  1. A.non-escaping — syntax that moves a function's final block argument outside the parentheses for readability
  2. B.non-escaping — the way a block grabs and retains outside constants and variables it references
  3. C.non-escaping — an attribute marking a block that may be stored and called after the function it was passed to returns
  4. D.non-escaping — the default for a block guaranteed to run before the enclosing function returns, allowing optimizations
Reveal the answer + AI explanation — free account

13. What is Variable capture?

Mid
  1. A.the default for a block guaranteed to run before the enclosing function returns, allowing optimizations
  2. B.the way a block grabs and retains outside constants and variables it references
  3. C.syntax that moves a function's final block argument outside the parentheses for readability
  4. D.an attribute marking a block that may be stored and called after the function it was passed to returns
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Mid
  1. A.Variable capture — the default for a block guaranteed to run before the enclosing function returns, allowing optimizations
  2. B.Variable capture — the way a block grabs and retains outside constants and variables it references
  3. C.Variable capture — syntax that moves a function's final block argument outside the parentheses for readability
  4. D.Variable capture — a self-contained block of code that can be passed around and captures references from its surrounding scope
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Closures free