All 42 questions

  1. What is middleware in ASP.NET Core?

    Asked in 8 of 95 interviews · last asked Oct 1 · Concept · Junior

    Show answer

    Middleware is a component in the ASP.NET Core HTTP request pipeline. It can process a request, call the next component, and process the response as control returns. It can also stop the pipeline and return a response itself. Common uses include logging, authentication, and error handling.

    • Middleware runs in registration order for requests and reverse order as control returns.
    • Calling the next component continues the pipeline; not calling it stops further processing.
    • Order matters: authentication should run before authorization.
    • Error-handling middleware can catch exceptions from components registered after it.

    What the interviewer checks: The interviewer checks whether you understand pipeline flow, middleware order, and common uses.

    Other ways it was asked
    • “What is .NET Core middleware?”
    • “What is middleware in ASP.NET?”
    • “Can you explain what middleware is in ASP.NET Core and how it contributes to processing an incoming HTTP request?”
  2. What happens as an HTTP request passes through the ASP.NET Core request pipeline?

    Asked in 4 of 95 interviews · last asked Sep 18 · Concept · Mid-level

    Show answer

    An HTTP request passes through an ordered chain of middleware in ASP.NET Core. Each middleware can handle the request, call the next component, or stop the chain early. Routing selects an endpoint, such as an MVC action, which runs if the request reaches endpoint execution. Afterward, control returns through earlier middleware in reverse order to finish the response.

    • Middleware runs in registration order for requests; code after calling the next component runs in reverse order.
    • Middleware can stop the chain early, for example by serving a static file or rejecting access.
    • Routing selects an endpoint; authentication identifies the user, and authorization checks access before the endpoint runs.
    • For MVC endpoints, model binding, validation, filters, action execution, and result execution happen within the pipeline.

    What the interviewer checks: The interviewer checks whether you understand middleware order, early responses, and how routing and MVC fit into request handling.

    Other ways it was asked
    • “What is the ASP.NET request pipeline, why is it used, and how does it work?”
    • “What is the ASP.NET Core request pipeline, and how does it work?”
    • “How does the middleware request pipeline work in ASP.NET Core?”
  3. What are action filters in ASP.NET Core, and when would you use them?

    Asked in 3 of 95 interviews · last asked Oct 9 · Concept · Mid-level

    Show answer

    Action filters in ASP.NET Core MVC run code before and after a controller action executes. Use them for shared logic, such as logging action inputs or checking arguments, on selected actions, controllers, or globally. Use an exception filter instead to handle unhandled exceptions from controller creation, model binding, action filters, or actions.

    • Action filters run after model binding, so they can inspect bound action arguments.
    • They can skip the action by setting a result before it runs.
    • Use authorization policies for access control, rather than action filters.
    • Exception filters do not catch exceptions from middleware or MVC result execution.

    What the interviewer checks: The interviewer checks whether you can choose the right filter and explain its scope and execution timing.

    Other ways it was asked
    • “What .NET feature, such as an action filter, can apply request filtering at the method or controller level?”
    • “What is a filter in ASP.NET Core MVC, and can you give a concrete example of when you would use an action filter versus an exception filter?”
  4. How do you write custom middleware in ASP.NET Core?

    Asked in 2 of 95 interviews · last asked Oct 10 · Tooling · Mid-level

    Other ways it was asked
    • “What are the use cases for writing custom middleware in ASP.NET Core?”
    • “Why would you write custom middleware in ASP.NET Core when standard middleware already exists?”
    • “How do you implement custom middleware in ASP.NET Core?”
  5. What is the difference between middleware and filters, and when should each be used?

    Asked in 2 of 95 interviews · last asked Oct 16 · Concept · Mid-level

    Other ways it was asked
    • “What is the difference between middleware and a filter?”
  6. In ASP.NET Core MVC, what is the difference between conventional routing and attribute routing, and when would you choose one approach over the other?

    Asked in 2 of 95 interviews · last asked Aug 12 · Concept · Mid-level

    Other ways it was asked
    • “How does ASP.NET Core determine which controller action should handle an incoming request, and what is the difference between attribute routing and conventional routing?”
  7. How does attribute routing work in ASP.NET Core Web API? Specifically, how do you map an action method to a particular URL and HTTP verb?

    Asked in 2 of 95 interviews · last asked Aug 15 · Tooling · Junior

    Other ways it was asked
    • “How does attribute routing work in an ASP.NET Core Web API, and how do you map an action to a specific URL and HTTP method?”
  8. How do you return data and appropriate HTTP status codes from ASP.NET Core API actions?

    Asked in 2 of 95 interviews · last asked Aug 15 · Tooling · Junior

    Other ways it was asked
    • “When building a RESTful service in ASP.NET Core, how do you ensure controller actions return appropriate HTTP status codes, and what helpers does the framework provide to make this easier?”
    • “How do you return an HTTP status code along with data from a Web API action? What helper methods does the controller base class provide for this?”
  9. How do you handle exceptions globally in ASP.NET Core, and how do middleware and exception filters differ?

    Asked in 2 of 95 interviews · last asked Sep 18 · Tooling · Mid-level

    Other ways it was asked
    • “How would you implement custom error handling in a REST API using ASP.NET Core, what mechanisms does it provide, and how do exception filters differ from middleware-based error handling?”
    • “How do you handle exceptions globally in an ASP.NET Core application?”
  10. How does ASP.NET Core bind request data to action parameters, and how do data annotations support validation?

    Asked in 2 of 95 interviews · last asked Aug 15 · Concept · Mid-level

    Other ways it was asked
    • “How does data from an HTTP request, such as form data or query strings, get mapped to action method parameters, and what role do data annotations play in this process?”
    • “What is model binding in ASP.NET Core Web API, and how does the framework determine whether to read data from the URL, the query string, or the request body?”
  11. How do MVC controllers and API controllers differ in ASP.NET Core?

    Asked in 2 of 95 interviews · last asked Sep 19 · Concept · Mid-level

    Other ways it was asked
    • “How does ASP.NET Core Web API differ from ASP.NET Core MVC? What capabilities does Web API provide that MVC doesn't, and are there things MVC can do that Web API typically doesn't handle?”
    • “Can you explain the difference between the MVC controller and the API controller?”
  12. Why would you use Blazor Server instead of Blazor WebAssembly?

    Asked in 2 of 95 interviews · last asked Sep 1 · Concept · Mid-level

    Other ways it was asked
    • “How do Blazor Server and Blazor WebAssembly differ, and what factors guide choosing between them?”
  13. In Blazor, what is a cascading value?

    Asked once · last asked Feb 27 · Concept · Junior

  14. What is model validation in ASP.NET Core, and why is it important?

    Asked once · last asked Feb 27 · Concept · Junior

  15. What does the [ApiController] attribute do in ASP.NET Core?

    Asked once · last asked Jul 27 · Concept · Junior

    Other ways it was asked
    • “What does the API controller attribute do?”
  16. What is appsettings.json, and how do you access its values?

    Asked once · last asked Jul 27 · Concept · Junior

  17. Can you describe what ASP.NET Core is and how it differs from the original ASP.NET framework?

    Asked once · last asked Aug 5 · Concept · Junior

  18. How do different action result types, such as a view result, a JSON result, and a redirect result, differ, and in what situations would you choose each one?

    Asked once · last asked Aug 12 · Concept · Mid-level

  19. What is the difference between ViewBag, ViewData, and a strongly typed view model for passing data from a controller to a view, and when would you prefer one over the others?

    Asked once · last asked Aug 12 · Concept · Mid-level

  20. Can you give one specific scenario where you would use an action filter and another where you would use an exception filter?

    Asked once · last asked Aug 12 · Scenario · Mid-level

  21. When would you choose ASP.NET Core MVC or Razor Pages for a new project, and what characteristics of the application would drive that decision?

    Asked once · last asked Aug 12 · Concept · Mid-level

  22. Besides routing, what other behaviors does [ApiController] enable automatically, particularly around model validation and error responses?

    Asked once · last asked Aug 15 · Concept · Mid-level

  23. Suppose you have a controller with a route template and an action that handles updating a user by ID. What would the attributes and route look like for that scenario?

    Asked once · last asked Aug 15 · Write code · Junior

  24. What happens in ASP.NET Core Web API when an unhandled exception is thrown inside an action method? What does the client receive by default?

    Asked once · last asked Aug 15 · Concept · Mid-level

  25. What does Swagger or OpenAPI provide in an ASP.NET Core Web API project, and what are some key best practices that distinguish a production API from a basic CRUD API?

    Asked once · last asked Aug 15 · Concept · Mid-level

  26. How would you implement a .NET endpoint for creating a new order?

    Asked once · last asked Aug 31 · Write code · Mid-level

  27. What is the difference between the controller approach and the endpoint approach in ASP.NET Core?

    Asked once · last asked Sep 4 · Concept · Mid-level

  28. How would you handle connection drops and manage application state in Blazor Server?

    Asked once · last asked Sep 9 · Scenario · Senior

  29. How do forms in React differ from ASP.NET Web Forms and other .NET form models?

    Asked once · last asked Sep 19 · Concept · Mid-level

  30. How can you configure ASP.NET MVC routing so an action's method name, such as Calculate, does not appear in the URL?

    Asked once · last asked Sep 19 · Tooling · Mid-level

  31. In a .NET application, where should validation and authorization logic go: in the controller or in middleware?

    Asked once · last asked Oct 9 · Concept · Mid-level

  32. What is a filter in ASP.NET?

    Asked once · last asked Apr 2 · Concept · Junior

  33. What is a model in ASP.NET Core?

    Asked once · last asked Jul 27 · Concept · Junior

  34. What is ScriptManager in ASP.NET Web Forms?

    Asked once · last asked Aug 12 · Concept · Junior

  35. What is an UpdatePanel in ASP.NET Web Forms?

    Asked once · last asked Aug 12 · Concept · Junior

  36. In ASP.NET Core MVC, what does MVC stand for, and what is the responsibility of each component in the pattern?

    Asked once · last asked Aug 12 · Concept · Junior

  37. What does the [ApiController] attribute do when you add it to a Web API controller, and why do developers commonly use it?

    Asked once · last asked Aug 15 · Concept · Junior

  38. Can an MVC view be shared across multiple controllers?

    Asked once · last asked Sep 19 · Concept · Junior

  39. How can you explain routing in ASP.NET MVC?

    Asked once · last asked Sep 19 · Concept · Junior

  40. What web server do you use for ASP.NET applications?

    Asked once · last asked Sep 21 · Concept · Junior

  41. What does middleware do as a request passes through it?

    Asked once · last asked Oct 9 · Concept · Junior

  42. If an unhandled NullReferenceException occurs in an API, what HTTP status code is typically returned?

    Asked once · last asked Oct 16 · Concept · Mid-level

    Other ways it was asked
    • “If an API encounters a NullReferenceException, what status code will it return?”

More C# and .NET interview questions

How this list is made

Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.

Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.

The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every C# and .NET interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.

95 interviews, 54 candidates, Jan 2026 to Oct 2026. Updated every month with new interviews.