.NET Interview Questions

.NET Core and Framework

  1. What are the key differences between .NET Core and .NET Framework?

  2. Explain the role of the Common Language Runtime (CLR) in .NET.

  3. What is the purpose of the IL (Intermediate Language) in .NET?

  4. How does the .NET Garbage Collector work, and what are its generations?

  5. What is the difference between IIS hosting and Kestrel in .NET Core?

Dependency Injection and Design Patterns

  1. What is Dependency Injection (DI), and how is it implemented in .NET Core?

  2. Explain the Singleton, Scoped, and Transient lifetimes in DI.

  3. What are some common design patterns used in .NET applications?

  4. How do you implement the Repository and Unit of Work patterns in .NET?

  5. What is the difference between Factory and Abstract Factory patterns?

Entity Framework (EF)

  1. What is the difference between Entity Framework Core and Entity Framework 6?

  2. How do you handle migrations in Entity Framework Core?

  3. What is the difference between DbContext and ObjectContext?

  4. How do you optimize performance in Entity Framework queries?

  5. Explain the difference between eager loading, lazy loading, and explicit loading.

Asynchronous Programming

  1. What is the purpose of async and await in .NET?

  2. How does the Task Parallel Library (TPL) work in .NET?

  3. What is the difference between Task and ValueTask?

  4. How do you handle exceptions in asynchronous methods?

  5. What is the role of ConfigureAwait(false) in async programming?

Web Development

  1. What is the difference between Web API and MVC in .NET?

  2. How do you implement authentication and authorization in ASP.NET Core?

  3. What is middleware in ASP.NET Core, and how is it used?

  4. How do you implement CORS (Cross-Origin Resource Sharing) in ASP.NET Core?

  5. What is the difference between SignalR and gRPC in .NET?

Performance and Optimization

  1. How do you profile and optimize a .NET application?

  2. What are some best practices for improving application performance in .NET?

  3. How do you implement caching in .NET Core?

  4. What is the difference between StringBuilder and String in terms of performance?

  5. How do you handle memory leaks in .NET applications?

Security

  1. How do you implement JWT (JSON Web Token) authentication in .NET Core?

  2. What is the difference between symmetric and asymmetric encryption?

  3. How do you secure sensitive data in a .NET application?

  4. What is the purpose of the Data Protection API in .NET Core?

  5. How do you prevent SQL injection in .NET applications?

Testing and Debugging

  1. How do you write unit tests for .NET applications?

  2. What is the purpose of Moq in unit testing?

  3. How do you debug a .NET application in Visual Studio?

  4. What is the difference between integration testing and unit testing?

  5. How do you test asynchronous methods in .NET?

Advanced Topics

  1. What is the purpose of Span<T> and Memory<T> in .NET?

  2. How do you implement global exception handling in ASP.NET Core?

  3. What is the difference between IEnumerable, IQueryable, and List?

  4. How do you use Reflection in .NET, and what are its use cases?

  5. What is the purpose of Polly in .NET applications?

An unhandled error has occurred. Reload 🗙