10 December 2012

CSharp Interview Questions


1.
What is serialization?

Serialization is the process of converting an object into a stream of bytes.
De-serialization is the opposite process of creating an object from a stream of bytes.
Serialization / De-serialization is mostly used to transport objects.
2.
What are the difference between Structure and Class?

§  Structures are value type and Classes are reference type
§  Structures can not have contractors or destructors.
§  Classes can have both contractors and destructors.
§  Structures do not support Inheritance, while Classes support Inheritance.
3.
What is difference between Class And Interface?

Class : is logical representation of object. It is collection of data and related sub procedures with defination.
Interface : is also a class containg methods which is not having any definations.Class does not support multiple inheritance. But interface can support.
4.
What is Delegates?

Delegates are a type-safe, object-oriented implementation of function pointers and are used in many situations where a component needs to call back to the component that is using it.
5.
What is Authentication and Authorization?

Authentication is the process of identifying users. Authentication is identifying/validating the user against the credentials (username and password).
Authorization performs after authentication. Authorization is the process of granting access to those users based on identity. Authorization allowing access of specific resource to user.
  6.
What is boxing and unboxing?

Implicit conversion of value type to reference type of a variable is known as BOXING, for example integer to object type conversion.
Conversion of reference type variable back to value type is called as UnBoxing.
7.
What is object?

An object is an instance of a class. An object is created by using operator new. A class that creates an object in memory will contain the information about the values and behaviours (or methods) of that specific object.
8.
Where are the types of arrays in C#?

   Single-Dimensional
   Multidimensional
   Jagged arrays.