7 Essential Csharp Interview Questions

7 Essential Csharp Interview Questions

7 Essential C# Interview Questions


There are a lot of variables on the basis of which constants and read-only can be differentiated. Constant variables are stated and initiated at the compile time. The value cannot be changed afterwards. The use of a read-only can only be done when the individuals want to assign the value at the operating time. The read-only commands can only be used to build a read-only field or many read-only fields. On the other hand, the constant keyword is used to build numerous constant fields. The value of read-only can be changed after the declaration, but the value of constants cannot be changed even after declaration.


How can you define an interface class?

An interface can be defined as a particular abstract class that make use of public abstract concepts or methods. The methods used in the interface only feature the declaration keeping the definition part apart. This is the reason due to which it proves to be more helpful. The following abstract methods need to be executed in the inherited class. In simple words, the interface can be defined as a cluster of numerous abstract methods in Javascript Online Training.


What are reference types and value types?

Reference types and value types are two completely different things. They are useful in their own ways.

The work of value type is to hold a particular data value within its own memory space. The value shown in value types is the actual value that needs to be represented. The following includes Boolean integers, flow-type integers, integer number, lists and many more. 

On the other hand, the reference type can be defined in some other way. The value of the reference type is actually a reference to another value. This is what makes it different from value types. The following makes use of reference pointers. The work of reference type is to store the address of the objects where the value of the object is being stored. The following acts as a pointer to some other memory location.


How can you define custom control and user control?

Custom controls are actually those kinds of controls that are generated as compiled code, namely DIIs. The following are actually easy to use and can be added to the toolbox. The developers can drop by dragging the controls to their web forms. Attributes can be added to the following during the time of designing. It is very easy to add custom controls to web forms and to numerous applications if the DIIs are shared. If the following is private, the DII can be copied to the bin directory of applications and then can be added to the following before using.

On the other hand, user controls are quite similar to the include files of ASP. They are very easy to build. The issue with the user controls is that they can never be dragged and placed in a toolbox. They can neither be dropped. User controls have their design and code left behind. The file extension for user controls is known as ascx.


How can method overloading be defined?

Method overloading means the creation or building of numerous methods by making use of the same name using unique signatures in the same class. When the following is compiled, the compiler makes use of overload resolution in order to determine the specific method which is to be invoked.

How can you distinguish Array and Arraylist?

There are certain points on the basis of which array and Arraylist can be differentiated.

In an array, it is possible to have items of similar type only. Elements of different types cannot be placed in an Array. The size of the Array can be fixed when the following is compared.

An ArrayList is somewhat similar to an array, but the only problem with the following is that it doesn’t have a fixed size. The following gives rise to a few problems while storing particular data in JavaScript.


Can you override a private virtual method?

It is not possible for individuals to override a private virtual method. The individuals might face problems while carrying out the following. The following can’t be overridden because it is not possible to access the private virtual method once you move out of the class.