InterviewTreedInterviewTreed

The question library

Technical interview questions and answers

Explore practical questions, clear explanations, and code examples across developer technologies.

Showing 1057–1068 of 3610 questions

C# & .NET DevelopmentIntermediate1 min read

What is dependency injection?

Dependency injection supplies a class's dependencies from outside instead of constructing them internally. ASP.NET Core has a built-in service container.

C# & .NET DevelopmentIntermediate1 min read

What is a captive dependency?

A captive dependency occurs when a long-lived service captures a shorter-lived dependency, such as a singleton holding a scoped DbContext. This can cause s

C# & .NET DevelopmentIntermediate1 min read

What is the options pattern?

The options pattern binds configuration to a typed class and supports validation and different lifetimes through IOptions, IOptionsSnapshot, and IOptionsMo

C# & .NET DevelopmentIntermediate1 min read

What is ProblemDetails?

ProblemDetails is a standard representation for HTTP API errors, with fields such as type, title, status, detail, and instance. ASP.NET Core can generate i

C# & .NET DevelopmentIntermediate1 min read

What is model binding?

Model binding maps route values, query strings, headers, and request bodies to action parameters or model properties. Validation runs after binding for sup

C# & .NET DevelopmentIntermediate1 min read

How does model validation work?

Validation uses attributes such as [Required], [Range], and custom validators. With [ApiController], invalid model state normally produces an automatic 400

C# & .NET DevelopmentIntermediate1 min read

How do you design DTOs?

DTOs define what the API accepts or returns. They avoid exposing database entities directly and let the API evolve without leaking internal persistence det