Whenever I go into a technical interview, invariably I get asked one or more technical questions about the C# language itself so I thought I would share some of these with all of my readers in the event they also encounter these questions on their own interviews:
- What is an abstract class? - Quite simply an abstract class is different from a base class in that it cannot be directly instantiated. It is basically a combination of an interface and a base class in that you can have some implementation details while also leaving other implementation details out so that it can be implemented in the subclass. https://msdn.microsoft.com/en-us/library/ms173150.aspx
- What is a sealed class? A sealed class is a class which simply CANNOT be inherited. It basically locks down the class for main usages in OOP scenarios. https://msdn.microsoft.com/en-us/library/ms173150.aspx
- What are the access modifiers for C#? public, private, protected and internal. https://msdn.microsoft.com/en-us/library/ms173121.aspx
- What is a virtual method/property in C#? A virtual method/property is a method or property which can be overridden in a derived class. This is frequently used in applications that leverage Entity Framework so that property values can be overridden in a separate class from the originally generated Entity Framework POCO (Plain Old CLR Object) classes. https://msdn.microsoft.com/en-us/library/9fkccyh4.aspx
- Does C# support multiple inheritance? No, just like Java, C# can only inherit from a single class. Also, just like Java, you can implement as many interfaces as you like. To get features similar to multiple inheritance, you can subclass as many times as you want though. https://msdn.microsoft.com/en-us/library/64hstbtx.aspx
- What is the difference between passing parameters by reference vs by value in C#? In the case of passing by reference, you are passing a pointer to the original object, while passing by value passes a copy of the object and therefore changes the copy rather than the original object. https://msdn.microsoft.com/en-us/library/0f66670z.aspx
- Passing Value-Type Parameters: https://msdn.microsoft.com/en-us/library/9t0za5es.aspx
- Passing Reference-Type Parameters: https://msdn.microsoft.com/en-us/library/s6938f28.aspx
- What is the difference between using IEnumerable vs IList? IEnumerable is a read-only collection meant for iteration while IList allows modifying the original collection as well.


















