Abstract Class Interview Questions

Below are the Abstract Class Interview Questions for beginners and experienced developers for Interview Preparation. What is the need for abstract classes? Abstract classes allow partial implementations of a methods in a class Which is mostly used for an extension the sub class. Where parent class has default implementation and class specific implementation can be done in the child class. Abstract class promotes code reusability … Continue reading Abstract Class Interview Questions

Interface Interview Question in C#

Below are the interface interview questions in C# for beginners and experienced developers What is the use of interface? Interface mostly used for following reasons: Specifying contract Multiple inheritances Loosely coupled code Specifying contract – Interface is used to define a contract in the application, so that the other application should follow the contract in order to execution. In other words, we can say that … Continue reading Interface Interview Question in C#

Polymorphism Interview Questions

Below is the list of Polymorphism Interview Questions for interview preparations for beginners and experience professional What is Polymorphism in C#? Polymorphism is one of the main pillars of object-oriented programming (OOP), it allows the programmer to change the object behavior based on object creation or way the is being called. It also provides the facility to inject different features to the existing functionality or … Continue reading Polymorphism Interview Questions

Constructors Interview Questions

Why we need a constructor in object-oriented programming? The purpose of Constructor is to initialize the values of data members or to perform some logic when an instance of the class gets created. Yes, we can achieve this without constructor but for that, we need to make explicit calls and chances that someone might forget to call method to initialize the values before creating an … Continue reading Constructors Interview Questions

Lambda Expressions – Interview Question

Collection of typically Interview Questions on lambda expression for interview preparation. you can also read more about Lambda expression Alternatively, you can also test your knowledge by an online free quiz for a lambda expression. Interview Question: What is Lambda expression? Answer: Lambda Expressions are nameless functions given as constant values. They can appear anywhere that any other constant may, but are typically written as a … Continue reading Lambda Expressions – Interview Question

C# Anonymous methods Interview Question

Collection of typically Interview Questions on anonymous methods for interview preparation. you can also read more about anonymous methods. Alternatively, you can also test your knowledge by an online free quiz for anonymous methods. Interview Question: What is Anonymous method? Answer: Anonymous methods were introduced into C# 2 as a way of creating delegate instances without having to write a separate method. They can capture local … Continue reading C# Anonymous methods Interview Question

Generic Delegates (Action, Func, Predicate) – Interview Questions

Collection of typically Interview Questions on generic delegates for interview preparation. you can also read more about delegates, callbacks, Multicast Delegates, Generic Delegates. Alternatively, you can also test your knowledge by an online free quiz for delegates, multicast delegate, generic delegates. Interview Question: What are Generic Delegates in C#? Answer: The Func , Action and Predicate are the three generic delegates. We can make use of all these three predefined … Continue reading Generic Delegates (Action, Func, Predicate) – Interview Questions

Delegates Interview Questions

Collection of typically Interview Questions on delegates for interview preparation. you can also read more about delegates, callbacks, and Multicast Delegates. Alternatively, you can also test your knowledge by an online free quiz for delegates and multicast delegate. Interview question: What is a delegate? Answer: A delegate is a type-safe function pointer. Using delegates you can pass methods as parameters. To pass a method as … Continue reading Delegates Interview Questions

Multicast Delegates Interview Questions

Collection of typically Interview Questions on Multicast delegates for interview preparation. you can also read more about delegates, callbacks, Multicast Delegates, Generic Delegates. Alternatively, you can also test your knowledge by an online free quiz for delegates, multicast delegate, generic delegates. Interview Question: What is Multicast delegate/ chaining delegates? Answer: The capability of calling multiple methods on a single event is called as Multicast delegate or chaining delegates, Multicast delegates can be … Continue reading Multicast Delegates Interview Questions

Extension Methods

Introduction Extension Methods allow user to add additional feature or methods to existing class without creating a new derived type. Before diving into extension method, lets understand why we use extension method in c#? Example Suppose that there is a class with n number of methods, and you want to add more methods into it. you can add Extension methods using below two approach: You … Continue reading Extension Methods

Interview Questions: Multiple Catch Block in C#

Introduction In C#, You can use more than one catch block with the try block to handle different types of exceptions means each catch block is used to handle different types of exceptions. For example: Below example, we have added multiple catch block, so let say if the user has entered string value in first input then control will be passed to the FormatException catch … Continue reading Interview Questions: Multiple Catch Block in C#