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 376–400 of 4608

Career & HR topics

By tech stack

Popular tracks

Mid PDF
Handling large uploads/downloads (streaming, chunking)?

Short answer: For large uploads, use IFormFile, Stream, or read from Request.Body for streaming. For downloads, return FileStreamResult. Enable buffering or streaming to avoid memory overload. Example code For large uplo…

ASP.NET Core Read answer
Mid PDF
Error handling / global exception handling in APIs Use UseExceptionHandler middleware or custom ExceptionMiddleware. You can also create a global error handler:

Short answer: pp.UseExceptionHandler(config => { config.Run(async context => { // Log and return problem details }); }); Or use ProblemDetails for structured error responses. Explain a bit more pp.UseExceptionHandl…

ASP.NET Core Read answer
Mid PDF
Error handling / global exception handling in APIs?

Short answer: Use UseExceptionHandler middleware or custom ExceptionMiddleware. You can also create a global error handler: app.UseExceptionHandler(config => { config.Run(async context => { // Log and return proble…

ASP.NET Core Read answer
Mid PDF
Returning appropriate HTTP status codes?

Short answer: Use proper status codes: 200 OK (success) 201 Created (on POST) 204 No Content (on DELETE) 400 Bad Request 401 Unauthorized / 403 Forbidden 404 Not Found 500 Internal Server Error return Ok(result); Example…

ASP.NET Core Read answer
Mid PDF
Using ActionResult<T> vs IActionResult?

Short answer: ActionResult&lt;T&gt;: Combines a return value and response code. public ActionResult&lt;Product&gt; Get(int id) { ... } IActionResult: More flexible, returns different result types explicitly. Prefer Actio…

ASP.NET Core Read answer
Mid PDF
Asynchronous APIs (async/await)?

Short answer: ASP.NET Core supports full async/await pattern for IO-bound tasks. [HttpGet] public async Task&lt;ActionResult&lt;Product&gt;&gt; GetAsync(int id) { Example code var product = await _repo.GetAsync(id); retu…

ASP.NET Core Read answer
Mid PDF
Asynchronous APIs (async/await) ASP.NET Core supports full async/await pattern for IO-bound tasks. [HttpGet] public async Task<ActionResult<Product>> GetAsync(int id) { var product = await _repo.GetAsync(id); return product == null ?

Short answer: NotFound() : Ok(product); ✅ Improves scalability and performance. NotFound() : Ok(product); ✅ Improves scalability and performance. NotFound() : Ok(product); ✅ Improves scalability and performance. NotFound…

ASP.NET Core Read answer
Mid PDF
CORS for Web APIs?

Short answer: Enable CORS (Cross-Origin Resource Sharing) to allow client apps from different domains: services.AddCors(options =&gt; { options.AddPolicy(&quot;AllowFrontend&quot;, builder =&gt; builder.WithOrigins(&quot…

ASP.NET Core Read answer
Mid PDF
Rate limiting / throttling?

Short answer: ASP.NET Core doesn't include rate limiting out of the box (pre-.NET 8). Use libraries like: AspNetCoreRateLimit YARP, Azure API Management .NET 8 introduced built-in RateLimiterMiddleware. Real-world exampl…

ASP.NET Core Read answer
Mid PDF
API documentation: Swagger / OpenAPI Use Swashbuckle.AspNetCore or NSwag for generating Swagger docs. services.AddSwaggerGen();

Short answer: pp.UseSwagger(); pp.UseSwaggerUI(); Supports: Auto-generated OpenAPI docs Try it out interface Versioning support pp.UseSwagger(); pp.UseSwaggerUI(); Supports: Auto-generated OpenAPI docs Try it out interfa…

ASP.NET Core Read answer
Mid PDF
API documentation: Swagger / OpenAPI?

Short answer: Use Swashbuckle.AspNetCore or NSwag for generating Swagger docs. services.AddSwaggerGen(); app.UseSwagger(); app.UseSwaggerUI(); Supports: Auto-generated OpenAPI docs Try it out interface Versioning support…

ASP.NET Core Read answer
Mid PDF
Testing Web API endpoints (unit / integration)?

Short answer: Unit testing: Mock services/repositories using Moq or FakeItEasy. Integration testing: Use WebApplicationFactory&lt;T&gt; + TestServer + HttpClient. var client = _factory.CreateClient(); Example code var re…

ASP.NET Core Read answer
Mid PDF
Authorization/authentication in APIs (JWT, OAuth)?

Short answer: Use JWT Bearer Tokens for stateless auth: services.AddAuthentication(JwtBearerDefaults.AuthenticationSch eme) .AddJwtBearer(options =&gt; { ... }); Secure endpoints with: [Authorize(Roles = &quot;Admin&quot…

ASP.NET Core Read answer
Mid PDF
Securing APIs: Anti‐Forgery, CORS, HTTPS, etc.?

Short answer: HTTPS: Enforced via UseHttpsRedirection() CORS: Limit origins using policies Anti-forgery: Usually not needed for APIs unless using cookies (use ValidateAntiForgeryToken) Use authentication + authorization…

ASP.NET Core Read answer
Mid PDF
DTOs and mapping (e.g. AutoMapper)?

Short answer: DTOs decouple internal models from API contracts. Use AutoMapper for mapping: CreateMap&lt;Product, ProductDto&gt;(); var dto = _mapper.Map&lt;ProductDto&gt;(product); Example code DTOs decouple internal mo…

ASP.NET Core Read answer
Mid PDF
Versioning pitfalls and backward compatibility?

Short answer: Avoid breaking changes to existing endpoints. Use new versions for changes in contracts. Maintain old versions as long as needed. Ensure documentation and clients are updated accordingly. Real-world example…

ASP.NET Core Read answer
Mid PDF
Handling concurrency / optimistic concurrency?

Short answer: Return 409 Conflict if concurrency exception is caught. Model Binding &amp; Validation Example code Use RowVersion / ETag to detect concurrent edits. Example with EF Core: modelBuilder.Entity&lt;Product&gt;…

ASP.NET Core Read answer
Mid PDF
How model binding works: what sources it considers Model binding in ASP.NET Core maps incoming HTTP data to C# parameters or model properties. 🔍 Sources considered: ● Route data ● Query string ● Form data ● Headers ● JSON body (application/json) ● Uploaded files ● Services (via [FromServices])

Short answer: SP.NET Core automatically binds data based on parameter types and attributes ([FromBody], [FromQuery], etc.). Real-world example (ShopNest) ShopNest registers AppDbContext as Scoped and IMemoryCache as Sing…

ASP.NET Core Read answer
Mid PDF
How model binding works: what sources it considers

Short answer: Model binding in ASP.NET Core maps incoming HTTP data to C# parameters or model properties. 🔍 Sources considered: Route data Query string Form data Headers JSON body (application/json) Uploaded files Servi…

ASP.NET Core Read answer
Mid PDF
Binding complex types vs simple types?

Short answer: Simple types (int, string, bool, DateTime, etc.): Bound from route, query string, or form fields. Complex types (custom classes): Bound from multiple sources like query/form fields or JSON body. public IAct…

ASP.NET Core Read answer
Mid PDF
Custom model binders?

Short answer: Use a custom model binder when default binding doesn’t work (e.g., custom formats, headers). public class CustomBinder : IModelBinder { Example code public Task BindModelAsync(ModelBindingContext context) {…

ASP.NET Core Read answer
Mid PDF
Handling multiple binder source attributes ([FromBody],?

Short answer: [FromQuery], etc.) You cannot bind multiple [FromBody] parameters in a single action. Common sources: [FromBody] — for JSON/XML payloads [FromQuery] — query string [FromRoute] — route values [FromForm] — fo…

ASP.NET Core Read answer
Mid PDF
Model validation: data annotations?

Short answer: Decorate models with attributes: public class User { [Required] [StringLength(50)] [EmailAddress] public string Email { get; set; } } Used in both MVC and API for validation. Example code Decorate models wi…

ASP.NET Core Read answer
Mid PDF
Server-side validation vs client-side validation (unobtrusive)?

Short answer: Server-side: Always performed on the server; use ModelState.IsValid. Client-side: HTML5 + jQuery Unobtrusive Validation (for MVC/Razor Pages). Client-side validation improves UX, but server-side is essentia…

ASP.NET Core Read answer
Mid PDF
Custom validation attributes?

Short answer: Create custom rules by inheriting ValidationAttribute: public class MustBeEvenAttribute : ValidationAttribute { public override bool IsValid(object value) { return (int)value % 2 == 0; } } Use like: [MustBe…

ASP.NET Core Read answer

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

Short answer: For large uploads, use IFormFile, Stream, or read from Request.Body for streaming. For downloads, return FileStreamResult. Enable buffering or streaming to avoid memory overload.

Example code

For large uploads, use IFormFile, Stream, or read from Request.Body for streaming. For downloads, return FileStreamResult. Enable buffering or streaming to avoid memory overload.

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: pp.UseExceptionHandler(config => { config.Run(async context => { // Log and return problem details }); }); Or use ProblemDetails for structured error responses.

Explain a bit more

pp.UseExceptionHandler(config => { config.Run(async context => { // Log and return problem details }); }); Or use ProblemDetails for structured error responses. pp.UseExceptionHandler(config => { config.Run(async context => { // Log and return problem details }); }); Or use ProblemDetails for structured error responses. pp.UseExceptionHandler(config => { config.Run(async context => { // Log and return problem details }); }); Or use ProblemDetails for structured error responses.

Real-world example (ShopNest)

ShopNest pipeline order matters: exception handling → HTTPS → auth → authorization → endpoints. Auth must run before protected APIs.

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 UseExceptionHandler middleware or custom ExceptionMiddleware. You can also create a global error handler: app.UseExceptionHandler(config => { config.Run(async context => { // Log and return problem details }); }); Or use ProblemDetails for structured error responses.

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: Use proper status codes: 200 OK (success) 201 Created (on POST) 204 No Content (on DELETE) 400 Bad Request 401 Unauthorized / 403 Forbidden 404 Not Found 500 Internal Server Error return Ok(result);

Example code

return NotFound();
return BadRequest(ModelState);

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: ActionResult<T>: Combines a return value and response code. public ActionResult<Product> Get(int id) { ... } IActionResult: More flexible, returns different result types explicitly. Prefer ActionResult<T> for simpler, strongly-typed APIs.

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 full async/await pattern for IO-bound tasks. [HttpGet] public async Task<ActionResult<Product>> GetAsync(int id) {

Example code

var product = await _repo.GetAsync(id);
return product == null ? NotFound() : Ok(product);
} ✅ Improves scalability and performance.

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: NotFound() : Ok(product); ✅ Improves scalability and performance. NotFound() : Ok(product); ✅ Improves scalability and performance. NotFound() : Ok(product); ✅ Improves scalability and performance. NotFound() : Ok(product); ✅ Improves scalability and performance.

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: Enable CORS (Cross-Origin Resource Sharing) to allow client apps from different domains: services.AddCors(options => { options.AddPolicy("AllowFrontend", builder => builder.WithOrigins(" .AllowAnyHeader() .AllowAnyMethod()); }); app.UseCors("AllowFrontend");

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 doesn't include rate limiting out of the box (pre-.NET 8). Use libraries like: AspNetCoreRateLimit YARP, Azure API Management .NET 8 introduced built-in RateLimiterMiddleware.

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: pp.UseSwagger(); pp.UseSwaggerUI(); Supports: Auto-generated OpenAPI docs Try it out interface Versioning support pp.UseSwagger(); pp.UseSwaggerUI(); Supports: Auto-generated OpenAPI docs Try it out interface Versioning support pp.UseSwagger(); pp.UseSwaggerUI(); Supports: Auto-generated OpenAPI docs Try it out interface Versioning support pp.UseSwagger();… pp.UseSwaggerUI(); Supports: Auto-generated OpenAPI docs…

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 Swashbuckle.AspNetCore or NSwag for generating Swagger docs. services.AddSwaggerGen(); app.UseSwagger(); app.UseSwaggerUI(); Supports: Auto-generated OpenAPI docs Try it out interface Versioning support

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: Unit testing: Mock services/repositories using Moq or FakeItEasy. Integration testing: Use WebApplicationFactory<T> + TestServer + HttpClient. var client = _factory.CreateClient();

Example code

var response = await client.GetAsync("/api/products");

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 JWT Bearer Tokens for stateless auth: services.AddAuthentication(JwtBearerDefaults.AuthenticationSch eme) .AddJwtBearer(options => { ... }); Secure endpoints with: [Authorize(Roles = "Admin")] OAuth supported via IdentityServer, Azure AD, or external providers.

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: HTTPS: Enforced via UseHttpsRedirection() CORS: Limit origins using policies Anti-forgery: Usually not needed for APIs unless using cookies (use ValidateAntiForgeryToken) Use authentication + authorization checks for all endpoints

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: DTOs decouple internal models from API contracts. Use AutoMapper for mapping: CreateMap<Product, ProductDto>(); var dto = _mapper.Map<ProductDto>(product);

Example code

DTOs decouple internal models from API contracts. Use AutoMapper for mapping: CreateMap<Product, ProductDto>(); var dto = _mapper.Map<ProductDto>(product);

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: Avoid breaking changes to existing endpoints. Use new versions for changes in contracts. Maintain old versions as long as needed. Ensure documentation and clients are updated accordingly.

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: Return 409 Conflict if concurrency exception is caught. Model Binding & Validation

Example code

Use RowVersion / ETag to detect concurrent edits. Example with EF Core: modelBuilder.Entity<Product>() .Property(p => p.RowVersion).IsRowVersion();

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 automatically binds data based on parameter types and attributes ([FromBody], [FromQuery], etc.).

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: Model binding in ASP.NET Core maps incoming HTTP data to C# parameters or model properties. 🔍 Sources considered: Route data Query string Form data Headers JSON body (application/json) Uploaded files Services (via [FromServices]) ASP.NET Core automatically binds data based on parameter types and attributes ([FromBody], [FromQuery], etc.).

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: Simple types (int, string, bool, DateTime, etc.): Bound from route, query string, or form fields. Complex types (custom classes): Bound from multiple sources like query/form fields or JSON body. public IActionResult Create([FromBody] Product product)

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: Use a custom model binder when default binding doesn’t work (e.g., custom formats, headers). public class CustomBinder : IModelBinder {

Example code

public Task BindModelAsync(ModelBindingContext context) { // Custom logic here }
} Register with [ModelBinder] or globally in Startup.

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: [FromQuery], etc.) You cannot bind multiple [FromBody] parameters in a single action. Common sources: [FromBody] — for JSON/XML payloads [FromQuery] — query string [FromRoute] — route values [FromForm] — form fields and file uploads [FromHeader] — HTTP headers

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: Decorate models with attributes: public class User { [Required] [StringLength(50)] [EmailAddress] public string Email { get; set; } } Used in both MVC and API for validation.

Example code

Decorate models with attributes: public class User { [Required] [StringLength(50)] [EmailAddress] public string Email { get; set; }
} Used in both MVC and API for validation.

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: Server-side: Always performed on the server; use ModelState.IsValid. Client-side: HTML5 + jQuery Unobtrusive Validation (for MVC/Razor Pages). Client-side validation improves UX, but server-side is essential for security.

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: Create custom rules by inheriting ValidationAttribute: public class MustBeEvenAttribute : ValidationAttribute { public override bool IsValid(object value) { return (int)value % 2 == 0; } } Use like: [MustBeEven] public int Number { get; set; }

Example code

Create custom rules by inheriting ValidationAttribute: public class MustBeEvenAttribute : ValidationAttribute {
public override bool IsValid(object value) {
return (int)value % 2 == 0;
}
} Use like: [MustBeEven] public int Number { get; set; }

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