.NET

Web API Development

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

22 면접 질문·
Mid-Level
1

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

답변

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?

답변

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?

답변

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 면접 질문

다음 면접을 위해 .NET을 마스터하세요

모든 질문, flashcards, 기술 테스트, 코드 리뷰 연습, 면접 시뮬레이터에 접근하세요.

무료로 시작하기