Interview Q&A

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

4616 total questions 4516 technical 100 career & HR 4346 from PDF library

Showing 126–150 of 226

Popular tracks

Mid PDF
IValidatableObject interface?

Use for cross-field validation within a model: public class Product : IValidatableObject { public string Name { get; set; } public decimal Price { get; set; } public IEnumerable<ValidationResult> Validate(Validatio…

ASP.NET Core Read answer
Mid PDF
Using FluentValidation?

Install FluentValidation.AspNetCore Create a validator class: public class UserValidator : AbstractValidator<User> { public UserValidator() { RuleFor(x => x.Email).NotEmpty().EmailAddress(); } } Register with: s…

ASP.NET Core Read answer
Mid PDF
Validation in API vs MVC (error response formatting)?

[ApiController] handles automatic validation: Returns 400 BadRequest with ValidationProblemDetails if ModelState.IsInvalid. In MVC (without [ApiController]), you need to manually check ModelState.IsValid. if (!ModelState…

ASP.NET Core Read answer
Mid PDF
Model state: checking ModelState.IsValid?

Answer: Used to check if bound model passed validation: if (!ModelState.IsValid) { return BadRequest(ModelState); } MVC automatically adds errors to ModelState based on validation attributes. What interviewers expect A c…

ASP.NET Core Read answer
Mid PDF
Binding nested objects and collections?

Answer: SP.NET Core supports binding nested properties: public class Order { public Customer Customer { get; set; } public List<Product> Products { get; set; } } Works seamlessly from JSON or form data if p…

ASP.NET Core Read answer
Mid PDF
Handling missing or invalid data?

Answer: Use [Required] for non-nullable fields. For optional values, use nullable types. Use ModelState to report and handle missing/invalid fields. Return custom error messages if needed. What interviewers expect A clea…

ASP.NET Core Read answer
Mid PDF
Sanitization of input?

Answer: Model binding does not sanitize input — it binds raw data. 🛡 To prevent attacks (XSS, injection), sanitize: Strings: HTML encode output (@Html.Encode) Manually clean input before use Use antivirus/malware scanne…

ASP.NET Core Read answer
Mid PDF
Binding of files (IFormFile)?

Used for file uploads from forms (not [FromBody]): public IActionResult Upload(IFormFile file) { var path = Path.Combine("uploads", file.FileName); using var stream = new FileStream(path, FileMode.Create); file.CopyTo(st…

ASP.NET Core Read answer
Mid PDF
Role of appsettings.json, appsettings.Development.json, etc. ● appsettings.json: Base configuration file used across all environments. ● appsettings.{Environment}.json: Environment-specific overrides (e.g., Development, Production). 🔧 ASP.NET Core loads them automatically based on the environment:

Answer: SPNETCORE_ENVIRONMENT=Development ✅ Loaded in order of precedence, where later files override earlier ones. What interviewers expect A clear definition tied to ASP.NET Core in ASP.NET Core projects Trade-offs (pe…

ASP.NET Core Read answer
Mid PDF
Role of appsettings.json, appsettings.Development.json, etc.?

appsettings.json: Base configuration file used across all environments. appsettings.{Environment}.json: Environment-specific overrides (e.g., Development, Production). 🔧 ASP.NET Core loads them automatically based on th…

ASP.NET Core Read answer
Mid PDF
Environment-based configuration (Development, Staging, Production)?

SP.NET Core uses the ASPNETCORE_ENVIRONMENT variable to determine the runtime environment. Supported environments (by convention): Development Staging Production Environment-specific logic can be applied: if (env.IsDevel…

ASP.NET Core Read answer
Mid PDF
Environment-based configuration (Development, Staging,?

Production) ASP.NET Core uses the ASPNETCORE_ENVIRONMENT variable to determine the runtime environment. Supported environments (by convention): Development Staging Production Environment-specific logic can be applied: if…

ASP.NET Core Read answer
Mid PDF
Overriding settings via environment variables, command line?

✅ ASP.NET Core supports hierarchical override of config sources: Environment variables override appsettings.json: MyApp__Logging__LogLevel__Default=Warning Command line arguments override everything: dotnet run --Logging…

ASP.NET Core Read answer
Mid PDF
Using IConfiguration to read settings?

Inject IConfiguration anywhere: public class MyService { private readonly string _apiKey; public MyService(IConfiguration config) { _apiKey = config["MySettings:ApiKey"]; } } You can also access nested settings via confi…

ASP.NET Core Read answer
Mid PDF
Binding configuration sections to POCOs?

Bind config to strongly typed objects: public class MySettings { public string ApiKey { get; set; } public int Timeout { get; set; } } services.Configure<MySettings>(config.GetSection("MySettings")); Use via IOptio…

ASP.NET Core Read answer
Mid PDF
Using Options pattern (IOptions<T>, IOptionsSnapshot<T>,?

IOptionsMonitor&lt;T&gt;) IOptions&lt;T&gt;: Reads settings once at startup. IOptionsSnapshot&lt;T&gt;: Gets updated settings per request (for scoped services). IOptionsMonitor&lt;T&gt;: Supports change notifications and…

ASP.NET Core Read answer
Mid PDF
Secret management (e.g. user secrets, Azure Key Vault)?

Answer: User Secrets (for local dev): dotnet user-secrets init dotnet user-secrets set "MySettings:ApiKey" "secret" Azure Key Vault: builder.Configuration.AddAzureKeyVault(...); ✅ Secure sensitive data like API keys, con…

ASP.NET Core Read answer
Mid PDF
Logging configuration: how to configure log levels?

In appsettings.json: "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } } Supports built-in providers: Console, Debug, EventSource, Azure, etc. Cust…

ASP.NET Core Read answer
Mid PDF
Connection strings management?

Stored under "ConnectionStrings" section in appsettings.json: "ConnectionStrings": { "DefaultConnection": "Server=.;Database=AppDb;Trusted_Connection=True;" } Read via: var conn = config.GetConnectionString("DefaultConne…

ASP.NET Core Read answer
Mid PDF
Settings reloading (on change) if supported?

JSON files support live reload: builder.Configuration.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true); IOptionsMonitor&lt;T&gt; automatically updates bound values when config changes. 🔁 Does not w…

ASP.NET Core Read answer
Mid PDF
Strongly typed configuration?

Answer: Using POCOs and Options pattern allows type-safe config: services.Configure&amp;lt;MySettings&amp;gt;(config.GetSection("MySettings")); Use [Required], [Range], etc., to add validation. What interviewers expect A…

ASP.NET Core Read answer
Mid PDF
Validating configuration (e.g., using IValidateOptions)?

You can validate bound config using IValidateOptions&lt;T&gt;: public class MySettingsValidator : IValidateOptions&lt;MySettings&gt; { public ValidateOptionsResult Validate(string name, MySettings options) { if (string.I…

ASP.NET Core Read answer
Mid PDF
Configuration providers (JSON, XML, INI, Environment, Azure, etc.)?

Answer: SP.NET Core supports multiple configuration providers: JSON (default) Environment Variables Command Line Args INI files XML files In-memory Azure App Configuration Azure Key Vault Secrets Manager Each can be chai…

ASP.NET Core Read answer
Mid PDF
Default values and optional settings?

Answer: Use default values in POCOs or fallback logic: public class MySettings { public string ApiKey { get; set; } = "default-api-key"; } Or: var apiKey = config["MySettings:ApiKey"] ?? "fallback"; What interviewers exp…

ASP.NET Core Read answer
Mid PDF
Default values and optional settings Use default values in POCOs or fallback logic: public class MySettings { public string ApiKey { get; set; } = "default-api-key"; } Or: var apiKey = config["MySettings:ApiKey"] ?

? "fallback"; 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 not use it in production Real-wor…

ASP.NET Core Read answer

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

Use for cross-field validation within a model:

public class Product : IValidatableObject {
public string Name { get; set; }
public decimal Price { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext

context) {

if (Price < 0) {

yield return new ValidationResult("Price must be

positive");

}
}
}
Permalink & share

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

  • Install FluentValidation.AspNetCore
  • Create a validator class:
public class UserValidator : AbstractValidator<User> {
public UserValidator() {
RuleFor(x => x.Email).NotEmpty().EmailAddress();
}
}

Register with:

services.AddFluentValidationAutoValidation();

✅ Offers more readable and testable validation logic than data annotations.

Permalink & share

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

  • [ApiController] handles automatic validation:
  • Returns 400 BadRequest with ValidationProblemDetails if

ModelState.IsInvalid.

  • In MVC (without [ApiController]), you need to manually check

ModelState.IsValid.

if (!ModelState.IsValid) return View(model);
Permalink & share

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

Answer: Used to check if bound model passed validation: if (!ModelState.IsValid) { return BadRequest(ModelState); } MVC automatically adds errors to ModelState based on validation attributes.

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 not use it in production

Real-world example

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.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in ASP.NET Core architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

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

Answer: SP.NET Core supports binding nested properties: public class Order { public Customer Customer { get; set; } public List&lt;Product&gt; Products { get; set; } } Works seamlessly from JSON or form data if property names match.

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 not use it in production

Real-world example

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.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in ASP.NET Core architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

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

Answer: Use [Required] for non-nullable fields. For optional values, use nullable types. Use ModelState to report and handle missing/invalid fields. Return custom error messages if needed.

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 not use it in production

Real-world example

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.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in ASP.NET Core architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

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

Answer: Model binding does not sanitize input — it binds raw data. 🛡 To prevent attacks (XSS, injection), sanitize: Strings: HTML encode output (@Html.Encode) Manually clean input before use Use antivirus/malware scanners for uploaded files

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 not use it in production

Real-world example

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.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in ASP.NET Core architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

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

Used for file uploads from forms (not [FromBody]):

public IActionResult Upload(IFormFile file)
{
var path = Path.Combine("uploads", file.FileName);
using var stream = new FileStream(path, FileMode.Create);

file.CopyTo(stream);

}

📝 For multiple files:

List<IFormFile> files

Configuration & AppSettings

Permalink & share

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

Answer: SPNETCORE_ENVIRONMENT=Development ✅ Loaded in order of precedence, where later files override earlier ones.

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 not use it in production

Real-world example

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.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in ASP.NET Core architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

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

  • appsettings.json: Base configuration file used across all environments.
  • appsettings.{Environment}.json: Environment-specific overrides (e.g.,

Development, Production).

🔧 ASP.NET Core loads them automatically based on the environment:

ASPNETCORE_ENVIRONMENT=Development

✅ Loaded in order of precedence, where later files override earlier ones.

Permalink & share

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

SP.NET Core uses the ASPNETCORE_ENVIRONMENT variable to determine the runtime

environment.

Supported environments (by convention):

  • Development
  • Staging
  • Production

Environment-specific logic can be applied:

if (env.IsDevelopment()) { ... }

lso used to load:

  • appsettings.{env}.json
  • Startup{env}.cs (in older versions)
Permalink & share

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

Production)

ASP.NET Core uses the ASPNETCORE_ENVIRONMENT variable to determine the runtime

environment.

Supported environments (by convention):

  • Development
  • Staging
  • Production

Environment-specific logic can be applied:

if (env.IsDevelopment()) { ... }

Also used to load:

  • appsettings.{env}.json
  • Startup{env}.cs (in older versions)
Permalink & share

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

✅ ASP.NET Core supports hierarchical override of config sources:

  • Environment variables override appsettings.json:

MyApp__Logging__LogLevel__Default=Warning

  • Command line arguments override everything:

dotnet run --Logging:LogLevel:Default=Debug

Permalink & share

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

Inject IConfiguration anywhere:

public class MyService {
private readonly string _apiKey;
public MyService(IConfiguration config) {
_apiKey = config["MySettings:ApiKey"];
}
}

You can also access nested settings via config.GetSection("MySettings").

Permalink & share

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

Bind config to strongly typed objects:

public class MySettings {
public string ApiKey { get; set; }
public int Timeout { get; set; }
}

services.Configure<MySettings>(config.GetSection("MySettings"));

Use via IOptions<MySettings>.

Permalink & share

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

IOptionsMonitor<T>)

  • IOptions<T>: Reads settings once at startup.
  • IOptionsSnapshot<T>: Gets updated settings per request (for scoped services).
  • IOptionsMonitor<T>: Supports change notifications and works in singleton

services.

public MyService(IOptions<MySettings> options) {
var settings = options.Value;
}
Permalink & share

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

Answer: User Secrets (for local dev): dotnet user-secrets init dotnet user-secrets set "MySettings:ApiKey" "secret" Azure Key Vault: builder.Configuration.AddAzureKeyVault(...); ✅ Secure sensitive data like API keys, connection strings, tokens.

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 not use it in production

Real-world example

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.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in ASP.NET Core architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

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

In appsettings.json:

"Logging": {

"LogLevel": {

"Default": "Information",

"Microsoft": "Warning",

"Microsoft.Hosting.Lifetime": "Information"

}
}

Supports built-in providers: Console, Debug, EventSource, Azure, etc.

Custom configuration through ILogger<T>.

Permalink & share

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

Stored under "ConnectionStrings" section in appsettings.json:

"ConnectionStrings": {

"DefaultConnection":

"Server=.;Database=AppDb;Trusted_Connection=True;"
}

Read via:

var conn = config.GetConnectionString("DefaultConnection");

Or inject via Options pattern.

Permalink & share

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

JSON files support live reload:

builder.Configuration.AddJsonFile("appsettings.json", optional:

false, reloadOnChange: true);

IOptionsMonitor<T> automatically updates bound values when config changes.

🔁 Does not work with all sources (e.g., env vars, command line).

Permalink & share

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

Answer: Using POCOs and Options pattern allows type-safe config: services.Configure&lt;MySettings&gt;(config.GetSection("MySettings")); Use [Required], [Range], etc., to add validation.

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 not use it in production

Real-world example

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.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in ASP.NET Core architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

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

You can validate bound config using IValidateOptions<T>:

public class MySettingsValidator : IValidateOptions<MySettings> {
public ValidateOptionsResult Validate(string name, MySettings

options) {

if (string.IsNullOrWhiteSpace(options.ApiKey)) {
return ValidateOptionsResult.Fail("ApiKey is

required.");

}
return ValidateOptionsResult.Success;
}
}

Register with DI:

services.AddSingleton<IValidateOptions<MySettings>,

MySettingsValidator>();

Permalink & share

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

Answer: SP.NET Core supports multiple configuration providers: JSON (default) Environment Variables Command Line Args INI files XML files In-memory Azure App Configuration Azure Key Vault Secrets Manager Each can be chained with priority.

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 not use it in production

Real-world example

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.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in ASP.NET Core architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

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

Answer: Use default values in POCOs or fallback logic: public class MySettings { public string ApiKey { get; set; } = "default-api-key"; } Or: var apiKey = config["MySettings:ApiKey"] ?? "fallback";

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 not use it in production

Real-world example

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.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in ASP.NET Core architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

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

? "fallback";

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 not use it in production

Real-world example

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.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in ASP.NET Core architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

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