C# Interview

Testing, Security, APIs & Reliability

C# interview questions covering testing, security, apis & reliability.

10 Questions Filter by level

Interview questions

Open a question for the full answer, code and interview guidance.

10 Results
181
SeniorAdvanced

What is integration testing in ASP.NET Core?

Integration testing verifies that multiple application components work together correctly. Unlike a unit test, it may exercise routing, middleware, model binding, dependency injection, authentication, database access, and HTTP responses together.

182
SeniorAdvanced

What is the difference between a mock, stub, fake, and spy?

These are forms of test doubles used to replace real dependencies during testing.

183
SeniorAdvanced

How should passwords be handled in a C# application?

Passwords should never be stored as plain text and should not be encrypted with a reversible application key for normal authentication storage.

184
SeniorAdvanced

What is SQL injection, and how does EF Core help prevent it?

SQL injection occurs when untrusted input is treated as executable SQL syntax rather than data.

185
SeniorAdvanced

What is Cross-Site Scripting (XSS), and how is it prevented in ASP.NET Core?

XSS occurs when untrusted content is rendered into a page in a way that allows attacker-controlled script or markup to execute in another user's browser.

186
SeniorAdvanced

What is a RESTful API, and how is it implemented in ASP.NET Core?

A REST-style HTTP API models resources and uses standard HTTP methods and status codes consistently.

187
SeniorAdvanced

What is the difference between PUT and PATCH?

PUT generally represents replacing the state of a resource at a known URI with the supplied representation. It is normally expected to be idempotent.

188
SeniorAdvanced

What is idempotency in web APIs?

An operation is idempotent when performing the same operation multiple times has the same intended effect on server state as performing it once.

189
SeniorAdvanced

What is caching, and what caching options exist in ASP.NET Core?

Caching stores reusable data or responses so expensive work does not need to be repeated for every request.

190
SeniorAdvanced

What are health checks in ASP.NET Core?

Health checks expose application health information that infrastructure can use for monitoring, orchestration, and traffic management.