C# Interview Questions

Top 100+ Advanced dot net and C# Interview Questions for 2024

Photo of author

By Vivek Kumar

 In this blog post, we will dive into the top 100+ advanced dot net and C# interview questions for 2024. Whether you’re a seasoned developer looking to level up your skills or a newcomer aiming to land your dream job, mastering these questions will set you apart from the competition.

Basic Dot Net and C# Question:-

  1. Explain difference between .NET and C# ?
  2. .NET Framework vs .NET Core vs .NET 5.0
  3. What is IL ( Intermediate Language) Code ?
  4. What is the use of JIT ( Just in time compiler) ?
  5. Is it possible to view IL code ?
  6. What is the benefit of compiling in to IL code ?
  7. Does .NET support multiple programming languages ?
  8. What is CLR ( Common Language Runtime) ?
  9. What is managed and unmanaged code ?
  10. Explain the importance of Garbage collector ?
  11. Can garbage collector claim unmanaged objects ?
  12. What is the importance of CTS ?
  13. Explain CLS ?
  14. What are Value types & Reference types?
  15. Explain casting, implicit casting and explicit casting ?
  16. What can happen during explicit casting ?
  17. Differentiate between Array and ArrayList ?
  18. Whose performance is better array or arraylist ?
  19. What are generic collections ?
  20. What are threads (Multithreading)?
  21. How are threads different from TPL ?
  22. How do we handle exceptions in C#(try/catch)?
  23. What is the need of finally?
  24. Why do we need the out keyword ?

Questions on OOPs concept

  1. Why do we need OOP ?
  2. What are the important pillars of OOPs ?
  3. What is a class and object ?
  4. Abstraction vs Encapsulation?
  5. Explain Inheritance ?
  6. Explain virtual keyword ?
  7. What is overriding ?
  8. Explain overloading ?
  9. Overloading vs Overriding ?
  10. What is polymorphism ?
  11. Can polymorphism work with out inheritance ?
  12. Explain static vs dynamic polymorphism ?
  13. Explain operator overloading ?
  14. Why do we need Abstract classes ?
  15. Are Abstract methods virtual ?
  16. Can we create a instance of Abstract classes ?
  17. Is it compulsory to implement Abstract methods ?
  18. Why simple base class replace Abstract class ?
  19. Explain interfaces and why do we need it ?
  20. Can we write logic in interface ?
  21. Can we define methods as private in interface ?
  22. If i want to change interface what’s the best practice ?
  23. Explain Multiple inheritance in Interface ?
  24. Explain Interface Segregation principle ?
  25. Can we create instance of interface ?
  26. Can we do Multiple inheritance with Abstract classes ?
  27. Difference between Abstract Class & Interfaces?
  28. Why do we need constructors ?
  29. In parent child which constructor fires first ?
  30. How are initializers executed ?
  31. How are static constructors executed in Parent child ?
  32. When does static constructor fires ?
  33. What is Shadowing?
  34. Explain method hiding?
  35. Shadowing vs Overriding ?
  36. When do we need Shadowing ?
  37. Explain Sealed Classes ?
  38. Can we create instance of sealed classes ?
  39. What are nested classes and when to use them ?
  40. Can Nested class access outer class variables ?
  41. Can we have public, protected access modifiers in nested class ?
  42. Explain Partial classes ?
  43. In What scenarios do we use partial classes ?

Questions on Advance C#

  1. What are the different types of “USING/HAS A” relationship ?
  2. What is a composition relationship ?
  3. Explain Aggregation ?
  4. Explain Association ?
  5. Differentiate between Composition vs Aggregation vs Association ?
  6. UML Symbols for Composition, Aggregation and Association
  7. Explain stack and Heap ?
  8. Where are stack and heap stored ?
  9. What goes on stack and what goes on heap ?
  10. How is the stack memory address arranged ?
  11. How is stack memory deallocated LIFO or FIFO ?
  12. How are primitive and objects stored in memory?
  13. Can primitive data types be stored in heap ?
  14. Explain value types and reference types ?
  15. Explain byval and byref ?
  16. Differentiate between copy byvalue and copy byref ?
  17. What is boxing and unboxing ?
  18. What is consequence of boxing and unboxing ?
  19. Can we avoid boxing and unboxing ?
  20. What effect does boxing and unboxing have on performance ?
  21. Are string allocated on stack or heap ?
  22. How many stack and heaps are created for an application ?
  23. How are stack and heap memory deallocated ?
  24. Who clears the heap memory ?
  25. Where is structure allocated Stack or Heap ?
  26. Are structures copy byval or copy byref ?
  27. Can structures get created on Heap ?

Questions on Garbage collectors

  1. Explain Garbage collector (GC)?
  2. How does Garbage collector know when to clean the objects ?
  3. Is there a way we can see this Heap memory ?
  4. Does Garbage collector clean primitive types ?
  5. Managed vs UnManaged code/objects/resources?
  6. Can garbage collector clean unmanaged code ?
  7. Explain Generations  ?
  8. What is GC0,GC1, and  GC2 ?
  9. Why do we need Generations ?
  10. Which is the best place to clean unmanaged objects ?
  11. How does GC behave when we have a destructor ?
  12. What do you think about empty destructor ?
  13. Explain the Dispose Pattern?
  14. Finalize vs Destructor ?
  15. What is the use of using keyword ?
  16. Can you force Garbage collector ?
  17. Is it a good practice to force GC ?
  18. How can we detect a memory issues ?
  19. How can we know the exact source of memory issues ?
  20. What is a memory leak ?
  21. Can .NET Application have memory leak as we have GC?
  22. How to detect memory leaks in .NET applications ?
  23. Explain weak and strong references ?
  24. When will you use weak references ?

Questions on Deletegates and Events

  1. What is a delegate and How to create a delegate ?
  2. Where have you used delegates ?
  3. What is a Multicast delegates ?
  4. What is a Event ?
  5. How to create a event ?

Questions on Design Principles

  1. What is SOLID ?
  2. What is the full form of SOLID ?
  3. What is the goal of SOLID ?
  4. Explain SRP with A example ?
  5. What is the benefit of SRP ?
  6. Explain OCP with a example ?
  7. What is the  benefit of OCP ?
  8. Can you explain LISKOV Principle and it’s violation?
  9. How can we fix LISKOV Problem ?
  10. Explain Interface Segregation Principle ?
  11. Is there a connection between LISKOV and ISP ?
  12. Define dependency inversion ?
  13. What is higher level module and lower level module ?
  14. How does dependency inversion benefit, show with an example ?
  15. Will only Dependency inversion solve decoupling problem ?
  16. Why do developers  move object creation outside high lever module ?
  17. Explain IOC ( Inversion of Control) ?
  18. Explain Dependency Injection with an example ?
  19. Is SOLID, IOC and DI design pattern or Principle?
  20. Is only SOLID Enough for good code/ architecture ?

You can contact us, if you require any assistance for understanding any C# or dotnet topic.