100 ASP.NET Web API Interview Questions for Senior Developers π
Introduction
ASP.NET Web API is a framework for building HTTP-based services that can be consumed by a wide range of clients, including browsers, mobile devices, and desktop applications. For senior .NET developers, especially those working with backend systems and microservices, mastering Web API concepts is critical. This blog organizes 100 commonly asked Web API interview questions into structured sections, making it easier to study and prepare.
1. Web API Basics
What is ASP.NET Web API?
Difference between Web API and MVC?
Difference between Web API and WCF?
Difference between REST API and SOAP API?
What is REST?
REST constraints?
What are HTTP methods?
Difference between PUT and PATCH?
Difference between POST and PUT?
What is idempotent method?
2. HTTP / Request / Response
What is HTTP status code?
Common status codes?
Difference between 200, 201, 204?
Difference between 400, 401, 403, 404?
Difference between 500 and 503?
What is content negotiation?
What is media type?
What is Accept header?
What is Content-Type?
What is ETag?
3. Routing
What is routing?
Attribute routing?
Conventional routing?
Route constraints?
Optional parameters in route?
What is endpoint routing?
How routing works internally?
What is area?
Difference between MapControllers and MapControllerRoute?
Custom route?
4. Controllers / Actions
What is ApiController?
What is ControllerBase?
Difference between Controller and ControllerBase?
IActionResult vs ActionResult?
What is FromBody?
What is FromQuery?
What is FromRoute?
What is FromHeader?
What is FromForm?
What is model binding?
5. Validation
What is model validation?
What is Data Annotation?
Custom validation?
How ApiController auto-validates?
FluentValidation?
6. Security
Authentication vs Authorization?
JWT authentication?
OAuth2?
OpenID Connect?
Role-based authorization?
Policy-based authorization?
Claims-based authorization?
API Key authentication?
What is CORS?
CSRF in Web API?
7. Middleware / Filters
What is middleware?
Order of middleware?
Custom middleware?
Exception handling middleware?
What are filters?
Action filter?
Authorization filter?
Exception filter?
Resource filter?
Middleware vs filter?
8. Dependency Injection
What is DI?
What are service lifetimes?
Singleton vs Scoped vs Transient?
Circular dependency?
IServiceProvider?
9. Logging / Monitoring
What is ILogger?
Structured logging?
Serilog / NLog?
Correlation ID?
Health checks?
OpenTelemetry?
Distributed tracing?
Application Insights?
Logging request/response?
How to monitor production API?
10. Performance / Caching
Response caching?
Output caching?
Distributed caching?
Redis caching?
How to improve API performance?
Compression?
Async controller action?
Connection pooling?
Rate limiting?
API throttling?
11. Versioning / Documentation / Real-world
API versioning?
URL vs Header versioning?
Swagger / OpenAPI?
How to document API?
File upload API?
File download API?
How to secure file upload?
How to troubleshoot slow API?
How to deploy Web API?
Best practices for designing REST API?
Conclusion
These 100 questions cover the breadth of ASP.NET Web API knowledge expected from senior developers. From basics and routing to advanced performance tuning, security, and real-world scenarios, this list serves as a comprehensive guide for interview preparation. By mastering these topics, you’ll not only be ready for interviews but also equipped to build robust, scalable, and secure APIs in real-world projects.
This was part of Interview Preparation With Bipin — Let’s Crack It!
Comments
Post a Comment