Go

REST API Design

REST principles, versioning, pagination, filtering, HATEOAS, status codes, OpenAPI/Swagger

20 preguntas de entrevista·
Mid-Level
1

What is the fundamental principle of REST?

Respuesta

REST is based on the principle of representing resources accessible via unique URIs. Each resource (user, product, order) has a URI and can be manipulated through standard HTTP verbs (GET, POST, PUT, DELETE). This resource-oriented paradigm enables a scalable and decoupled architecture where the server does not store client session state.

2

Which HTTP method should be used for an idempotent full update of a resource?

Respuesta

PUT is idempotent and completely replaces the resource. Calling PUT multiple times with the same data produces the same result as a single call. In contrast, POST is not idempotent (would create multiple resources), PATCH performs partial updates, and DELETE removes the resource. PUT's idempotence guarantees retry safety in case of network errors.

3

Which HTTP code should be returned after successful creation of a new resource?

Respuesta

The 201 Created code indicates that a resource was successfully created. It is accompanied by a Location header pointing to the URI of the new resource. The 200 OK code is too generic for creation, 204 No Content is used when there is no response body, and 202 Accepted signals asynchronous processing not yet complete.

4

What major difference distinguishes a REST API from an RPC API?

5

What does the statelessness principle mean in REST?

+17 preguntas de entrevista

Domina Go para tu próxima entrevista

Accede a todas las preguntas, flashcards, tests técnicos, ejercicios de code review y simuladores de entrevista.

Empieza gratis