🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Validation and Errors: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. The DTO has @NotBlank on title but the controller parameter lacks @Valid. What happens with an empty title?
  2. Q2. Which status suits "the course is already full"?
  3. Q3. What is @RestControllerAdvice for?
  4. Q4. Which annotation rejects a string that is null, empty or only spaces?
  5. Q5. What content type do ProblemDetail error responses use?
  6. Q6. Why is @NotNull on a primitive int fee field pointless?
  7. Q7. Which exception does Spring throw when a @Valid @RequestBody DTO fails its constraints?
  8. Q8. Why did the Course API store field errors in a TreeMap?
  9. Q9. What should a client receive when your code hits an unexpected bug?
  10. Q10. Which annotation checks a string against a regular expression?