.Net Framework



1. Which of the following are parts of the .NET Framework?  

  • A) The Common Language Runtime (CLR)
  • B) The Framework Class Libraries (FCL)
  • C) Microsoft Published Web Services
  • D) Applications deployed on IIS
  • E) Mobile Applications


2. Which of the following .NET components can be used to remove unused references from the managed heap?  

  • A) Common Language Infrastructure
  • B) Common Language Runtime
  • C) Garbage Collector
  • D) CTS
  • E) Class Loader


3. CLR is the .NET equivalent of  

  • A) Java Virtual Machine
  • B) Common Type System
  • C) Compiler of C
  • D) None of these
  • E) All of these


4. All C# applications begin execution by calling the  

  • A) Main()
  • B) Submain()
  • C) Class()
  • D) Namespace
  • E) None of these



5. What is an IL?  

Intermediate Language is also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET source code is compiled to IL. IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In-Time (JIT) compiler.



6. Which method do you use to enforce garbage collection in .NET?  

The System.GC.Collect() method.



7. What is code access security (CAS)?  

Code access security (CAS) is part of the .NET security model that prevents unauthorized access of resources and operations, and restricts the code to perform particular tasks.



8. What is an IL?  

Intermediate Language is also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET source code is compiled to IL. IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In-Time (JIT) compiler.



9. What is Garbage Collection ?  

CLR automatically manages memory thus eliminating memory leaks. When objects are not referred, GC automatically releases those memories thus providing efficient memory management.


10. What is Framework ?  

Framework is special kind of libraries or structures that helps in building applications.



11. What is .Net Framework ?  

It is collection of libraries and API designed by microsoft which helps in building,deploying and running applications and services that use .net technologies.

In simple words a .net framwork is a combination of several diff technology like CLR,asp.net,garbage collection etc that helps in easing the process of software development.



12. Briefly explain how the code is compiled by the framework ?  

The .net code first is compiled into MSIL/IL i.e intermediate language which is machine independant. At this stage metadata is generated which contains the member signature.This code then gets compiled into machine specific language known as native language by JIT(just in time ) compiler.



13. What is JIT ?  

Just -In-Time compiler compiles the IL code to native code so that the machine can understand that language.JIT runs on demand when a method is called JIT analysis the IL and produces highly efficient code. So if the next time same piece of code i execitued then it runs and not compiled.JIT is specific to OS.



14. What is AOT ?  

Ahead-Of-Time compilation.the JIT runs just before the code execution hence it does not have enough time of optimize the code. hence cam AOT.It compiles the entire .net assembly into IL during application installation.



15. What is ngen.exe ?  

Native Image Generator.It compiles the entire assembly during installation. It creates native images that are nothing but files so that the next time compiles compiles it picks up these images instead of files from JIT.This helps in faster compilation.It can be used only if ngen is used for all the assembly in the application.



16. How MSIL helps in language interopability ?  

MSIL is machine independant language.no matter which language you use in .net all of then are converted into MSIL .thus helping diff language coexist with each other.



17. What is CLR?  

Common language runtime.it is the heart of .net framework and it takes care of code execution.It helps in running your program by acting as a translator between your program and the computer you are running it on.features of CLR -

a. Garbage Collection-helps in automatic memory management by disposing or the objects when they are not being referenced anymore.

b. IL to native code -CLR uses JIT compiler to convert MSIL to native code.

c. Code access security(CAS)-provides right to certain programs. eg if a piece of code is trying to delete a file for which it does not have permission, CLR prevents it from doing so.

d. Code verification-ensures type safety and prevents code from accessing invalid memory locations etc.



18. What is CTS ?  

Common type system ,defines set of data types that are common for all the languages in .net.eg-long in vb.net and int in c# both point to system.int32 in IL.



19. What is CLS ?  

Common language specification,defines rules that all the languages must follow in order to co-exist among each other.



20. What are languages supported in .Net ?  

it supports over 60 languages some of them are-c#,ada,C++, j#,Perl,VB,cobol etc.


Java Interview Question

.Net Interview Question

PHP Interview Question

AngularJS Interview Questions