Interview Q&A

Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.

4608 total questions 4508 technical 100 career & HR 4272 from PDF library

Showing 51–67 of 67

Popular tracks

Mid PDF
How would you handle cross-origin requests (CORS) in a REST API?

Short answer: Configure CORS policy on the server. Allow specific origins, headers, and methods. 👉 Example in ASP.NET Core: services.AddCors(options => { options.AddPolicy("MyPolicy", builder => builder.…

REST API Read answer
Mid PDF
What are idempotent operations, and why are they important in RESTful design?

Short answer: Idempotent = multiple identical requests have the same effect as one request. Important for reliability and safe retries. HTTP Methods: GET, PUT, DELETE → Idempotent. POST → Not idempotent (creates new reso…

REST API Read answer
Mid PDF
What are RESTful conventions for HTTP status codes and error handling?

Short answer: 2xx Success → 200 (OK), 201 (Created). 4xx Client Errors → 400 (Bad Request), 401 (Unauthorized), 404 (Not Found). 5xx Server Errors → 500 (Internal Server Error), 503 (Service Unavailable). Error responses…

REST API Read answer
Mid PDF
What strategies can be used to ensure the scalability of a REST API?

Short answer: Horizontal scaling → Add more servers/containers. Load balancing across multiple instances. Database optimization (indexes, partitioning, read replicas). Caching at server, client, and CDN levels. Use async…

REST API Read answer
Mid PDF
How do you handle load balancing in REST API services?

Short answer: Use a load balancer (NGINX, HAProxy, AWS ELB, Azure Front Door). Distribute traffic across multiple instances to avoid bottlenecks. Support round-robin, least connections, or IP hash strategies. Enable heal…

REST API Read answer
Mid PDF
How do you optimize the performance of a RESTful API?

Short answer: Reduce payload size (use JSON instead of XML, compress responses). Implement pagination for large datasets. Apply caching at multiple levels. Use async I/O (non-blocking calls). Minimize database calls (bat…

REST API Read answer
Mid PDF
What are the trade-offs of different caching strategies in REST APIs?

Short answer: Client-side caching → Reduces server calls, but may serve stale data. Server-side caching → Faster responses, but increases memory usage. Proxy caching/CDN → Global scalability, but harder cache invalidatio…

REST API Read answer
Mid PDF
How do you implement server-side filtering, sorting, and searching in

Short answer: REST API? Add query parameters: Filtering: /products?category=shoes&brand=nike Sorting: /products?sort=price_asc Searching: /products?search=wireless+headphones Use LINQ/SQL queries in backend. Ensure q…

REST API Read answer
Mid PDF
How do you implement server-side filtering, sorting, and searching in a REST API?

Short answer: Add query parameters: Filtering: /products?category=shoes&brand=nike Sorting: /products?sort=price_asc Searching: /products?search=wireless+headphones Use LINQ/SQL queries in backend. Ensure query optim…

REST API Read answer
Mid PDF
How do you minimize latency in REST API calls?

Short answer: Deploy servers closer to users (geo-distributed hosting). Use CDNs for static content. Apply connection pooling for databases. Reduce number of API calls (batching, GraphQL alternative). Use HTTP/2 or gRPC…

REST API Read answer
Mid PDF
What tools can be used for API documentation?

Short answer: Swagger/OpenAPI → Standard for REST API design and documentation. Postman → Can generate collections and documentation automatically. Redoc → Static documentation from OpenAPI specs. RAML → RESTful API Mode…

REST API Read answer
Mid PDF
How do you generate API documentation automatically from your codebase?

Short answer: In ASP.NET Core: Use Swashbuckle package to generate Swagger UI from controllers and annotations. Explain a bit more services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = &…

REST API Read answer
Mid PDF
How would you handle exceptions in REST APIs?

Short answer: Use try-catch blocks in code to catch exceptions. Implement global exception handling middleware in ASP.NET Core: app.UseExceptionHandler(appError => { appError.Run(async context => { Example code con…

REST API Read answer
Mid PDF
What does the "404 Not Found" status code mean, and how can it be used for error handling?

Short answer: Indicates the requested resource does not exist. Use when resource ID is invalid or missing. Helps clients handle missing data gracefully. Example in ASP.NET Core: var user = db.Users.Find(id); Example code…

REST API Read answer
Mid PDF
How would you handle validation errors in a REST API?

Short answer: Use model validation with data annotations: public class UserModel Example code { [Required] [EmailAddress] public string Email { get; set; } } Return 400 Bad Request with a list of validation errors: { &qu…

REST API Read answer
Mid PDF
What logging strategies would you use to debug issues in a REST

Short answer: PI? Structured logging with libraries like Serilog, NLog, or built-in ILogger. Log requests and responses, including headers and payloads (avoid sensitive info). Use correlation IDs to trace requests across…

REST API Read answer
Mid PDF
What logging strategies would you use to debug issues in a REST API?

Short answer: Structured logging → Serilog, NLog, or built-in ILogger in ASP.NET Core. Request/response logging for debugging API calls. Correlation IDs to trace requests across microservices. Centralized logging → ELK S…

REST API Read answer

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Configure CORS policy on the server. Allow specific origins, headers, and methods. 👉 Example in ASP.NET Core: services.AddCors(options => { options.AddPolicy("MyPolicy", builder => builder.WithOrigins(" .AllowAnyHeader() .AllowAnyMethod()); }); Apply with app.UseCors("MyPolicy");.

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Idempotent = multiple identical requests have the same effect as one request. Important for reliability and safe retries. HTTP Methods: GET, PUT, DELETE → Idempotent. POST → Not idempotent (creates new resource each time).

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: 2xx Success → 200 (OK), 201 (Created). 4xx Client Errors → 400 (Bad Request), 401 (Unauthorized), 404 (Not Found). 5xx Server Errors → 500 (Internal Server Error), 503 (Service Unavailable). Error responses should include structured messages: { "status": 400, "error": "Invalid Data", "details": "Email is required" }

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Horizontal scaling → Add more servers/containers. Load balancing across multiple instances. Database optimization (indexes, partitioning, read replicas). Caching at server, client, and CDN levels. Use asynchronous processing for long-running tasks. Apply rate limiting and throttling to prevent abuse. Adopt microservices architecture for modular scaling.

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Use a load balancer (NGINX, HAProxy, AWS ELB, Azure Front Door). Distribute traffic across multiple instances to avoid bottlenecks. Support round-robin, least connections, or IP hash strategies. Enable health checks to route traffic only to healthy instances. Combine with auto-scaling for dynamic traffic management.

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Reduce payload size (use JSON instead of XML, compress responses). Implement pagination for large datasets. Apply caching at multiple levels. Use async I/O (non-blocking calls). Minimize database calls (batch queries, stored procedures). Enable GZIP compression on responses. Profile and monitor using APM tools (New Relic, Application Insights).

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Client-side caching → Reduces server calls, but may serve stale data. Server-side caching → Faster responses, but increases memory usage. Proxy caching/CDN → Global scalability, but harder cache invalidation. Database caching (Redis) → Faster queries, but adds complexity and consistency issues.

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: REST API? Add query parameters: Filtering: /products?category=shoes&brand=nike Sorting: /products?sort=price_asc Searching: /products?search=wireless+headphones Use LINQ/SQL queries in backend. Ensure query optimization with indexes. Implement validation to prevent SQL injection.

Real-world example (ShopNest)

ShopNest exposes REST APIs for cart and checkout. Controllers stay thin; business rules live in application services.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Add query parameters: Filtering: /products?category=shoes&brand=nike Sorting: /products?sort=price_asc Searching: /products?search=wireless+headphones Use LINQ/SQL queries in backend. Ensure query optimization with indexes. Implement validation to prevent SQL injection.

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Deploy servers closer to users (geo-distributed hosting). Use CDNs for static content. Apply connection pooling for databases. Reduce number of API calls (batching, GraphQL alternative). Use HTTP/2 or gRPC for faster communication. Monitor latency with APM tools and optimize bottlenecks.

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Swagger/OpenAPI → Standard for REST API design and documentation. Postman → Can generate collections and documentation automatically. Redoc → Static documentation from OpenAPI specs. RAML → RESTful API Modeling Language. Stoplight, Apiary, Docusaurus → Modern documentation and mocking platforms.

Real-world example (ShopNest)

ShopNest exposes REST APIs for cart and checkout. Controllers stay thin; business rules live in application services.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: In ASP.NET Core: Use Swashbuckle package to generate Swagger UI from controllers and annotations.

Explain a bit more

services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" }); }); app.UseSwagger(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API v1")); Other frameworks (Node.js: swagger-jsdoc, Spring Boot: springdoc-openapi) also support annotations and automatic documentation.

Real-world example (ShopNest)

ShopNest exposes REST APIs for cart and checkout. Controllers stay thin; business rules live in application services.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Use try-catch blocks in code to catch exceptions. Implement global exception handling middleware in ASP.NET Core: app.UseExceptionHandler(appError => { appError.Run(async context => {

Example code

context.Response.StatusCode = 500;
context.Response.ContentType = "application/json";
await context.Response.WriteAsync(new { message = "Internal Server Error" }.ToString()); }); }); Log exceptions for debugging and monitoring.

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Indicates the requested resource does not exist. Use when resource ID is invalid or missing. Helps clients handle missing data gracefully. Example in ASP.NET Core: var user = db.Users.Find(id);

Example code

if(user == null) return NotFound(new { status=404, error="User not found" });

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Use model validation with data annotations: public class UserModel

Example code

{ [Required] [EmailAddress] public string Email { get; set; }
} Return 400 Bad Request with a list of validation errors: { "status": 400, "error": "Validation Failed", "details": ["Email is required", "Password must be at least 6 characters"] }

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: PI? Structured logging with libraries like Serilog, NLog, or built-in ILogger. Log requests and responses, including headers and payloads (avoid sensitive info). Use correlation IDs to trace requests across services. Centralize logs using ELK Stack, Seq, or Azure Application Insights. Log different levels: Information, Warning, Error,… Critical. Example……… using ILogger in ASP.NET Core: private readonly…

Explain a bit more

ILogger<MyController> _logger; public MyController(ILogger<MyController> logger) { _logger = logger; } [HttpGet("{id}")] public IActionResult GetUser(int id) { _logger.LogInformation("Fetching user with id {UserId}", id); try { var user = dbContext.Users.Find(id); if (user == null) { _logger.LogWarning("User with id {UserId} not found", id); return NotFound(); } return Ok(user); } catch (Exception ex) { _logger.LogError(ex, "Error fetching user with id {UserId}", id); return StatusCode(500, "Internal Server Error"); } } This covers all core aspects of error handling and debugging for REST APIs. public MyController(ILogger<MyController> logger)

Example code

{
_logger = logger;
} [HttpGet("{id}")] public IActionResult GetUser(int id)
{ _logger.LogInformation("Fetching user with id {UserId}", id); try {
var user = dbContext.Users.Find(id);
if (user == null)
{ _logger.LogWarning("User with id {UserId} not found", id); return NotFound();
}
return Ok(user);
} catch (Exception ex) { _logger.LogError(ex, "Error fetching user with id {UserId}", id); return StatusCode(500, "Internal Server Error");
}
} This covers all core aspects of error handling and debugging for REST APIs.

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Web API ASP.NET Core Web API Tutorial · REST API

Short answer: Structured logging → Serilog, NLog, or built-in ILogger in ASP.NET Core. Request/response logging for debugging API calls. Correlation IDs to trace requests across microservices. Centralized logging → ELK Stack, Seq, Azure Application Insights. Log errors, warnings, and important info (not sensitive data). Q&A

Example code

Structured logging → Serilog, NLog, or built-in ILogger in ASP.NET Core. Request/response logging for debugging API calls. Correlation IDs to trace requests across microservices. Centralized logging → ELK Stack, Seq, Azure Application Insights. Log errors, warnings, and important info (not sensitive data). Q&A

Real-world example (ShopNest)

Creating an order is POST /api/orders → 201 with Location header. Fetching is GET /api/orders/{id} → 200 or 404.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details