Exceptions interview questions

15 Exceptions questions from the Python bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

1. What is try/except?

Junior
  1. A.the optional try-block section that runs only when no exception was raised in the protected code
  2. B.the construct that runs guarded code and catches raised errors in matching handler clauses
  3. C.the syntax that re-raises an error while explicitly chaining it to an originating cause for clearer tracebacks
  4. D.the clause whose body always executes on the way out of a try block, whether or not an error occurred

Answer + AI explanation with Pro

2. Which term means: "the construct that runs guarded code and catches raised errors in matching handler clauses"?

Junior
  1. A.try/except
  2. B.raise from
  3. C.finally
  4. D.else clause

Answer + AI explanation with Pro

3. Which statement is correct?

Junior
  1. A.try/except — the 3.11 container that bundles multiple unrelated errors, handled selectively with except* syntax
  2. B.try/except — the optional try-block section that runs only when no exception was raised in the protected code
  3. C.try/except — the clause whose body always executes on the way out of a try block, whether or not an error occurred
  4. D.try/except — the construct that runs guarded code and catches raised errors in matching handler clauses

Answer + AI explanation with Pro

4. What is finally?

Junior
  1. A.the syntax that re-raises an error while explicitly chaining it to an originating cause for clearer tracebacks
  2. B.the clause whose body always executes on the way out of a try block, whether or not an error occurred
  3. C.the 3.11 container that bundles multiple unrelated errors, handled selectively with except* syntax
  4. D.the optional try-block section that runs only when no exception was raised in the protected code

Answer + AI explanation with Pro

5. Which term means: "the clause whose body always executes on the way out of a try block, whether or not an error occurred"?

Junior
  1. A.ExceptionGroup
  2. B.finally
  3. C.try/except
  4. D.else clause

Answer + AI explanation with Pro

6. Which statement is correct?

Junior
  1. A.finally — the 3.11 container that bundles multiple unrelated errors, handled selectively with except* syntax
  2. B.finally — the optional try-block section that runs only when no exception was raised in the protected code
  3. C.finally — the construct that runs guarded code and catches raised errors in matching handler clauses
  4. D.finally — the clause whose body always executes on the way out of a try block, whether or not an error occurred

Answer + AI explanation with Pro

7. What is else clause?

Mid
  1. A.the syntax that re-raises an error while explicitly chaining it to an originating cause for clearer tracebacks
  2. B.the clause whose body always executes on the way out of a try block, whether or not an error occurred
  3. C.the optional try-block section that runs only when no exception was raised in the protected code
  4. D.the 3.11 container that bundles multiple unrelated errors, handled selectively with except* syntax

Answer + AI explanation with Pro

8. Which term means: "the optional try-block section that runs only when no exception was raised in the protected code"?

Mid
  1. A.ExceptionGroup
  2. B.try/except
  3. C.finally
  4. D.else clause

Answer + AI explanation with Pro

9. Which statement is correct?

Mid
  1. A.else clause — the optional try-block section that runs only when no exception was raised in the protected code
  2. B.else clause — the syntax that re-raises an error while explicitly chaining it to an originating cause for clearer tracebacks
  3. C.else clause — the 3.11 container that bundles multiple unrelated errors, handled selectively with except* syntax
  4. D.else clause — the construct that runs guarded code and catches raised errors in matching handler clauses

Answer + AI explanation with Pro

10. What is raise from?

Mid
  1. A.the syntax that re-raises an error while explicitly chaining it to an originating cause for clearer tracebacks
  2. B.the clause whose body always executes on the way out of a try block, whether or not an error occurred
  3. C.the construct that runs guarded code and catches raised errors in matching handler clauses
  4. D.the optional try-block section that runs only when no exception was raised in the protected code

Answer + AI explanation with Pro

11. Which term means: "the syntax that re-raises an error while explicitly chaining it to an originating cause for clearer tracebacks"?

Mid
  1. A.raise from
  2. B.try/except
  3. C.finally
  4. D.else clause

Answer + AI explanation with Pro

12. Which statement is correct?

Mid
  1. A.raise from — the clause whose body always executes on the way out of a try block, whether or not an error occurred
  2. B.raise from — the construct that runs guarded code and catches raised errors in matching handler clauses
  3. C.raise from — the syntax that re-raises an error while explicitly chaining it to an originating cause for clearer tracebacks
  4. D.raise from — the optional try-block section that runs only when no exception was raised in the protected code

Answer + AI explanation with Pro

13. What is ExceptionGroup?

Senior
  1. A.the syntax that re-raises an error while explicitly chaining it to an originating cause for clearer tracebacks
  2. B.the 3.11 container that bundles multiple unrelated errors, handled selectively with except* syntax
  3. C.the clause whose body always executes on the way out of a try block, whether or not an error occurred
  4. D.the construct that runs guarded code and catches raised errors in matching handler clauses

Answer + AI explanation with Pro

14. Which term means: "the 3.11 container that bundles multiple unrelated errors, handled selectively with except* syntax"?

Senior
  1. A.ExceptionGroup
  2. B.else clause
  3. C.raise from
  4. D.try/except

Answer + AI explanation with Pro

15. Which statement is correct?

Senior
  1. A.ExceptionGroup — the construct that runs guarded code and catches raised errors in matching handler clauses
  2. B.ExceptionGroup — the optional try-block section that runs only when no exception was raised in the protected code
  3. C.ExceptionGroup — the syntax that re-raises an error while explicitly chaining it to an originating cause for clearer tracebacks
  4. D.ExceptionGroup — the 3.11 container that bundles multiple unrelated errors, handled selectively with except* syntax

Answer + AI explanation with Pro

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Exceptions question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers