Skip to content

.NET Full Stack Mock Interview: 20 Questions in 50 Minutes

Four rounds that copy a real interview. Answer aloud, then check the model answers.

Mock interview format

  1. Warm-up · 5 minutes — 4 questions
  2. Technical · 20 minutes — 7 questions
  3. Scenario · 15 minutes — 5 questions
  4. HR & behavioural · 10 minutes — 4 questions

Tip: record yourself and listen back. Most people talk too fast and skip the key idea.

Mock progressStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

What is the difference between compile-time and runtime polymorphism?

Warm-upOOP in C#Easy
Save to ▾
Show answer
Compile-time, or static, polymorphism is resolved by the compiler, mainly through method overloading and operator overloading, and through generics. Runtime, or dynamic, polymorphism is resolved when the program runs, through virtual methods and interfaces: a Shape reference may call Circle.Area or Square.Area depending on the actual object. Runtime polymorphism is what makes plugin designs and dependency injection possible.
02

Angular or React with ASP.NET Core: how do you choose?

Save to ▾
Show answer
Angular is a complete framework with routing, forms, HTTP, dependency injection and TypeScript built in, which suits large enterprise apps and teams that want strong conventions. React is a UI library with a large ecosystem, giving more freedom to pick routing and state tools, and is popular in product startups. Both work equally well with an ASP.NET Core API. Choose based on team skills, project size and the company's existing stack.
03

What does the sealed keyword do?

Warm-upOOP in C#Easy
Save to ▾
Show answer
A sealed class cannot be inherited, and a sealed override method cannot be overridden further in derived classes. Use it when a class is not designed for extension, such as a security-sensitive or immutable type; string is sealed for this reason. Sealing also lets the JIT devirtualise calls, giving small performance gains. Many teams seal classes by default and unseal only when inheritance is genuinely needed.
04

When would you use a HashSet<T>?

Save to ▾
Show answer
HashSet<T> stores unique values with O(1) average lookup, add and remove. Use it when you need fast membership checks, such as checking if an email already exists in a batch of 1 lakh records, or to remove duplicates. It also supports set operations like UnionWith, IntersectWith and ExceptWith. It does not keep insertion order or allow index access; use SortedSet<T> if you need sorted unique values.
05

What are signals in Angular and why were they introduced?

Save to ▾
Show answer
Signals are reactive values: count = signal(0) holds state, computed() derives values and effect() runs side effects when dependencies change. Angular knows exactly which parts of the view read which signal, so it updates only those parts instead of checking the whole component tree. This enables zoneless change detection, which became the default for new apps in Angular 21, and gives simpler state handling than RxJS for local UI state.
06

Why does using async in ASP.NET Core controllers improve scalability?

Save to ▾
Show answer
Each request needs a thread from the thread pool. If a controller blocks while waiting for SQL Server or an external API, that thread sits idle and cannot serve other users, so under load the pool runs out and requests queue. With async I/O, the thread is released during the wait and reused, so the same server handles many more concurrent requests. It does not make a single request faster.
07

Show a class using a primary constructor with dependency injection.

TechnicalC# FundamentalsMedium
Save to ▾
Show answer
public class OrderService(IOrderRepository repo, ILogger<OrderService> logger) { public async Task<Order?> GetAsync(int id) { logger.LogInformation("Fetching order {Id}", id); return await repo.FindAsync(id); } } Primary constructors on classes arrived in C# 12. Parameters are captured and usable in all members, removing boilerplate fields. They are not readonly, so assign to a readonly field if immutability matters.
08

What is the difference between a static class and a singleton?

TechnicalOOP in C#Medium
Save to ▾
Show answer
A static class cannot be instantiated, cannot implement interfaces and is initialised by the runtime; it suits stateless helpers like Math. A singleton is a normal class with exactly one instance, so it can implement interfaces, be passed as a parameter and be mocked in tests. In ASP.NET Core, you rarely write a singleton by hand; you register the class with AddSingleton and let the DI container manage its lifetime.
09

Show how to stream data with IAsyncEnumerable.

Save to ▾
Show answer
public async IAsyncEnumerable<Order> GetOrdersAsync( [EnumeratorCancellation] CancellationToken ct = default) { await foreach (var o in _db.Orders.AsNoTracking().AsAsyncEnumerable().WithCancellation(ct)) yield return o; } // consumer await foreach (var order in service.GetOrdersAsync()) Console.WriteLine(order.Id); Items are produced and consumed one at a time asynchronously. ASP.NET Core can stream an IAsyncEnumerable result as JSON without buffering the whole list.
10

Show the difference between ROW_NUMBER, RANK and DENSE_RANK with a query.

TechnicalSQL Server and T-SQLMedium
Save to ▾
Show answer
SELECT Name, Department, Salary, ROW_NUMBER() OVER (PARTITION BY Department ORDER BY Salary DESC) AS RowNum, RANK() OVER (PARTITION BY Department ORDER BY Salary DESC) AS Rnk, DENSE_RANK() OVER (PARTITION BY Department ORDER BY Salary DESC) AS DenseRnk FROM Employees; -- salaries 90, 90, 80 give -- ROW_NUMBER: 1, 2, 3 -- RANK: 1, 1, 3 -- DENSE_RANK: 1, 1, 2 PARTITION BY restarts numbering for each department.
11

What is the difference between a clustered and a non-clustered index?

TechnicalSQL Server and T-SQLMedium
Save to ▾
Show answer
A clustered index defines the physical order of the table's data, so the leaf level is the data itself, and a table can have only one. A non-clustered index is a separate structure with key values and a pointer back to the row, and a table can have many. Range queries on the clustered key are fast. Non-clustered indexes speed up searches on other columns but add cost to inserts and updates.
12

A frequent query on Orders filtered by CustomerId shows expensive key lookups in its execution plan. How would you fix it?

Save to ▾
Show answer
A covering index contains every column a query needs, so SQL Server answers it from the index alone without key lookups to the clustered index. INCLUDE adds non-key columns to the leaf level only, keeping the index key small. For SELECT Name, Total FROM Orders WHERE CustomerId = 5, an index on CustomerId INCLUDE (Name, Total) covers it. Do not include too many columns, since every index slows writes.
13

Your security team objects to storing the JWT in localStorage in your Angular app. What are the options?

Save to ▾
Show answer
localStorage is readable by any JavaScript on the page, so an XSS bug can steal the token. A safer pattern is to keep the short-lived access token in memory and store the refresh token in an HttpOnly, Secure, SameSite cookie that scripts cannot read. Even better is the backend-for-frontend pattern, where ASP.NET Core holds tokens server-side and the browser uses a session cookie. Add CSRF protection when using cookies.
14

A page listing 100 orders with customer names runs 101 SQL queries. What is the problem and how do you fix it?

ScenarioEntity Framework CoreMedium
Save to ▾
Show answer
This is the N+1 problem: one query loads the orders, then lazy loading fires a separate query for each order's Customer. Fix it by loading everything in one query, either with Include(o => o.Customer) or better with a projection: Select(o => new OrderListDto(o.Id, o.Total, o.Customer.Name)), which fetches only needed columns via a join. Turn on EF Core logging to spot such patterns early.
15

A query that used to run in 1 second now takes 30 seconds. How do you troubleshoot it?

ScenarioSQL Server and T-SQLMedium
Save to ▾
Show answer
Capture the actual execution plan and look for table or index scans on large tables, key lookups, big differences between estimated and actual rows, and warnings like implicit conversions or spills to tempdb. Check missing or fragmented indexes and outdated statistics, and update them. Use Query Store to compare the old and new plans; if a plan regressed, you can force the good plan while fixing the root cause.
16

A singleton CacheService injects AppDbContext, and users start seeing stale data and occasional 'a second operation was started on this context' errors. What is wrong?

Save to ▾
Show answer
This is a captive dependency: a scoped DbContext is captured by a singleton, so one context lives forever and is shared by all requests across threads. DbContext is not thread-safe and its change tracker grows stale. Fix it by injecting IServiceScopeFactory or IDbContextFactory<AppDbContext> into the singleton and creating a short-lived context per operation. Enabling ValidateScopes in development catches this at startup.
17

Tell me about a time you made a mistake that affected data, and what you did.

HR & behaviouralSQL Server and T-SQLMedium
Save to ▾
Show answer
Early in my job (Situation) I ran an UPDATE on a test copy that I believed was staging, but it was a shared QA database, and 2,000 test orders lost their status. My task was to fix it fast. I told my lead immediately, restored the rows from the nightly backup with the DBA, and verified counts. Result: QA lost only an hour. Since then I always wrap manual updates in a transaction and run a SELECT with the same WHERE first.
18

Tell me about a disagreement with the front-end team over an API contract and how you resolved it.

HR & behaviouralASP.NET Core Web APIMedium
Save to ▾
Show answer
On a dashboard feature (Situation) the React team wanted one endpoint returning everything, while I worried about payload size. My task was to agree a design quickly. I set up a short call, we listed exact screen needs, and I proposed one aggregated endpoint with paging and optional fields. We wrote the OpenAPI spec together. Result: payload dropped by half, the UI got one call, and the spec became our template for later features.
19

What are your strengths and weaknesses as a developer?

HR & behaviouralSQL Server and T-SQLEasy
Save to ▾
Show answer
My strength is that I go deep when debugging; I like reading execution plans and logs until I find the real cause, which has helped my team fix slow queries. A weakness was that I spent too long polishing code before asking for feedback. I now open small draft pull requests early and ask for review, which has made me faster and helped me learn from seniors sooner.
20

Why do you want to work as a .NET full stack developer?

HR & behaviouralC# FundamentalsEasy
Save to ▾
Show answer
I enjoy building complete features, from database to screen, and .NET lets me do that with one strong, typed language on the back end. It is widely used by IT services firms, banks and product companies in India, so there are steady opportunities. I have built projects with ASP.NET Core and React, and I like that the platform is open source, cross-platform and keeps improving every year.

Frequently asked questions

How do I use this mock interview?

Set a 50-minute timer, answer every question aloud (or ask a friend to read them), and open answers only after each round. Note every question where your answer missed the key idea.

How often should I take a mock?

Once a week while preparing and once two or three days before a real interview. The question order is fixed, so for fresh practice use the company and experience pages too.