In this article, I will share frequently asked ASP.Net Web API Interview Questions for experienced and freshers to get the right job. Find the list below:-
- Keep reading on Interview Questions on .NET Framework, ASP.NET MVC
ASP.NET WEB API Interview Questions
Introducing ASP.NET Web API
- What is ASP.NET Web API?
- What is the difference between ASP.NET Web API and WCF?
- When to prefer ASP.NET Web API over WCF?
- Which .NET Framework supports ASP.NET Web API?
- Can we consume ASP.NET Web API in applications created using other than .NET?
- What is the difference between ASP.NET MVC application and ASP.NET Web API application?
- What are the RESTful Services?
- What are the new features introduced in ASP.NET Web API 2.0?
- Can we return View from Web API?
- Does ASP.NET Web API replace the WCF?
- What is the difference between Under-Posting and Over-Posting in ASP.NET Web API?
ASP.NET Web API Fundamentals
- What is Request Verbs or HTTP Verbs?
- What is the Request Header?
- What is the Request Body?
- What is the Response Body?
- What are HTTP Status Codes?
- How to provide an alias name for Web API Action?
- What is Parameter Binding in ASP.NET Web API?
- What is FromUri Attribute and How to use FromUri Attribute in ASP.NET Web API?
- What is FromBody Attribute and How to use this Attribute in ASP.NET Web API?
- Can we declare the FromBody attribute on multiple parameters?
- How to get Data from the SQL Server Database using ASP.NET Web API?
- How to Post Data in ASP.NET Web API?
- How to Put or Update Data in ASP.NET Web API?
- How to Delete Data in ASP.NET Web API?
Content Negotiation
- What is Content Negotiation in Web API?
- What is the role of the Quality Factor in Web API request?
- If no Accept header will be specified, then the response will be in which format?
- What is Media-Type Formatter in ASP.NET Web API?
- How can we return data only in JSON or XML formatted data in Web API?
- How can we format or Indent the raw data in Web API?
Web API Security
- What is Authentication?
- What is Authorization?
- What is the use of Authorize Attribute?
- What is Basic HTTP Authentication?
- How to create a custom Basic Authentication Web API filter?
- How to consume or call Web API with Basic HTTP Authentication using jQuery & Ajax if need to consume in the same Domain?
- What are the Advantages and Disadvantages of Basic Authentication?
- What is the Same-Origin Policy?
- How to enable CORS in the Web API project?
- How can we Disable CORS for an Action only in the Web API project?
- How to implement Token-based Authentication in Web API project?
Routing
- How Web API Routes HTTP request to the Controller ASP.NET MVC?
- How to define a route in ASP.NET MVC?
- How to include Action Name in the routing template?
- How to prevent an Action Method to be invoked in Web API?
- What is Attribute-based routing and How can we enable it in a Web API project?
- What is the use of the RoutePrefix attribute?
- What are the Route Constraints?
- Can we use both Convention based routing and attribute routing in the same Web API application?
Web API Versioning
- Why we need Web API Versioning?
- In How many ways we can do Web API Versioning?
- How to achieve Web API Versioning with the URI?
- How to achieve Web API Versioning with the Query string parameter?
- How to achieve Web API Versioning with the Custom Header Parameter?
- How to achieve Web API Versioning with the Accept Header?
Exception Handling and Dependency Injection
- What is Exception handling?
- How to handle the exception with the help of HttpResponseException Class?
- How can we create custom Exception Filter in ASP.NET Web API?
- How can we register custom Exception Filter in ASP.NET Web API?
- How to register an Exception Filter globally?
- What is Dependency Injection?
- What are the different types of techniques to implement Dependency Injection in Web API?
- What are Dependency Injection Containers or DI Containers?
- How to implement Dependency Injection using Ninject DI Container?
Deployment
- How we can Deploy the ASP.NET Web API?
- What are the steps required in order to Deploy the ASP.NET Web API on the IIS Server?
- What are the steps required to Self-Host an ASP.NET Web API?
References: Microsoft Docs – ASP.NET Web API, Stack Overflow – ASP.NET Web API
Conclusion
I hope you liked this article on the asp.net mvc web api interview questions. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.
Leave a Reply