C# — Interview questions
Architecture
Dependency inversion, layered and Clean/Onion architecture, the Repository pattern over EF Core, and DTO versus domain entity mapping.
5 questions
ASP.NET Core & EF Core
The middleware pipeline, dependency injection and service lifetimes, model binding, the EF Core change tracker, the N+1 problem, and zero-downtime migrations.
9 questions
Async & await
The async/await state machine, Task versus ValueTask, cancellation with CancellationToken, IAsyncEnumerable, async void, and exception propagation.
15 questions
CLR & Runtime
Managed code, garbage collection, assemblies, reflection, serialization, IL/JIT, and LINQ.
11 questions
Coding Tasks
Hands-on C# coding tasks — string and array algorithms, recursion, and in-place tricks.
6 questions
Collections & Arrays
Arrays, ArrayList vs generic collections, jagged arrays, dictionaries, and List internals.
8 questions
Concurrency & Synchronization
Races and deadlocks, lock and Monitor, SemaphoreSlim, volatile and Interlocked, thread-pool starvation, Channels, and concurrent collections.
18 questions
Delegates & Events
Delegates, multicast, Func/Action/Predicate, lambdas, binding, and dynamic dispatch.
7 questions
Design Patterns
Creational, structural, and behavioral patterns expressed in C# idioms — delegates over Strategy, events over Observer, a DI container over a hand-rolled Singleton.
13 questions
EF Core
DbContext and DbSet, the change tracker and AsNoTracking, loading strategies, the N+1 problem, migrations, and optimistic concurrency.
11 questions
Exception Handling
try/catch/finally, multiple catch order, throw vs throw ex, custom exceptions, and using.
6 questions
Generics
Generic types and methods, constraints, IEnumerable vs IQueryable, and generic collections.
7 questions
Inheritance & Polymorphism
Inheritance, interfaces, virtual/override, method overloading, and why C# has no multiple class inheritance.
6 questions
Type Members
Properties, indexers, extension methods, const vs readonly, ref/out, enums, and events.
9 questions
Modern C#
Records and value equality, pattern matching, init-only and required members, nullable reference types, collection expressions, and C# 14 features.
16 questions
OOP
Classes and objects, constructors and chaining, access modifiers, abstraction, and abstract classes.
6 questions
Records & Pattern Matching
Records and value-based equality, positional records, pattern matching forms, switch expressions, init-only and required members, primary constructors.
12 questions
Testing
Test levels, the xUnit model, mocks and their overuse, integration testing via WebApplicationFactory, testable time, and what coverage does not tell you.
13 questions
Equality, Nullability & Dynamic
Value versus reference equality, Equals/GetHashCode, nullable types, immutability, var/dynamic/object, and type inference.
5 questions
Type System
Value versus reference types, struct semantics, boxing/unboxing, and runtime type testing.
6 questions
Web API
Minimal APIs versus MVC controllers, model binding, action results, JWT authentication, authorization policies, and API versioning.
11 questions