Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
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…
Short answer: Ensures correctness, reliability, performance, and security of APIs. Postman → Manual and automated API testing, environment variables, collections. Swagger (OpenAPI) → Live documentation, mock servers, aut…
Short answer: Caching is storing frequently used data temporarily to reduce server load and improve response time. Implementation methods: HTTP caching headers (Cache-Control, ETag, Expires). Reverse proxies (Varnish, NG…
Short answer: Content negotiation allows clients to specify desired response format. Uses HTTP headers: Accept: application/json → Request JSON. Accept: application/xml → Request XML. The server returns response in reque…
Short answer: PI performance? A CDN caches and delivers static or semi-static content from edge servers close to users. Reduces latency and improves response times. Helps with traffic offloading, reducing load on origin…
Short answer: A CDN caches and delivers static or semi-static content from edge servers close to users. Reduces latency and improves response times. Helps with traffic offloading, reducing load on origin servers. Support…
Short answer: Swagger/OpenAPI is a specification for defining REST APIs. Provides machine-readable and human-readable documentation. Enables automatic client SDK generation, testing, and validation. Improves team collabo…
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.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Ensures correctness, reliability, performance, and security of APIs. Postman → Manual and automated API testing, environment variables, collections. Swagger (OpenAPI) → Live documentation, mock servers, auto-generated client SDKs. Automates QA process and reduces bugs in production.
ASP.NET Web API ASP.NET Core Web API Tutorial · REST API
Short answer: Caching is storing frequently used data temporarily to reduce server load and improve response time. Implementation methods: HTTP caching headers (Cache-Control, ETag, Expires). Reverse proxies (Varnish, NGINX). In-memory stores (Redis, Memcached). Client-side caching using 304 Not Modified.
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: Content negotiation allows clients to specify desired response format. Uses HTTP headers: Accept: application/json → Request JSON. Accept: application/xml → Request XML. The server returns response in requested format (if supported). 👉 Example in ASP.NET Core: Add XML formatter with services.AddControllers() .AddXmlSerializerFormatters();
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: PI performance? A CDN caches and delivers static or semi-static content from edge servers close to users. Reduces latency and improves response times. Helps with traffic offloading, reducing load on origin servers. Supports DDoS protection and scaling under heavy loads. 👉 Cloudflare, Akamai, AWS CloudFront. Real-world example… (ShopNest) ShopNest… exposes REST APIs for cart and checkout. Controllers stay thin;…
business rules live in application services. PI performance? A CDN caches and delivers static or semi-static content from edge servers close to users. Reduces latency and improves response times. Helps with traffic offloading, reducing load on origin servers. Supports DDoS protection and scaling under heavy loads. 👉
Cloudflare, Akamai, AWS CloudFront. Real-world example… (ShopNest) 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: A CDN caches and delivers static or semi-static content from edge servers close to users. Reduces latency and improves response times. Helps with traffic offloading, reducing load on origin servers. Supports DDoS protection and scaling under heavy loads. 👉 Example: Cloudflare, Akamai, AWS CloudFront.
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: Swagger/OpenAPI is a specification for defining REST APIs. Provides machine-readable and human-readable documentation. Enables automatic client SDK generation, testing, and validation. Improves team collaboration and consistency in API design.
ShopNest exposes REST APIs for cart and checkout. Controllers stay thin; business rules live in application services.