ASP.NET Web API- Interview questions

  1. What is ASP.NET Web API?
  2. How does Web API differ from ASP.NET MVC?
  3. What are the main advantages of using Web API?
  4. What is REST and how does it relate to Web API?
  5. What are HTTP verbs and how are they used in Web API?
  6. What is the difference between GET, POST, PUT, DELETE, and PATCH?
  7. How do you create a simple Web API project in Visual Studio?
  8. What is routing in Web API?
  9. Attribute Routing?
  10. Where we have to set the Route configuration for Web API and MVC?
  11. Can we use ABC instead of api in routing?
  12. Write a simple http method?
  13. Status codes for exception in webapi?
  14. Difference b/w web api and WCF(How internally it works)? Why we use web api apart from WCF(How internally it works)?
  15. Authentication in Web API?
  16. What is diff between MVC and Web API?
  17. Difference between 3 tier and MVC?
  18. Explain HTTP module?
  19. Error handling?
  20. Action Verbs?
  21. Can we use Http Post instead of Http Get for get action?
  22. Is it mandatory to provide those attributes on top of action?
  23. Which one is secure whether Http Get or Post?
  24. Authentication and Authorization?
  25. Role based Authorization?
  26. Route constraints (how to restrict an action execution when the parameter has doesn’t have the minimum length)?
  27. Differences between Put and Patch?
  28. Default return type?
  29. Attribute routing?
  30. How to create a custom filter (custom authorization)?
  31. In which scenario we go for WCF why not Web API?
  32. Difference between put and post?
  33. How to send serialize data?
  34. How do you define a route in Web API?
  35. What are attribute routing and convention-based routing?
  36. What is a Web API controller?
  37. How do you create a Web API controller?
  38. What is an action method in Web API?
  39. How do you return different types of responses from an action method?
  40. What are IActionResult and ActionResult?
  41. How do you handle exceptions in Web API?
  42. What is the purpose of the ApiController attribute?
  43. How do you implement dependency injection in Web API?
  44. What is the difference between synchronous and asynchronous action methods?
  45. How do you create an asynchronous action method?
  46. What is model binding in Web API?
  47. How do you validate a model in Web API?
  48. What is ModelState and how is it used?
  49. How do you use data annotations for validation?
  50. What is the difference between FromBody, FromUri, and FromForm?
  51. How do you implement authentication in Web API?
  52. What is the difference between authentication and authorization?
  53. How do you implement authorization in Web API?
  54. What are the different types of authentications available in Web API?
  55. How do you secure a Web API using JWT (JSON Web Token)?
  56. What is CORS and how do you enable it in Web API?
  57. How do you implement HTTPS in Web API
  58. What is OData and how do you use it in Web API?
  59. How do you implement versioning in Web API?
  60. What is content negotiation in Web API?
  61. How do you customize content negotiation?
  62. What are media type formatters in Web API?
  63. How do you create a custom media type formatter?
  64. What is dependency injection and how is it implemented in Web API?
  65. How do you use filters in Web API?
  66. What are action filters, authorization filters, and exception filters?
  67. How do you implement logging in Web API?
  68. What is the role of middleware in ASP.NET Core Web API?
  69. How do you handle file uploads in Web API?
  70. How do you implement caching in Web API?
  71. Performance and Scalability
  72. How do you improve the performance of a Web API?
  73. What are some best practices for designing a scalable Web API?
  74. How do you use async/await to improve performance in Web API?
  75. What is rate limiting and how do you implement it in Web API?
  76. How do you monitor and diagnose performance issues in Web API?
  77. How do you implement security?
  78. What is Enable core?
  79. How do you set expiration for cache?
  80. Explain API Rate Limiting?
  81. How to paginate API?
  82. What is Content negotiation?

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *