Interview practice

.NET Developer

2–5 years · Mid — C# · ASP.NET Core · Entity Framework · SQL Server · LINQ · Azure

0–2 years 2–5 years 5–8 years 8+ years
technical Async/Await 1 of 6
You have an ASP.NET Core API endpoint that is slow and runs a database call inside an async method. The endpoint is called 100 times concurrently, and the server CPU usage spikes to 100%. How do you diagnose the issue?
What a strong answer covers

Checks for blocking calls in the async method; reviews the use of 'ConfigureAwait(false)'; analyses thread pool exhaustion and task scheduling; looks for synchronous code in async methods; considers using 'ValueTask' for performance improvements.

The follow-up you would get

What specific code patterns could lead to thread pool exhaustion?

Could you have answered that?
scenario Debugging production issues 2 of 6
A user reports that a feature in your application is returning incorrect results, but it works fine in your local environment. What do you do?
What a strong answer covers

Replicates the user environment to identify discrepancies; checks logs for errors or warnings related to the feature; validates external service responses; inspects data consistency in the production database; considers recent code changes that might have affected the feature.

The follow-up you would get

You discover that the issue is due to a data discrepancy. How do you handle data migrations to ensure consistency?

Could you have answered that?
technical API Design 3 of 6
You are tasked with designing a RESTful API for a new feature that requires creating, reading, updating, and deleting resources. What key considerations do you take into account?
What a strong answer covers

Defines clear resource URIs and HTTP methods for CRUD operations; ensures idempotency for PUT and DELETE methods; implements proper status codes for responses; considers pagination for large datasets; validates input using model binding and data annotations.

The follow-up you would get

How do you handle versioning of your API?

Could you have answered that?
scenario Database access patterns 4 of 6
You need to optimise a query that is running slower than expected in production. What steps do you take to improve its performance?
What a strong answer covers

Examines the execution plan for bottlenecks; checks for missing indexes and suggests adding them; reviews database statistics for accuracy; considers query rewriting for efficiency; tests changes in a staging environment before deployment.

The follow-up you would get

You find that the query is still slow after optimisation. How do you monitor its performance over time?

Could you have answered that?
technical Database Access Patterns 5 of 6
Your application is performing multiple database queries in a loop, leading to performance bottlenecks. How do you refactor the code to improve efficiency?
What a strong answer covers

Refactors to use 'Include' for eager loading related entities; considers using 'Batch' processing to reduce round trips; analyses LINQ queries for optimization; reviews for possible use of stored procedures; evaluates the possibility of caching frequently accessed data.

The follow-up you would get

What are the implications of using caching in this context?

Could you have answered that?
ownership A migration experience 6 of 6
Can you describe a migration you led, such as moving from one database to another or updating a framework version? What were the hurdles?
What a strong answer covers

Describes the migration context and objectives; identifies specific technical hurdles encountered; explains the strategies implemented to address these hurdles; reflects on outcomes and any unforeseen issues; provides insight into team collaboration during the process.

The follow-up you would get

What would you do to better prepare for the migration next time?

Could you have answered that?
That is this set.

Load six more — you will get questions you have not seen first.

Give me six more →

Say your answer out loud before revealing. Reading the answer first feels like learning and is not.