.NET

Web API Development

REST principles, HTTP verbs, status codes, content negotiation, versioning, API design

22 perguntas de entrevistaยท
Mid-Level
1

Which REST principle requires that an API stores no session state between requests?

Resposta

The statelessness principle requires that each request contains all necessary information to be processed. The server maintains no session context between calls. This improves scalability as requests can be handled by any server without state sharing.

2

Which HTTP verb should be used to create a new resource in a REST API?

Resposta

POST is the standard HTTP verb for creating new resources. It is not idempotent: each call creates a new instance. The server typically determines the URI of the created resource and returns it via the Location header with a 201 Created status.

3

Which HTTP status code should be returned after a successful resource creation with POST?

Resposta

The 201 Created status code indicates that a new resource has been successfully created. It should be accompanied by a Location header containing the URI of the created resource. This allows the client to immediately retrieve the resource via GET, unlike 200 OK which doesn't provide this semantic.

4

What is the main difference between PUT and PATCH in a REST API?

5

Which HTTP status code should be returned when a requested resource does not exist?

+19 perguntas de entrevista

Domine .NET para sua proxima entrevista

Acesse todas as perguntas, flashcards, testes tecnicos, exercicios de code review e simuladores de entrevista.

Comece gratis