Skip to main content

Web & REST

Nearly every Java backend engineer builds HTTP APIs. This domain covers the full stack from HTTP protocol fundamentals through Spring MVC (the synchronous model) and WebFlux (the reactive model). REST design principles, proper status codes, content negotiation, and API documentation with OpenAPI are the practical skills interviewers probe here.

What You'll Find Here

TopicNoteDescription
HTTP Fundamentalshttp-fundamentals.mdMethods, status codes, headers, content negotiation, HTTP/2 basics.
REST Designrest-design.mdResources, representations, HATEOAS, versioning strategies, idempotency.
Spring MVCspring-mvc.md@RestController, @RequestMapping, @PathVariable, @RequestBody, ResponseEntity.
Exception Handlingexception-handling.md@ExceptionHandler, @ControllerAdvice, ProblemDetail (RFC 9457).
WebFlux & Reactivewebflux-reactive.mdMono, Flux, functional endpoints, backpressure, when to choose reactive.
OpenAPI & Springdocopenapi-springdoc.mdGenerating API documentation with springdoc-openapi; @Operation, @Schema.

Learning Path

  1. HTTP Fundamentals — status codes (200/201/400/401/403/404/409/500) and idempotency are first-round interview questions.
  2. REST Design — resource naming, HTTP verbs, and versioning strategies signal seniority.
  3. Spring MVC — the @RestController model is the default for most Spring Boot APIs.
  4. Exception Handling@ControllerAdvice + RFC 9457 ProblemDetail is the current best practice.
  5. WebFlux & Reactive — study after MVC; reactive is adopted for high-throughput scenarios but adds complexity.
  6. OpenAPI & Springdoc — auto-generate live API documentation from Spring annotations.
  • Spring Bootspring-boot-starter-web bootstraps the Spring MVC stack.
  • Spring Security — authentication and CORS configuration live at the web layer.
  • TestingMockMvc and WebTestClient are the tools for testing Spring MVC and WebFlux controllers.