Sunday 27 January 2013

Inertview Questons in DOTNET

What Is CLR ?

CLR is Common Language Runtime is the runtime that converts a MSIL code into the host machine language code. It is the execution engine for .NET Framework applications. It provides a number of services, including:
What is CTS?   
CTS is Common Type System, which describes how types are declared, used and managed. CTS facilitate cross-language integration, type safety, and high performance code execution.
What is CLS? 
CLS Is Common Language Specification, is a specification that defines the rules to support language integration. This is done in such a way, that programs written in any language (.NET compliant) can interoperate with one another. This also can take full advantage of inheritance, polymorphism, exceptions, and other features. It was always a dream of Microsoft to unite all different languages in to one umbrella and CLS is one-step towards that.
What is an Intermediate Language?
(IL) Intermediate Language Or (CIL) Common Intermediate Language Or (MSIL) Microsoft Intermediate Language, is one of the Core component of the .NET Framework. Any .NET source codes written in any .net supportive language (C#,VB.net etc), when compiled are converted to MSIL. This MSIL, when installed or at the Runtime, gets converted to machine code. The Runtime conversion of MSIL code to the machine code is handled by a component called as the Just In Time (JIT) Complier.
What is Just In Time Compiler?
It is a compiler which converts MS IL (Microsoft Intermediate Language) code to Native Code (i.e. CPU-specific code that runs on the same computer architecture). Just-In-Time compiler- it converts the language that you write in .Net into machine language that a computer can understand. 
There are 3 types of JITs
Pre-JIT compiler
       Compiles entire code into native code completely in a single Operation
Econo JIT compiler

      Compiles only methods(Code) called at Runtime
Normal JIT compiler
      Compiles only that part of code called at Runtime and places in cache
 What is Managed Code? 
Managed code runs inside the environment of CLR i.e. .NET runtime. In short, all IL are managed code. However, if you are using some third party software example VB6 or VC++ component they are unmanaged code, as .NET runtime (CLR) does not have control over the source code execution of these languages.
A runtime-aware compiler compiles the IL into native executable code within a managed execution environment that ensures type safety, array bound and index checking, exception handling, and garbage collection. Also, many unproductive programming tasks are automatically taken care of, such as type safety checking, memory management, and destruction of unneeded objects. You can therefore focus on the business logic of your applications and write them using fewer lines of code. The result is shorter development time and more secure and stable applications.
 What is UnManaged Code?
Unmanaged code is defined as 
>CLR cannot understand the code
>CLR cannot instruct the code a
>second time compilation is unmanaged code and it is understand only by the machine