Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Answer: view or JSON). View: .cshtml file that renders HTML. View Component: Reusable mini-views with logic (like partials but with code-behind). What interviewers expect A clear definition tied to ASP.NET Core in ASP.NE…
Controller: Handles HTTP requests. Action Method: A method in the controller that returns a result (like a view or JSON). View: .cshtml file that renders HTML. View Component: Reusable mini-views with logic (like partial…
Tag Helpers: Use HTML-like syntax. Easier to read/maintain. <form asp-controller="Home" asp-action="Login"></form> HTML Helpers: C# methods used in Razor. @Html.BeginForm("Login", "Home") ✅ Prefer Tag Helpers…
ta cross requests No Preserved for 1 redirect only What interviewers expect A clear definition tied to ASP.NET Core in ASP.NET Core projects Trade-offs (performance, maintainability, security, cost) When you would and wo…
Answer: Purpose ViewDa Current request No Pass data to views ViewBa Current request Yes ViewData wrapper (dynamic) TempD ata Across requests No Preserved for 1 redirect only What interviewers expect A clear definition ti…
Answer: Automatically maps form values, query strings, route data to C# model properties. public IActionResult Submit(User user) { ... } Binds complex types and simple types out-of-the-box. What interviewers expect A cle…
Answer: Decorate model properties: public class User { [Required] [EmailAddress] public string Email { get; set; } } Automatically validated during model binding. Use ModelState.IsValid to check. What interviewers expect…
Answer: IValidatableObject: public IEnumerable&lt;ValidationResult&gt; Validate(ValidationContext context) Custom Attribute: public class MyCustomAttribute : ValidationAttribute { public override bool IsValid(obj…
Layouts: Shared structure (e.g. header, footer) using _Layout.cshtml. Partial Views: Reusable UI snippets (_LoginPartial.cshtml). View Components: Partial views with logic. public class CartViewComponent : ViewComponent…
Answer: Via ViewBag / ViewData / Model: return View(model); // Strongly typed ViewBag.Message = "Hello"; ViewData["Count"] = 5; What interviewers expect A clear definition tied to ASP.NET Core in ASP.NET Core projects Tr…
Answer: ActionFilter: Runs before/after action method. ResultFilter: Runs before/after view result. ExceptionFilter: Catches unhandled exceptions. Apply globally or via attributes. public class LogActionFilter : IActionF…
Answer: Razor Pages use handler methods: public class IndexModel : PageModel { public void OnGet() { ... } public IActionResult OnPost() { ... } } You can use asp-page-handler="Update" for custom methods. What interviewe…
Answer: Inject services into PageModel constructor: public IndexModel(IMyService service) { ... } Also available in Razor views via @inject: @inject ILogger&lt;MyPage&gt; Logger What interviewers expect A clear d…
Answer: Reusable libraries that contain Razor views, pages, static files, etc. Share UI components across multiple projects. dotnet new razorclasslib What interviewers expect A clear definition tied to ASP.NET Core in AS…
Answer: Used to organize large applications into sections (e.g., Admin, Customer). Each Area has its own Controllers/Views/Models. [Area("Admin")] public class DashboardController : Controller { ... } What interviewers e…
Answer: Handled via: ASP.NET Core Middleware WebOptimizer, Gulp, or Webpack Static files in wwwroot/ Enable in Startup.cs: app.UseStaticFiles(); What interviewers expect A clear definition tied to ASP.NET Core in ASP.NET…
Answer: ASP.NET Core supports Razor by default. You can add support for custom view engines by implementing IViewEngine. What interviewers expect A clear definition tied to ASP.NET Core in ASP.NET Core projects Trade-off…
Answer: Use IStringLocalizer&lt;T&gt; or IViewLocalizer: @inject IViewLocalizer Localizer &lt;h1&gt;@Localizer["Welcome"]&lt;/h1&gt; Add resource .resx files for each language. What interviewers e…
Performance: Very similar, both use Razor rendering. Simplicity: Razor Pages have less boilerplate for page-based UIs. Maintainability: Razor Pages better for small apps, MVC better for large, modular apps. Web API (REST…
templates) Attribute Routing (Preferred): [Route("api/products")] [ApiController] public class ProductsController : ControllerBase { [HttpGet("{id}")] public IActionResult Get(int id) { ... } } Route Templates: Use place…
Answer: pplication/vnd.company.v1+json services.AddApiVersioning(options =&gt; { options.ReportApiVersions = true; options.AssumeDefaultVersionWhenUnspecified = true; options.DefaultApiVersion = new ApiVersion(1, 0);…
media type versioning) Use Microsoft.AspNetCore.Mvc.Versioning package. ✅ Supported methods: URL versioning: /api/v1/products Header versioning: X-API-Version: 1.0 Media Type versioning: Accept: application/vnd.company.v…
Answer: SP.NET Core selects the response format based on the Accept header. JSON is the default. To add XML: services.AddControllers() .AddXmlSerializerFormatters(); ccept: application/xml What interviewers expect A clea…
SP.NET Core infers the source when possible. What interviewers expect A clear definition tied to ASP.NET Core in ASP.NET Core projects Trade-offs (performance, maintainability, security, cost) When you would and would no…
Answer: form Source Attribute Body [FromBody Query string [FromQuer Route [FromRout Form data [FromForm Header [FromHear ASP.NET Core infers the source when possible. What interviewers expect A clear definition tied to A…
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: view or JSON). View: .cshtml file that renders HTML. View Component: Reusable mini-views with logic (like partials but with code-behind).
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
a view or JSON).
with code-behind).
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Tag Helpers: Use HTML-like syntax. Easier to read/maintain.
<form asp-controller="Home" asp-action="Login"></form>
@Html.BeginForm("Login", "Home")
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
ta cross requests No Preserved for 1 redirect only
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: Purpose ViewDa Current request No Pass data to views ViewBa Current request Yes ViewData wrapper (dynamic) TempD ata Across requests No Preserved for 1 redirect only
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: Automatically maps form values, query strings, route data to C# model properties. public IActionResult Submit(User user) { ... } Binds complex types and simple types out-of-the-box.
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: Decorate model properties: public class User { [Required] [EmailAddress] public string Email { get; set; } } Automatically validated during model binding. Use ModelState.IsValid to check.
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: IValidatableObject: public IEnumerable<ValidationResult> Validate(ValidationContext context) Custom Attribute: public class MyCustomAttribute : ValidationAttribute { public override bool IsValid(object value) { ... } }
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
_Layout.cshtml.
public class CartViewComponent : ViewComponent {
public IViewComponentResult Invoke() => View("Cart",
model);
}ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: Via ViewBag / ViewData / Model: return View(model); // Strongly typed ViewBag.Message = "Hello"; ViewData["Count"] = 5;
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: ActionFilter: Runs before/after action method. ResultFilter: Runs before/after view result. ExceptionFilter: Catches unhandled exceptions. Apply globally or via attributes. public class LogActionFilter : IActionFilter { ... }
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: Razor Pages use handler methods: public class IndexModel : PageModel { public void OnGet() { ... } public IActionResult OnPost() { ... } } You can use asp-page-handler="Update" for custom methods.
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: Inject services into PageModel constructor: public IndexModel(IMyService service) { ... } Also available in Razor views via @inject: @inject ILogger<MyPage> Logger
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: Reusable libraries that contain Razor views, pages, static files, etc. Share UI components across multiple projects. dotnet new razorclasslib
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: Used to organize large applications into sections (e.g., Admin, Customer). Each Area has its own Controllers/Views/Models. [Area("Admin")] public class DashboardController : Controller { ... }
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: Handled via: ASP.NET Core Middleware WebOptimizer, Gulp, or Webpack Static files in wwwroot/ Enable in Startup.cs: app.UseStaticFiles();
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: ASP.NET Core supports Razor by default. You can add support for custom view engines by implementing IViewEngine.
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: Use IStringLocalizer<T> or IViewLocalizer: @inject IViewLocalizer Localizer <h1>@Localizer["Welcome"]</h1> Add resource .resx files for each language.
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
large, modular apps.
Web API (RESTful Services)
Web API (RESTful Services)
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
templates)
[Route("api/products")]
[ApiController]
public class ProductsController : ControllerBase {
[HttpGet("{id}")]
public IActionResult Get(int id) { ... }
}
Use placeholders like {id}, constraints like {id:int}.
You can also define route prefixes at controller level and use relative routes
in actions.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: pplication/vnd.company.v1+json services.AddApiVersioning(options => { options.ReportApiVersions = true; options.AssumeDefaultVersionWhenUnspecified = true; options.DefaultApiVersion = new ApiVersion(1, 0); });
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
media type versioning)
Use Microsoft.AspNetCore.Mvc.Versioning package.
✅ Supported methods:
application/vnd.company.v1+json
services.AddApiVersioning(options => {
options.ReportApiVersions = true;
options.AssumeDefaultVersionWhenUnspecified = true;
options.DefaultApiVersion = new ApiVersion(1, 0);
});
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: SP.NET Core selects the response format based on the Accept header. JSON is the default. To add XML: services.AddControllers() .AddXmlSerializerFormatters(); ccept: application/xml
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
SP.NET Core infers the source when possible.
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core
Answer: form Source Attribute Body [FromBody Query string [FromQuer Route [FromRout Form data [FromForm Header [FromHear ASP.NET Core infers the source when possible.
In a production ASP.NET Core application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.