.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 แบบทดสอบเทคนิค แบบฝึกหัด code review และตัวจำลองสัมภาษณ์

เริ่มใช้ฟรี