Q) What is .NET Framework?(This is the basic question asked in interview)

A) .NET Framework is the execution or run time environment of .NET programmes or applications.
.NET Framework is the core software of .Net
.NET Framework is free software that can be downloaded directly from Microsoft website

Q) What is IL(MSIL, CIL)?(Interviewer may also ask what is Intermediate Language)

A) IL(Intermediate language) is also known as MSIL(Microsoft Intermediate Language) or CIL(Common Intermediate language)
All .NET source code is compiled to IL. This IL is then converted to machine code at the point where the software is installed. Or at runtime by a Just in time (JIT) compiler

Q) What are the components of .NET framework?

A) .NET Framework can be broadly categorized into two components

  1. CLR which contains CLS, CTS, GC, JIT
  2. Base Class Library(or also known as Framework class library)

Q) What is CLR in .NET Framework?(This is most important question your interviewer may ask)

A) CLR stands for Common Language Runtime. It forms the heart of the .NET framework. All languages have runtime and its the responsibility of runtime to take of code execution of the program.(Note: You can also give detail description to interviewer by adding below responsibilities of CLR)

Q) What are main responsibilities of CLR?

A) CLR has responsibilities like
1.Garbage Collection
2.Code Access Security
3.Code verification
4.IL to native translations and optimizations

Q) What is CTS?

A) CTS stands for Common Type System. In order that any two languages communicate smoothly CLR has CTS.
Example: In VB we have “Integer” and in C++ “Int”. These datatypes are not compatible so interfacing between them is very complicated. Hence “Integer” datatype in VB and int in C++ will convert it to System.int32 which is a type of CTS.

Q) What is CLS?

A) CLS stands for Common Language specification. This is a subset of CTS which all .NET languages are expected to support. Microsoft has defined CLS as nothing but the guidelines to follow so that it can communicate with other .NET languages.

Q) What is Managed Code?(A default question interviewer may ask to check your familiarity with CLR)

A) Managed code runs inside the environment of CLR i.e., .NET runtime. In short all IL are managed code.

Q) What is Assembly?

A) Assembly is a unit of deployment like exe or dll.
An assembly consists of one or more files(dll’s, exe’s, html files, etc) and represents a group of resources, type definitions and implementation of those types.

Note: An assembly may also contain reference to other assemblies.

Q) What are the types of Assemblies?

A) There are two types of assemblies: Private and Public Assembly
Private Assembly: It is normally used by a single application and is stored in applications directory

Public Assembly: Public assembly also known as shared assembly is normally stored in Global assembly cache which is a repository of assemblies maintained by the .NET runtime.

Q) What is Namespace?

A) Namespaces logically group types.
In Object oriented world many times it is possible that programmers will use the same class name. By qualifying namespace with class name this collision can be avoided.

Q) What is the difference between Namespace and Assembly?(Make sure you use below definition in interview)

A) Assembly is physical grouping of logical units whereas namespace logically groups classes.
Namespaces can span multiple assemblies

Q) What is GAC in .NET Framework?(This question again can be considered as default in any Interview)

A) GAC stands for Global Assembly Cache. It is used where shared .NET assembly reside. GAC is used in following situations.

  1. If the application has to be shared among several applications.
  2. If the assembly has some special security requirements like only administrators can remove the assembly. If the assembly is private then a simple delete of assembly file will remove the assembly.

Q) What is Garbage Collection in .NET Framework?(An Important question again)

A)Garbage collection is a CLR feature which automatically manages memory. Programmers forget to release the objects while coding.
CLR automatically releases objects when they are no longer in use and referenced.
System.GC.Collect() forces GC to run. This is not recommended but can be used if situation arises.

Q) What is Reflection?(If you are more than 3 years of experience then you can expect this question in interview)

A)All .NET assemblies have metadata information stored about the types defined in modules. This metadata can be accessed by mechanism called Reflection.

Q) What are value types and reference types?

A) Value types directly contain their data which are either allocated on the stack or allocated in-line in a structure.
Reference type store a reference to the values memory address and are allocated on the heap.

Q) What is Boxing and UnBoxing?

A) Boxing is the process of converting value type to reference type and Unboxing is the vice versa of boxing operations.

int x=10;//Boxing
object y=x;//Unboxing