1. What is Dependency Injection?
π‘ Common in real backend interviews
β Bad answer
It reduces coupling.
β
Senior answer
Dependency Injection separates object creation from business logic.
Dependencies are injected (usually via constructor), making the system more testable and maintainable.
2. What is async/await in C#?
π‘ Common in real backend interviews
β Bad answer
It makes code asynchronous.
β
Senior answer
async/await enables non-blocking I/O operations.
It frees the thread while waiting, improving scalability.
3. Task vs Thread?
π‘ Common in real backend interviews
β Bad answer
Task is lighter.
β
Senior answer
Thread is OS-level.
Task is managed by .NET and uses ThreadPool.
Tasks are more efficient for concurrency.
4. What is Middleware?
π‘ Common in real backend interviews
β Bad answer
Handles requests.
β
Senior answer
Middleware processes HTTP requests in a pipeline.
Each component can handle or pass to next.
5. What is CQRS?
π‘ Common in real backend interviews
β Bad answer
Separate read/write.
β
Senior answer
CQRS separates commands and queries into different models,
improving scalability and clarity.
6. What is Garbage Collection in .NET?
π‘ Common in real backend interviews
β Bad answer
It frees memory.
β
Senior answer
Garbage Collection (GC) automatically reclaims memory from objects
that are no longer referenced.
It uses a generational model (Gen 0, 1, 2)
to optimize performance and reduce overhead.
7. What is LINQ in C#?
π‘ Common in real backend interviews
β Bad answer
It is used to query data.
β
Senior answer
LINQ (Language Integrated Query) provides a declarative way to query data
from collections, databases, and other sources using a unified syntax.
It can execute in memory (IEnumerable) or be translated into SQL (IQueryable),
depending on the data source.
8. What is a Deadlock?
π‘ Common in real backend interviews
β Bad answer
When threads block each other.
β
Senior answer
A deadlock occurs when two or more threads are waiting on each other
to release resources, causing all of them to be stuck indefinitely.
It often happens due to improper locking or blocking async code (e.g., using .Result or .Wait()).
9. What is Span<T> in C#?
π‘ Common in real backend interviews
β Bad answer
It is a faster array.
β
Senior answer
Span<T> is a lightweight structure that provides a safe way to work with contiguous memory
without allocations.
It can point to stack memory, arrays, or unmanaged memory.
Span helps reduce allocations and improve performance in high-throughput scenarios,
but it must stay on the stack and cannot be stored on the heap.
10. What is boxing and unboxing in C#?
π‘ Common in real backend interviews
β Bad answer
It converts value types to reference types.
β
Senior answer
Boxing is the process of converting a value type into an object (reference type),
which causes heap allocation.
Unboxing extracts the value type back from the object.
Excessive boxing/unboxing can hurt performance due to allocations and casting,
especially in loops or high-frequency operations.
Stop memorizing answers.
Start thinking like a senior engineer.
If you're tired of failing interviews even when you "know the answer"β¦
π Start Practicing Now