- What is ASP.NET Web API?
- How does Web API differ from ASP.NET MVC?
- What are the main advantages of using Web API?
- What is REST and how does it relate to Web API?
- What are HTTP verbs and how are they used in Web API?
- What is the difference between GET, POST, PUT, DELETE, and PATCH?
- How do you create a simple Web API project in Visual Studio?
- What is routing in Web API?
- Attribute Routing?
- Where we have to set the Route configuration for Web API and MVC?
- Can we use ABC instead of api in routing?
- Write a simple http method?
- Status codes for exception in webapi?
- Difference b/w web api and WCF(How internally it works)? Why we use web api apart from WCF(How internally it works)?
- Authentication in Web API?
- What is diff between MVC and Web API?
- Difference between 3 tier and MVC?
- Explain HTTP module?
- Error handling?
- Action Verbs?
- Can we use Http Post instead of Http Get for get action?
- Is it mandatory to provide those attributes on top of action?
- Which one is secure whether Http Get or Post?
- Authentication and Authorization?
- Role based Authorization?
- Route constraints (how to restrict an action execution when the parameter has doesn’t have the minimum length)?
- Differences between Put and Patch?
- Default return type?
- Attribute routing?
- How to create a custom filter (custom authorization)?
- In which scenario we go for WCF why not Web API?
- Difference between put and post?
- How to send serialize data?
- How do you define a route in Web API?
- What are attribute routing and convention-based routing?
- What is a Web API controller?
- How do you create a Web API controller?
- What is an action method in Web API?
- How do you return different types of responses from an action method?
- What are IActionResult and ActionResult?
- How do you handle exceptions in Web API?
- What is the purpose of the ApiController attribute?
- How do you implement dependency injection in Web API?
- What is the difference between synchronous and asynchronous action methods?
- How do you create an asynchronous action method?
- What is model binding in Web API?
- How do you validate a model in Web API?
- What is ModelState and how is it used?
- How do you use data annotations for validation?
- What is the difference between FromBody, FromUri, and FromForm?
- How do you implement authentication in Web API?
- What is the difference between authentication and authorization?
- How do you implement authorization in Web API?
- What are the different types of authentications available in Web API?
- How do you secure a Web API using JWT (JSON Web Token)?
- What is CORS and how do you enable it in Web API?
- How do you implement HTTPS in Web API
- What is OData and how do you use it in Web API?
- How do you implement versioning in Web API?
- What is content negotiation in Web API?
- How do you customize content negotiation?
- What are media type formatters in Web API?
- How do you create a custom media type formatter?
- What is dependency injection and how is it implemented in Web API?
- How do you use filters in Web API?
- What are action filters, authorization filters, and exception filters?
- How do you implement logging in Web API?
- What is the role of middleware in ASP.NET Core Web API?
- How do you handle file uploads in Web API?
- How do you implement caching in Web API?
- Performance and Scalability
- How do you improve the performance of a Web API?
- What are some best practices for designing a scalable Web API?
- How do you use async/await to improve performance in Web API?
- What is rate limiting and how do you implement it in Web API?
- How do you monitor and diagnose performance issues in Web API?
- How do you implement security?
- What is Enable core?
- How do you set expiration for cache?
- Explain API Rate Limiting?
- How to paginate API?
- What is Content negotiation?
Posted inASP.NET Web API Interview Questions