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

Quiz: REST APIs: questions with answers

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

Take the timed quiz + get a certificate →
  1. Q1. Which status code should a successful POST that creates a resource return?
  2. Q2. Which URL design follows REST conventions for deleting course 7?
  3. Q3. What does @RequestBody do?
  4. Q4. Which HTTP method is NOT idempotent?
  5. Q5. Why return DTOs instead of JPA entities from controllers?
  6. Q6. What status should a successful DELETE with no response body return?
  7. Q7. What does @PathVariable Long id read in @GetMapping("/{id}")?
  8. Q8. Where should a filter like "courses costing at most 3000" go in a REST URL?
  9. Q9. What does "stateless" mean for a REST API?
  10. Q10. What does ResponseEntity.created(uri).body(course) send?