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: Statelessness → Each request is independent; the server doesn’t store client state. Explain a bit more Client-Server Architecture → Separation of concerns between client UI and server logic. Uniform Interfa…
Short answer: uthorization: Bearer <token> Real-world example (ShopNest) 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. Say this i…
Short answer: Client sends token in Authorization header: Authorization: Bearer <token> Real-world example (ShopNest) ShopNest exposes REST APIs for cart and checkout. Controllers stay thin; business rules live in…
Short answer: REST → Lightweight, uses HTTP, usually JSON, easy to use, stateless. SOAP → Protocol-based, uses XML, more complex, built-in security & transactions. REST is more flexible and widely used for web and mo…
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: Stateless means the server does not store client session data. Each request must contain all the necessary information (like authentication tokens). This makes APIs scalable and reliable. Real-world example…
Short answer: Platform-independent (works across web, mobile, IoT). Simple, flexible, and scalable. Uses existing HTTP infrastructure. Lightweight (JSON/XML). Supports caching for better performance. Real-world example (…
Short answer: Easier to learn & implement. Supports multiple formats (JSON, XML, plain text). Faster (less overhead). Works seamlessly with modern web & mobile apps. Better performance due to caching & statel…
Short answer: Suppose we have a User Service API: GET /users → Get all users GET /users/1 → Get user with ID=1 POST /users → Create a new user PUT /users/1 → Update user with ID=1 DELETE /users/1 → Delete user with ID=1…
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: HATEOAS (Hypermedia As The Engine Of Application State) means responses contain links to related actions/resources. 👉 Example code { "id": 1, "name": "John", "links"…
Short answer: Common methods: API Keys → Simple tokens. Basic Auth → Username & password (not secure without HTTPS). OAuth 2.0 / OpenID Connect → Standard protocols for secure access. JWT (JSON Web Tokens) → Widely u…
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: GET → Used to retrieve data, should not modify server state, and can be cached/bookmarked. POST → Used to create new resources or submit data. It modifies server state, is not idempotent, and cannot be cach…
Short answer: 200 OK → If the resource was successfully deleted and a response body is returned. 204 No Content → If the resource was deleted but no body is needed. 404 Not Found → If the resource does not exist. Real-wo…
Short answer: Safe → Because it only retrieves data without modifying server state. Idempotent → Multiple GET requests have the same result; no side effects occur. Real-world example (ShopNest) Creating an order is POST…
Short answer: Yes. If the resource does not exist, PUT can create it at the specified URI. Example: 👉 PUT /users/100 → If user 100 doesn’t exist, it will be created. Real-world example (ShopNest) Creating an order is PO…
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: PATCH → Updates only the specified fields (partial update). PUT → Replaces the entire resource representation. 👉 Example code PATCH /users/1 { "email": "new@email.com" } → Updates only…
Short answer: PI? The GET method is used to fetch data because it is safe, idempotent, and optimized for retrieval operations. Real-world example (ShopNest) Creating an order is POST /api/orders → 201 with Location heade…
Short answer: The GET method is used to fetch data because it is safe, idempotent, and optimized for retrieval operations. Real-world example (ShopNest) Creating an order is POST /api/orders → 201 with Location header. F…
Short answer: PIs? HTTP status codes are 3-digit numbers returned by the server to indicate the result of a client request. They are important because they: Communicate success, failure, or redirection. Help clients hand…
Short answer: HTTP status codes are 3-digit numbers returned by the server to indicate the result of a client request. They are important because they: Communicate success, failure, or redirection. Help clients handle re…
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: Statelessness → Each request is independent; the server doesn’t store client state.
Client-Server Architecture → Separation of concerns between client UI and server logic. Uniform Interface → Standard HTTP methods and URIs. Cacheable → Responses can be cached to improve performance. Layered System → APIs can use intermediaries (like load balancers, proxies). Resource-based → Everything is treated as a resource (like users, orders, products).
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: uthorization: Bearer <token>
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: Client sends token in Authorization header: Authorization: Bearer <token>
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: REST → Lightweight, uses HTTP, usually JSON, easy to use, stateless. SOAP → Protocol-based, uses XML, more complex, built-in security & transactions. REST is more flexible and widely used for web and mobile apps.
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: Stateless means the server does not store client session data. Each request must contain all the necessary information (like authentication tokens). This makes APIs scalable and reliable.
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: Platform-independent (works across web, mobile, IoT). Simple, flexible, and scalable. Uses existing HTTP infrastructure. Lightweight (JSON/XML). Supports caching for better performance.
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: Easier to learn & implement. Supports multiple formats (JSON, XML, plain text). Faster (less overhead). Works seamlessly with modern web & mobile apps. Better performance due to caching & statelessness.
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: Suppose we have a User Service API: GET /users → Get all users GET /users/1 → Get user with ID=1 POST /users → Create a new user PUT /users/1 → Update user with ID=1 DELETE /users/1 → Delete user with ID=1 This shows how CRUD operations map directly to 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: 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: HATEOAS (Hypermedia As The Engine Of Application State) means responses contain links to related actions/resources. 👉
{ "id": 1, "name": "John", "links": [ { "rel": "self", "href": "/users/1" }, { "rel": "orders", "href": "/users/1/orders" } } This helps clients navigate APIs dynamically.
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: Common methods: API Keys → Simple tokens. Basic Auth → Username & password (not secure without HTTPS). OAuth 2.0 / OpenID Connect → Standard protocols for secure access. JWT (JSON Web Tokens) → Widely used for stateless authentication.
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: GET → Used to retrieve data, should not modify server state, and can be cached/bookmarked. POST → Used to create new resources or submit data. It modifies server state, is not idempotent, and cannot be cached.
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: 200 OK → If the resource was successfully deleted and a response body is returned. 204 No Content → If the resource was deleted but no body is needed. 404 Not Found → If the resource does not exist.
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: Safe → Because it only retrieves data without modifying server state. Idempotent → Multiple GET requests have the same result; no side effects occur.
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: Yes. If the resource does not exist, PUT can create it at the specified URI. Example: 👉 PUT /users/100 → If user 100 doesn’t exist, it will be created.
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: PATCH → Updates only the specified fields (partial update). PUT → Replaces the entire resource representation. 👉
PATCH /users/1 { "email": "new@email.com" } → Updates only the email. PUT /users/1 { "name": "John" } → May overwrite other fields like email if not included.
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? The GET method is used to fetch data because it is safe, idempotent, and optimized for retrieval operations.
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 GET method is used to fetch data because it is safe, idempotent, and optimized for retrieval operations.
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: PIs? HTTP status codes are 3-digit numbers returned by the server to indicate the result of a client request. They are important because they: Communicate success, failure, or redirection. Help clients handle responses consistently. Provide debugging and monitoring information.
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 status codes are 3-digit numbers returned by the server to indicate the result of a client request. They are important because they: Communicate success, failure, or redirection. Help clients handle responses consistently. Provide debugging and monitoring information.
Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.