Error Handling interview questions

15 real Error Handling 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 throws?

Junior
  1. A.the block structure that runs failable code and handles any raised failure
  2. B.an enum value capturing either a success payload or a failure, useful in callback-based code
  3. C.an expression that turns a thrown failure into an empty optional instead of propagating it
  4. D.a keyword marking that a function may signal a failure to its caller
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.throws — a keyword marking that a function may signal a failure to its caller
  2. B.throws — the block structure that runs failable code and handles any raised failure
  3. C.throws — a statement scheduling cleanup code to run when the current scope is exited by any path
  4. D.throws — an expression that turns a thrown failure into an empty optional instead of propagating it
Reveal the answer + AI explanation — free account

4. What is do-try-catch?

Junior
  1. A.an expression that turns a thrown failure into an empty optional instead of propagating it
  2. B.a statement scheduling cleanup code to run when the current scope is exited by any path
  3. C.an enum value capturing either a success payload or a failure, useful in callback-based code
  4. D.the block structure that runs failable code and handles any raised failure
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Junior
  1. A.do-try-catch — a statement scheduling cleanup code to run when the current scope is exited by any path
  2. B.do-try-catch — a keyword marking that a function may signal a failure to its caller
  3. C.do-try-catch — the block structure that runs failable code and handles any raised failure
  4. D.do-try-catch — an expression that turns a thrown failure into an empty optional instead of propagating it
Reveal the answer + AI explanation — free account

7. What is Result type?

Mid
  1. A.a statement scheduling cleanup code to run when the current scope is exited by any path
  2. B.a keyword marking that a function may signal a failure to its caller
  3. C.an enum value capturing either a success payload or a failure, useful in callback-based code
  4. D.the block structure that runs failable code and handles any raised failure
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Mid
  1. A.Result type — an enum value capturing either a success payload or a failure, useful in callback-based code
  2. B.Result type — the block structure that runs failable code and handles any raised failure
  3. C.Result type — a keyword marking that a function may signal a failure to its caller
  4. D.Result type — an expression that turns a thrown failure into an empty optional instead of propagating it
Reveal the answer + AI explanation — free account

10. What is try??

Mid
  1. A.an expression that turns a thrown failure into an empty optional instead of propagating it
  2. B.a statement scheduling cleanup code to run when the current scope is exited by any path
  3. C.an enum value capturing either a success payload or a failure, useful in callback-based code
  4. D.the block structure that runs failable code and handles any raised failure
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.try? — an expression that turns a thrown failure into an empty optional instead of propagating it
  2. B.try? — an enum value capturing either a success payload or a failure, useful in callback-based code
  3. C.try? — a keyword marking that a function may signal a failure to its caller
  4. D.try? — the block structure that runs failable code and handles any raised failure
Reveal the answer + AI explanation — free account

13. What is defer?

Senior
  1. A.an expression that turns a thrown failure into an empty optional instead of propagating it
  2. B.the block structure that runs failable code and handles any raised failure
  3. C.a keyword marking that a function may signal a failure to its caller
  4. D.a statement scheduling cleanup code to run when the current scope is exited by any path
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Senior
  1. A.defer — an expression that turns a thrown failure into an empty optional instead of propagating it
  2. B.defer — a statement scheduling cleanup code to run when the current scope is exited by any path
  3. C.defer — a keyword marking that a function may signal a failure to its caller
  4. D.defer — the block structure that runs failable code and handles any raised failure
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 Error Handling free