Interview Q&A

Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.

4608 total questions 4508 technical 100 career & HR 4272 from PDF library

Showing 351–375 of 4608

Career & HR topics

By tech stack

Popular tracks

Mid PDF
Using Tag Helpers vs HTML Helpers?

Short answer: 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(&qu…

ASP.NET Core Read answer
Mid PDF
ViewData, ViewBag, TempData: differences and uses Type Lifetime Dynami c?

Short answer: ta cross requests No Preserved for 1 redirect only Real-world example (ShopNest) ShopNest registers AppDbContext as Scoped and IMemoryCache as Singleton. Putting DbContext in a Singleton causes threading bu…

ASP.NET Core Read answer
Mid PDF
ViewData, ViewBag, TempData: differences and uses Type Lifetime Dynami c?

Short answer: Purpose ViewDa ta Current request No Pass data to views ViewBa Current request Yes ViewData wrapper (dynamic) TempD ata Across requests No Preserved for 1 redirect only Real-world example (ShopNest) ShopNes…

ASP.NET Core Read answer
Mid PDF
Model Binding in MVC/Razor Pages?

Short 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. Real-world example (Shop…

ASP.NET Core Read answer
Mid PDF
Model Validation using Data Annotations?

Short answer: Decorate model properties: public class User { [Required] [EmailAddress] public string Email { get; set; } } Automatically validated during model binding. Use ModelState.IsValid to check. Example code Decor…

ASP.NET Core Read answer
Mid PDF
Custom Validation (IValidatableObject, Custom Validators)?

Short answer: IValidatableObject: public IEnumerable<ValidationResult> Validate(ValidationContext context) Custom Attribute: public class MyCustomAttribute : ValidationAttribute { Example code public override bool…

ASP.NET Core Read answer
Mid PDF
Layouts, Partial Views, View Components?

Short answer: 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 :…

ASP.NET Core Read answer
Mid PDF
How to pass data from controller to view

Short answer: Via ViewBag / ViewData / Model: return View(model); // Strongly typed ViewBag.Message = "Hello"; ViewData["Count"] = 5; Example code Via ViewBag / ViewData / Model: return View(model); /…

ASP.NET Core Read answer
Mid PDF
Filters: Action filters, result filters, exception filters?

Short 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 : IA…

ASP.NET Core Read answer
Mid PDF
Razor Page Handlers (OnGet, OnPost, etc.)?

Short answer: Razor Pages use handler methods: public class IndexModel : PageModel { Example code public void OnGet() { ... } public IActionResult OnPost() { ... } } You can use asp-page-handler="Update" for cu…

ASP.NET Core Read answer
Mid PDF
Dependency Injection in Razor Pages?

Short answer: Inject services into PageModel constructor: public IndexModel(IMyService service) { ... } Also available in Razor views via @inject: @inject ILogger<MyPage> Logger Real-world example (ShopNest) ShopNe…

ASP.NET Core Read answer
Mid PDF
Razor Class Libraries (RCL)?

Short answer: Reusable libraries that contain Razor views, pages, static files, etc. Share UI components across multiple projects. dotnet new razorclasslib Real-world example (ShopNest) A ShopNest checkout request flows…

ASP.NET Core Read answer
Mid PDF
Areas in MVC?

Short 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 { ... } Say…

ASP.NET Core Read answer
Mid PDF
Bundling, Minification, Static Assets Organization?

Short answer: Handled via: ASP.NET Core Middleware WebOptimizer, Gulp, or Webpack Static files in wwwroot/ Enable in Startup.cs: app.UseStaticFiles(); Example code Handled via: ASP.NET Core Middleware WebOptimizer, Gulp,…

ASP.NET Core Read answer
Mid PDF
Supporting multiple view engines / customizing them?

Short answer: ASP.NET Core supports Razor by default. You can add support for custom view engines by implementing IViewEngine. Real-world example (ShopNest) A ShopNest checkout request flows through middleware, hits a mi…

ASP.NET Core Read answer
Mid PDF
Localization / Globalization in views?

Short answer: Use IStringLocalizer<T> or IViewLocalizer: @inject IViewLocalizer Localizer <h1>@Localizer["Welcome"]</h1> Add resource .resx files for each language. Real-world example (ShopNes…

ASP.NET Core Read answer
Mid PDF
Razor Pages vs MVC: Performance Considerations?

Short answer: 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.…

ASP.NET Core Read answer
Junior PDF
What is REST?

Short answer: REST (Representational State Transfer) is an architectural style for building scalable web services. RESTful APIs follow standard HTTP methods (GET, POST, PUT, DELETE) and stateless communication. Real-worl…

ASP.NET Core Read answer
Junior PDF
What is the [ApiController] attribute and what benefits it brings?

Short answer: SP.NET Core. ✅ Benefits: Automatic model validation Infer [FromBody] / [FromQuery], etc. 400 BadRequest returned automatically if model state is invalid. Improved parameter binding behavior Real-world examp…

ASP.NET Core Read answer
Junior PDF
What is the [ApiController] attribute and what benefits it brings?

Short answer: The [ApiController] attribute is used to denote Web API controllers in ASP.NET Core. ✅ Benefits: Automatic model validation Infer [FromBody] / [FromQuery], etc. 400 BadRequest returned automatically if mode…

ASP.NET Core Read answer
Mid PDF
Routing conventions in Web API (attribute routing, route?

Short answer: templates) Attribute Routing (Preferred): [Route("api/products")] [ApiController] public class ProductsController : ControllerBase { [HttpGet("{id}")] public IActionResult Get(int id) {…

ASP.NET Core Read answer
Mid PDF
How to version Web APIs (URL versioning, header versioning, 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:

Short answer: pplication/vnd.company.v1+json services.AddApiVersioning(options => { options.ReportApiVersions = true; options.AssumeDefaultVersionWhenUnspecified = true; options.DefaultApiVersion = new ApiVersion(1, 0…

ASP.NET Core Read answer
Mid PDF
How to version Web APIs (URL versioning, header versioning,

Short answer: 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…

ASP.NET Core Read answer
Mid PDF
Content negotiation (JSON, XML)?

Short answer: ASP.NET Core selects the response format based on the Accept header. JSON is the default. To add XML: services.AddControllers() .AddXmlSerializerFormatters(); Accept: application/xml Real-world example (Sho…

ASP.NET Core Read answer
Mid PDF
Binding parameters: from body, from query, from route, from form Source Attribute Body [FromBody ] Query string [FromQuer y] Route [FromRout e] Form data [FromForm ] Header [FromHear ]

Short answer: SP.NET Core infers the source when possible. Real-world example (ShopNest) ShopNest registers AppDbContext as Scoped and IMemoryCache as Singleton. Putting DbContext in a Singleton causes threading bugs. Sa…

ASP.NET Core Read answer

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: 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 in modern ASP.NET Core apps.

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: ta cross requests No Preserved for 1 redirect only

Real-world example (ShopNest)

ShopNest registers AppDbContext as Scoped and IMemoryCache as Singleton. Putting DbContext in a Singleton causes threading bugs.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: Purpose ViewDa ta Current request No Pass data to views ViewBa Current request Yes ViewData wrapper (dynamic) TempD ata Across requests No Preserved for 1 redirect only

Real-world example (ShopNest)

ShopNest registers AppDbContext as Scoped and IMemoryCache as Singleton. Putting DbContext in a Singleton causes threading bugs.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short 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.

Real-world example (ShopNest)

ShopNest registers AppDbContext as Scoped and IMemoryCache as Singleton. Putting DbContext in a Singleton causes threading bugs.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: Decorate model properties: public class User { [Required] [EmailAddress] public string Email { get; set; } } Automatically validated during model binding. Use ModelState.IsValid to check.

Example code

Decorate model properties: public class User { [Required] [EmailAddress] public string Email { get; set; }
} Automatically validated during model binding. Use ModelState.IsValid to check.

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: IValidatableObject: public IEnumerable<ValidationResult> Validate(ValidationContext context) Custom Attribute: public class MyCustomAttribute : ValidationAttribute {

Example code

public override bool IsValid(object value) { ... }
}

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: 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 {

Example code

public IViewComponentResult Invoke() => View("Cart", model); }

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: Via ViewBag / ViewData / Model: return View(model); // Strongly typed ViewBag.Message = "Hello"; ViewData["Count"] = 5;

Example code

Via ViewBag / ViewData / Model: return View(model); // Strongly typed
ViewBag.Message = "Hello";
ViewData["Count"] = 5;

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short 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 { ... }

Real-world example (ShopNest)

A ShopNest ValidateModelAttribute runs before actions and returns 400 if ModelState is invalid—same rule for every controller.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: Razor Pages use handler methods: public class IndexModel : PageModel {

Example code

public void OnGet() { ... }
public IActionResult OnPost() { ... }
} You can use asp-page-handler="Update" for custom methods.

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: Inject services into PageModel constructor: public IndexModel(IMyService service) { ... } Also available in Razor views via @inject: @inject ILogger<MyPage> Logger

Real-world example (ShopNest)

ShopNest registers AppDbContext as Scoped and IMemoryCache as Singleton. Putting DbContext in a Singleton causes threading bugs.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: Reusable libraries that contain Razor views, pages, static files, etc. Share UI components across multiple projects. dotnet new razorclasslib

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short 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 { ... }

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: Handled via: ASP.NET Core Middleware WebOptimizer, Gulp, or Webpack Static files in wwwroot/ Enable in Startup.cs: app.UseStaticFiles();

Example code

Handled via: ASP.NET Core Middleware WebOptimizer, Gulp, or Webpack Static files in wwwroot/ Enable in Startup.cs: app.UseStaticFiles();

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: ASP.NET Core supports Razor by default. You can add support for custom view engines by implementing IViewEngine.

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: Use IStringLocalizer<T> or IViewLocalizer: @inject IViewLocalizer Localizer <h1>@Localizer["Welcome"]</h1> Add resource .resx files for each language.

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: 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 (RESTful Services) Web API (RESTful Services)

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: REST (Representational State Transfer) is an architectural style for building scalable web services. RESTful APIs follow standard HTTP methods (GET, POST, PUT, DELETE) and stateless communication.

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: SP.NET Core. ✅ Benefits: Automatic model validation Infer [FromBody] / [FromQuery], etc. 400 BadRequest returned automatically if model state is invalid. Improved parameter binding behavior

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: The [ApiController] attribute is used to denote Web API controllers in ASP.NET Core. ✅ Benefits: Automatic model validation Infer [FromBody] / [FromQuery], etc. 400 BadRequest returned automatically if model state is invalid. Improved parameter binding behavior

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: templates) Attribute Routing (Preferred): [Route("api/products")] [ApiController] public class ProductsController : ControllerBase { [HttpGet("{id}")] public IActionResult Get(int id) { ... } } Route Templates: Use placeholders like {id}, constraints like {id:int}. You can also define route prefixes at controller level and use relative routes in actions.

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: pplication/vnd.company.v1+json services.AddApiVersioning(options => { options.ReportApiVersions = true; options.AssumeDefaultVersionWhenUnspecified = true; options.DefaultApiVersion = new ApiVersion(1, 0); }); pplication/vnd.company.v1+json services.AddApiVersioning(options => { options.ReportApiVersions = true;… options.AssumeDefaultVersionWhenUnspecified…… = true; options.DefaultApiVersion = new ApiVersion(1, 0);…

Explain a bit more

}); pplication/vnd.company.v1+json services.AddApiVersioning(options => { options.ReportApiVersions = true; options.AssumeDefaultVersionWhenUnspecified = true; options.DefaultApiVersion = new ApiVersion(1, 0); }); pplication/vnd.company.v1+json services.AddApiVersioning(options => { options.ReportApiVersions = true;… options.AssumeDefaultVersionWhenUnspecified = true; options.DefaultApiVersion = new ApiVersion(1, 0); });

Real-world example (ShopNest)

ShopNest registers AppDbContext as Scoped and IMemoryCache as Singleton. Putting DbContext in a Singleton causes threading bugs.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: 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.v1+json services.AddApiVersioning(options => { options.ReportApiVersions = true;

Example code

options.AssumeDefaultVersionWhenUnspecified = true;
options.DefaultApiVersion = new ApiVersion(1, 0); });

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: ASP.NET Core selects the response format based on the Accept header. JSON is the default. To add XML: services.AddControllers() .AddXmlSerializerFormatters(); Accept: application/xml

Real-world example (ShopNest)

A ShopNest checkout request flows through middleware, hits a minimal API or controller, uses scoped services, and returns ProblemDetails on errors.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ASP.NET Core ASP.NET Core Tutorial · ASP.NET Core

Short answer: SP.NET Core infers the source when possible.

Real-world example (ShopNest)

ShopNest registers AppDbContext as Scoped and IMemoryCache as Singleton. Putting DbContext in a Singleton causes threading bugs.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details