Web API Interview Questions and Answers
ASP.NET Web API and REST interview questions — REST constraints, HTTP verbs and status codes, MVC vs API controllers, versioning strategy and filters.
Web API questions check that you can design an HTTP interface other teams can rely on. Expect REST fundamentals, then practical questions about verbs, status codes, versioning and where cross-cutting concerns belong.
REST & HTTP
2 questionsA RESTful API models the system as resources identified by URLs, manipulated with standard HTTP verbs (GET, POST, PUT, PATCH, DELETE), returning appropriate status codes and representations (usually JSON). It…
Read detailed answerGET reads a resource (safe, idempotent, cacheable). POST creates a resource or triggers processing (not idempotent). PUT replaces a resource entirely at a known URL (idempotent). PATCH applies a partial…
Read detailed answerASP.NET Core APIs
3 questionsAn MVC controller derives from Controller and typically returns a view (HTML) via view/model. A Web API controller derives from ControllerBase, is marked [ApiController], and returns data that is serialised…
Read detailed answerFilters run code at specific stages of the MVC action pipeline, inside model binding and routing. The types, in order: Authorization → Resource → Action (before/after the action) → Exception → Result…
Read detailed answerPick one scheme and be consistent: URL path (/api/v2/orders) — most visible and cache-friendly; query string (?api-version=2.0); header (api-version: 2.0) — keeps URLs clean; or media type (Accept:…
Read detailed answer