Exception Handling & Validation interview questions

15 real Exception Handling & Validation questions from the Spring 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 @ExceptionHandler?

Mid
  1. A.an annotation marking a method that handles a specific thrown type raised by controller actions
  2. B.an annotation triggering Bean Validation constraint checks on an incoming argument before the handler runs
  3. C.an annotation that maps an exception or handler to a specific HTTP status code returned to the client
  4. D.the Jakarta standard, using constraints like @NotNull and @Size, for declaratively checking object state
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Mid
  1. A.@ExceptionHandler — an annotation marking a method that handles a specific thrown type raised by controller actions
  2. B.@ExceptionHandler — an annotation that maps an exception or handler to a specific HTTP status code returned to the client
  3. C.@ExceptionHandler — the Jakarta standard, using constraints like @NotNull and @Size, for declaratively checking object state
  4. D.@ExceptionHandler — an annotation triggering Bean Validation constraint checks on an incoming argument before the handler runs
Reveal the answer + AI explanation — free account

4. What is @ControllerAdvice?

Mid
  1. A.an annotation marking a method that handles a specific thrown type raised by controller actions
  2. B.an annotation declaring a class whose handlers and model tweaks apply globally across all controllers
  3. C.an annotation that maps an exception or handler to a specific HTTP status code returned to the client
  4. D.an annotation triggering Bean Validation constraint checks on an incoming argument before the handler runs
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Mid
  1. A.@ControllerAdvice — an annotation that maps an exception or handler to a specific HTTP status code returned to the client
  2. B.@ControllerAdvice — an annotation marking a method that handles a specific thrown type raised by controller actions
  3. C.@ControllerAdvice — an annotation declaring a class whose handlers and model tweaks apply globally across all controllers
  4. D.@ControllerAdvice — the Jakarta standard, using constraints like @NotNull and @Size, for declaratively checking object state
Reveal the answer + AI explanation — free account

7. What is @Valid?

Junior
  1. A.an annotation marking a method that handles a specific thrown type raised by controller actions
  2. B.an annotation that maps an exception or handler to a specific HTTP status code returned to the client
  3. C.the Jakarta standard, using constraints like @NotNull and @Size, for declaratively checking object state
  4. D.an annotation triggering Bean Validation constraint checks on an incoming argument before the handler runs
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Junior
  1. A.@Valid — an annotation that maps an exception or handler to a specific HTTP status code returned to the client
  2. B.@Valid — an annotation marking a method that handles a specific thrown type raised by controller actions
  3. C.@Valid — an annotation declaring a class whose handlers and model tweaks apply globally across all controllers
  4. D.@Valid — an annotation triggering Bean Validation constraint checks on an incoming argument before the handler runs
Reveal the answer + AI explanation — free account

10. What is Bean Validation?

Mid
  1. A.an annotation marking a method that handles a specific thrown type raised by controller actions
  2. B.an annotation declaring a class whose handlers and model tweaks apply globally across all controllers
  3. C.an annotation triggering Bean Validation constraint checks on an incoming argument before the handler runs
  4. D.the Jakarta standard, using constraints like @NotNull and @Size, for declaratively checking object state
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.Bean Validation — an annotation that maps an exception or handler to a specific HTTP status code returned to the client
  2. B.Bean Validation — the Jakarta standard, using constraints like @NotNull and @Size, for declaratively checking object state
  3. C.Bean Validation — an annotation marking a method that handles a specific thrown type raised by controller actions
  4. D.Bean Validation — an annotation triggering Bean Validation constraint checks on an incoming argument before the handler runs
Reveal the answer + AI explanation — free account

13. What is @ResponseStatus?

Senior
  1. A.an annotation that maps an exception or handler to a specific HTTP status code returned to the client
  2. B.an annotation triggering Bean Validation constraint checks on an incoming argument before the handler runs
  3. C.an annotation marking a method that handles a specific thrown type raised by controller actions
  4. D.the Jakarta standard, using constraints like @NotNull and @Size, for declaratively checking object state
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Senior
  1. A.@ResponseStatus — an annotation marking a method that handles a specific thrown type raised by controller actions
  2. B.@ResponseStatus — an annotation that maps an exception or handler to a specific HTTP status code returned to the client
  3. C.@ResponseStatus — an annotation declaring a class whose handlers and model tweaks apply globally across all controllers
  4. D.@ResponseStatus — an annotation triggering Bean Validation constraint checks on an incoming argument before the handler runs
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 Exception Handling & Validation free