Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Short answer: A REST (Representational State Transfer) API is an architectural style for designing networked applications. It uses HTTP methods (GET, POST, PUT, DELETE) to perform operations on resources identified by UR…
Short answer: HTTP provides the transport mechanism and defines methods: GET → Retrieve data POST → Create resource PUT → Update resource DELETE → Remove resource PATCH → Partial update Real-world example (ShopNest) Crea…
Short answer: An endpoint is a specific URL that represents a resource in a REST API. 👉 Example: → Represents user with ID 1. Real-world example (ShopNest) Creating an order is POST /api/orders → 201 with Location heade…
Short answer: In REST, everything is modeled as a resource (users, products, orders). Each resource is identified by a URI and can be manipulated using standard HTTP methods. Real-world example (ShopNest) Creating an ord…
Short answer: Middleware is software that sits between client requests and server responses. Used for: Logging Authentication & Authorization Request validation Error handling Rate limiting Real-world example (ShopNe…
Short answer: Idempotency means multiple identical requests have the same effect as one. PUT → Updating a resource with the same data multiple times results in no further change. DELETE → Deleting a resource repeatedly s…
Short answer: It indicates the request was successful, and the server is returning the expected response body (e.g., GET request returning data). Say this in the interview Define — one clear sentence (the short answer ab…
Short answer: 404 Not Found → The resource does not exist (or the client requested the wrong endpoint). 410 Gone → The resource used to exist but has been permanently removed. Real-world example (ShopNest) ShopNest expos…
Short answer: It indicates the request was well-formed (valid syntax) but could not be processed due to semantic errors. 👉 Example: Submitting a form where email is valid format but already exists. Real-world example (S…
Short answer: It indicates the server timed out waiting for the client’s request. 👉 Example: Client took too long to send data in a POST request. Real-world example (ShopNest) Creating an order is POST /api/orders → 201…
Short answer: 401 Unauthorized → Authentication required (client not logged in / invalid token). 403 Forbidden → Authentication is valid, but the user lacks permissions. Real-world example (ShopNest) Creating an order is…
Short answer: Statelessness means each client request to the server must contain all the necessary information to process it (like authentication token, parameters, body). Explain a bit more The server does not store cli…
Short answer: Responses from the server should indicate whether they are cacheable or not, to improve performance and scalability. Clients and intermediaries can reuse cached responses. 👉 Example in ASP.NET Core: [HttpG…
Short answer: The uniform interface ensures that REST APIs follow consistent conventions for communication, making them predictable and easy to use. Key aspects: Use of standard HTTP methods (GET, POST, PUT, DELETE). Res…
Short answer: Each request and response should have enough metadata (headers, content type, status codes) to describe how to process it, without external context. 👉 Example in ASP.NET Core: return Ok(new { Id = 1, Name…
Short answer: How would you version a REST API? Versioning ensures backward compatibility when APIs change. Common approaches: URI versioning → /api/v1/users Header-based versioning → Accept: application/vnd.myapi.v1+jso…
Short answer: Versioning ensures backward compatibility when APIs change. Common approaches: URI versioning → /api/v1/users Header-based versioning → Accept: application/vnd.myapi.v1+json Query parameter → /users?version…
Short answer: Lightweight and easy to parse. Language independent. Human-readable. Supported natively by JavaScript and most frameworks. Real-world example (ShopNest) Creating an order is POST /api/orders → 201 with Loca…
Short answer: Use throttling to limit requests per minute/hour per client. Return 429 Too Many Requests. Provide Retry-After header. Tools: API Gateway, NGINX, Middleware. Real-world example (ShopNest) Creating an order…
Short answer: An API key is a unique token used to authenticate requests. 👉 Example code GET /users?apikey=12345 Best practice: Send in headers → Authorization: ApiKey 12345. Real-world example (ShopNest) Creating an or…
Short answer: Synchronous → Client waits until the server responds (blocking). Asynchronous → Server processes request in background and may send response later (via polling, callbacks, or webhooks). Real-world example (…
Short answer: Used for CORS preflight requests. Tells the client which HTTP methods and headers are allowed. 👉 Example Response: Allow: GET, POST, PUT, DELETE Access-Control-Allow-Origin: * Real-world example (ShopNest)…
Short answer: Provides clear usage guidelines for developers. Reduces onboarding time for new teams. Ensures consistency across different services. Helps with discoverability of endpoints, parameters, request/response fo…
Short answer: rchitecture? API Gateway is a single entry point for APIs in a microservices architecture. Handles routing, load balancing, authentication, rate limiting, logging, monitoring. Examples: Kong, NGINX, AWS API…
Short answer: Rate limiting restricts the number of API requests per user/IP in a given time. Prevents abuse (DDoS, brute force). Ensures fair usage and protects backend systems. Return 429 Too Many Requests with Retry-A…
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: A REST (Representational State Transfer) API is an architectural style for designing networked applications. It uses HTTP methods (GET, POST, PUT, DELETE) to perform operations on resources identified by URLs (endpoints). Data is usually exchanged in JSON or XML format.
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: HTTP provides the transport mechanism and defines methods: GET → Retrieve data POST → Create resource PUT → Update resource DELETE → Remove resource PATCH → Partial update
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: An endpoint is a specific URL that represents a resource in a REST API. 👉 Example: → Represents user with ID 1.
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: In REST, everything is modeled as a resource (users, products, orders). Each resource is identified by a URI and can be manipulated using standard HTTP methods.
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Middleware is software that sits between client requests and server responses. Used for: Logging Authentication & Authorization Request validation Error handling Rate limiting
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Idempotency means multiple identical requests have the same effect as one. PUT → Updating a resource with the same data multiple times results in no further change. DELETE → Deleting a resource repeatedly still results in it being deleted.
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: It indicates the request was successful, and the server is returning the expected response body (e.g., GET request returning data).
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: 404 Not Found → The resource does not exist (or the client requested the wrong endpoint). 410 Gone → The resource used to exist but has been permanently removed.
ShopNest exposes REST APIs for cart and checkout. Controllers stay thin; business rules live in application services.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: It indicates the request was well-formed (valid syntax) but could not be processed due to semantic errors. 👉 Example: Submitting a form where email is valid format but already exists.
ShopNest exposes REST APIs for cart and checkout. Controllers stay thin; business rules live in application services.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: It indicates the server timed out waiting for the client’s request. 👉 Example: Client took too long to send data in a POST request.
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: 401 Unauthorized → Authentication required (client not logged in / invalid token). 403 Forbidden → Authentication is valid, but the user lacks permissions.
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Statelessness means each client request to the server must contain all the necessary information to process it (like authentication token, parameters, body).
The server does not store client session state. 👉 Example in ASP.NET Core Web API: [HttpGet("profile")] public IActionResult GetProfile([FromHeader] string token) if (string.IsNullOrEmpty(token)) return Unauthorized(); // Token is validated each time (stateless, no session memory) return Ok(new { Name = "John Doe", Email = "john@example.com" }); }
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Responses from the server should indicate whether they are cacheable or not, to improve performance and scalability. Clients and intermediaries can reuse cached responses. 👉 Example in ASP.NET Core: [HttpGet("products")] [ResponseCache(Duration = 60)] // Cache for 60 seconds public IActionResult GetProducts()
{
return Ok(new[] { "Laptop", "Mouse", "Keyboard" });
}
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: The uniform interface ensures that REST APIs follow consistent conventions for communication, making them predictable and easy to use. Key aspects: Use of standard HTTP methods (GET, POST, PUT, DELETE). Resource identification via URIs. Resource representations (JSON, XML). Self-descriptive messages.
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Each request and response should have enough metadata (headers, content type, status codes) to describe how to process it, without external context. 👉 Example in ASP.NET Core: return Ok(new { Id = 1, Name = "John", Links = new[] { new { Rel = "self", Href = "/users/1" } } }); Here, the response describes itself (content type = JSON, includes resource links).
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: How would you version a REST API? Versioning ensures backward compatibility when APIs change. Common approaches: URI versioning → /api/v1/users Header-based versioning → Accept: application/vnd.myapi.v1+json Query parameter → /users?version=1
ShopNest mobile app sends a JWT Bearer token. The API validates it and uses the user id from claims to load that user’s cart only.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Versioning ensures backward compatibility when APIs change. Common approaches: URI versioning → /api/v1/users Header-based versioning → Accept: application/vnd.myapi.v1+json Query parameter → /users?version=1
ShopNest mobile app sends a JWT Bearer token. The API validates it and uses the user id from claims to load that user’s cart only.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Lightweight and easy to parse. Language independent. Human-readable. Supported natively by JavaScript and most frameworks.
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Use throttling to limit requests per minute/hour per client. Return 429 Too Many Requests. Provide Retry-After header. Tools: API Gateway, NGINX, Middleware.
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: An API key is a unique token used to authenticate requests. 👉
GET /users?apikey=12345 Best practice: Send in headers → Authorization: ApiKey 12345.
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Synchronous → Client waits until the server responds (blocking). Asynchronous → Server processes request in background and may send response later (via polling, callbacks, or webhooks).
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Used for CORS preflight requests. Tells the client which HTTP methods and headers are allowed. 👉 Example Response: Allow: GET, POST, PUT, DELETE Access-Control-Allow-Origin: *
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Provides clear usage guidelines for developers. Reduces onboarding time for new teams. Ensures consistency across different services. Helps with discoverability of endpoints, parameters, request/response formats. 👉 Tools: Swagger (OpenAPI), Postman, Redoc.
ShopNest exposes REST APIs for cart and checkout. Controllers stay thin; business rules live in application services.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: rchitecture? API Gateway is a single entry point for APIs in a microservices architecture. Handles routing, load balancing, authentication, rate limiting, logging, monitoring. Examples: Kong, NGINX, AWS API Gateway, Azure API Management. Use when: You have multiple microservices. Need centralized authentication/security. Need rate limiting or… monitoring.
ShopNest exposes REST APIs for cart and checkout. Controllers stay thin; business rules live in application services.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Rate limiting restricts the number of API requests per user/IP in a given time. Prevents abuse (DDoS, brute force). Ensures fair usage and protects backend systems. Return 429 Too Many Requests with Retry-After header. 👉 Example: 100 requests/minute per API key.
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.
Install Toolliyo like an app Free
Home-screen access to tutorials, coding practice & career tools — no app store needed.
On iPhone/iPad: tap Share then Add to Home Screen.