Here are the list of interview questions asked in .Net technologies.
Let's categorize it:
OOPs Concepts
What is difference between abstractions and encapsulation ?
How do we achieve encapsulation in c# ?
What is difference between abstract class & interface?
Can an abstract class has a constructor ?
What is the need of constructor in abstract class?
Can you create an instance of an abstract class?
Where did you create abstract class in your last project and why?
How many abstract classes have you created in your project?
What are the advantages and disadvantages of abstract classes?
What is method overloading and method overriding or what is polymorphism ?
what is the use of override & new key words over method implementation?
When you create a class how do you find which methods should be override ?
How do you find your base classes; give an example from your latest project?
What is a constructor ?
what is the use of private constructors?
what is the use static constructor ?
suppose you have a class X and it's inherited by class Y and you create the instance of class Y both X and Y have their own constructors. Which class's constructor will call first?
continue with X and Y we have same method named abc() in both classes which returns string "I am X" and "I am Y" respectively. and now you create the object of class by referencing class X what would be the abc return ? See below code
public class X{
public X()
{
}
public string abc(){return "Hi, I am X";}
}
public class Y{
public Y()
{
public new string abc(){return "Hi, I am Y";}
}
}
Public class Main(){
public static void main()
{
X y = new Y();
console.WriteLine(y.abc());
}
}
what would you do to get child class method's value?
How do you achieve multiple inheritance in c#?
Why does c# not support multiple inheritance with class type? What is the diamond problem?
What are the static classes ? why we need static class?
Does static class has get initiated ?
Can you write non-static methods with in a static class?
How do you prevent a class to not get inherited or what is the purpose of sealed class?
Why we need sealed key word when we have private constructor ?
Why we use static classes how many static classes do you created in your project and why ?
What design pattern have you used in project ?
what is singleton pattern where we need to use singleton pattern?
Advantages and disadvantages of singleton pattern ?
What is repository pattern and unit of work & advantages and disadvantages of repository pattern?
what is factory pattern ? advantages and disadvantages of factory pattern?
What is SOLID principles ?
What is Dependency injection & inversion of controls ?
What framework you use to implement DI and how to implement that?
0 Comment(s)