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:-
- Explain difference between .NET and C# ?
- .NET Framework vs .NET Core vs .NET 5.0
- What is IL ( Intermediate Language) Code ?
- What is the use of JIT ( Just in time compiler) ?
- Is it possible to view IL code ?
- What is the benefit of compiling in to IL code ?
- Does .NET support multiple programming languages ?
- What is CLR ( Common Language Runtime) ?
- What is managed and unmanaged code ?
- Explain the importance of Garbage collector ?
- Can garbage collector claim unmanaged objects ?
- What is the importance of CTS ?
- Explain CLS ?
- What are Value types & Reference types?
- Explain casting, implicit casting and explicit casting ?
- What can happen during explicit casting ?
- Differentiate between Array and ArrayList ?
- Whose performance is better array or arraylist ?
- What are generic collections ?
- What are threads (Multithreading)?
- How are threads different from TPL ?
- How do we handle exceptions in C#(try/catch)?
- What is the need of finally?
- Why do we need the out keyword ?
Questions on OOPs concept
- Why do we need OOP ?
- What are the important pillars of OOPs ?
- What is a class and object ?
- Abstraction vs Encapsulation?
- Explain Inheritance ?
- Explain virtual keyword ?
- What is overriding ?
- Explain overloading ?
- Overloading vs Overriding ?
- What is polymorphism ?
- Can polymorphism work with out inheritance ?
- Explain static vs dynamic polymorphism ?
- Explain operator overloading ?
- Why do we need Abstract classes ?
- Are Abstract methods virtual ?
- Can we create a instance of Abstract classes ?
- Is it compulsory to implement Abstract methods ?
- Why simple base class replace Abstract class ?
- Explain interfaces and why do we need it ?
- Can we write logic in interface ?
- Can we define methods as private in interface ?
- If i want to change interface what’s the best practice ?
- Explain Multiple inheritance in Interface ?
- Explain Interface Segregation principle ?
- Can we create instance of interface ?
- Can we do Multiple inheritance with Abstract classes ?
- Difference between Abstract Class & Interfaces?
- Why do we need constructors ?
- In parent child which constructor fires first ?
- How are initializers executed ?
- How are static constructors executed in Parent child ?
- When does static constructor fires ?
- What is Shadowing?
- Explain method hiding?
- Shadowing vs Overriding ?
- When do we need Shadowing ?
- Explain Sealed Classes ?
- Can we create instance of sealed classes ?
- What are nested classes and when to use them ?
- Can Nested class access outer class variables ?
- Can we have public, protected access modifiers in nested class ?
- Explain Partial classes ?
- In What scenarios do we use partial classes ?
Questions on Advance C#
- What are the different types of “USING/HAS A” relationship ?
- What is a composition relationship ?
- Explain Aggregation ?
- Explain Association ?
- Differentiate between Composition vs Aggregation vs Association ?
- UML Symbols for Composition, Aggregation and Association
- Explain stack and Heap ?
- Where are stack and heap stored ?
- What goes on stack and what goes on heap ?
- How is the stack memory address arranged ?
- How is stack memory deallocated LIFO or FIFO ?
- How are primitive and objects stored in memory?
- Can primitive data types be stored in heap ?
- Explain value types and reference types ?
- Explain byval and byref ?
- Differentiate between copy byvalue and copy byref ?
- What is boxing and unboxing ?
- What is consequence of boxing and unboxing ?
- Can we avoid boxing and unboxing ?
- What effect does boxing and unboxing have on performance ?
- Are string allocated on stack or heap ?
- How many stack and heaps are created for an application ?
- How are stack and heap memory deallocated ?
- Who clears the heap memory ?
- Where is structure allocated Stack or Heap ?
- Are structures copy byval or copy byref ?
- Can structures get created on Heap ?
Questions on Garbage collectors
- Explain Garbage collector (GC)?
- How does Garbage collector know when to clean the objects ?
- Is there a way we can see this Heap memory ?
- Does Garbage collector clean primitive types ?
- Managed vs UnManaged code/objects/resources?
- Can garbage collector clean unmanaged code ?
- Explain Generations ?
- What is GC0,GC1, and GC2 ?
- Why do we need Generations ?
- Which is the best place to clean unmanaged objects ?
- How does GC behave when we have a destructor ?
- What do you think about empty destructor ?
- Explain the Dispose Pattern?
- Finalize vs Destructor ?
- What is the use of using keyword ?
- Can you force Garbage collector ?
- Is it a good practice to force GC ?
- How can we detect a memory issues ?
- How can we know the exact source of memory issues ?
- What is a memory leak ?
- Can .NET Application have memory leak as we have GC?
- How to detect memory leaks in .NET applications ?
- Explain weak and strong references ?
- When will you use weak references ?
Questions on Deletegates and Events
- What is a delegate and How to create a delegate ?
- Where have you used delegates ?
- What is a Multicast delegates ?
- What is a Event ?
- How to create a event ?
Questions on Design Principles
- What is SOLID ?
- What is the full form of SOLID ?
- What is the goal of SOLID ?
- Explain SRP with A example ?
- What is the benefit of SRP ?
- Explain OCP with a example ?
- What is the benefit of OCP ?
- Can you explain LISKOV Principle and it’s violation?
- How can we fix LISKOV Problem ?
- Explain Interface Segregation Principle ?
- Is there a connection between LISKOV and ISP ?
- Define dependency inversion ?
- What is higher level module and lower level module ?
- How does dependency inversion benefit, show with an example ?
- Will only Dependency inversion solve decoupling problem ?
- Why do developers move object creation outside high lever module ?
- Explain IOC ( Inversion of Control) ?
- Explain Dependency Injection with an example ?
- Is SOLID, IOC and DI design pattern or Principle?
- Is only SOLID Enough for good code/ architecture ?
You can contact us, if you require any assistance for understanding any C# or dotnet topic.