Best Online Tutorials

SQL Tutorial

Free SQL Tutorial

SQL Interview Questions

SQL Practice Questions

SQL Tips & Tricks

SQL Errors

SQL Books

Angular Tutorial

Free Angular Tutorial

Angular Interview Questions

Angular Practice Questions

Angular Tips & Tricks

Angular Errors

Angular Books

Node.js Tutorial

Free Node.js Tutorial

Node.js Interview Questions

Node.js Practice Questions

Node.js Tips & Tricks

Node.js Errors

Node.js Books

React.js Tutorial

Free React.js Tutorial

React.js Interview Questions

React.js Practice Questions

React.js Tips & Tricks

React.js Errors

React.js Books

SSIS Tutorial

Free SSIS Tutorial

SSIS Interview Questions

SSIS Practice Questions

SSIS Tips & Tricks

SSIS Errors

SSIS Books

SEO Tutorial

Free SEO Tutorial

SEO Interview Questions

SEO Practice Questions

SEO Tips & Tricks

SEO Errors

SEO Books

Javascript Tutorial

Free Javascript Tutorial

Javascript Interview Questions

Javascript Practice Questions

Javascript Tips & Tricks

Javascript Errors

Javascript Books

MongoDB Tutorial

Free MongoDB Tutorial

MongoDB Interview Questions

MongoDB Practice Questions

MongoDB Tips & Tricks

MongoDB Errors

MongoDB Books

Next.js Tutorial

Free Next.js Tutorial

Next.js Interview Questions

Next.js Practice Questions

Next.js Tips & Tricks

Next.js Errors

Next.js Books

Asp.Net framework Interview Questions - Part 1 

Prashant Surya  |   Mar 2, 2020  |  Views: 130


Read ASP.NET (Dot Net) framework interview questions and answers for beginners and experienced on DritalConnect

1.  What is an IL code?

IL (Intermediate Language )code is a CPU independent partially compiled code.

2.  Why IL code is not fully Compiled?

As we don't have idea what kind of environment .NET code will run. We don't know what can be the end operating system,CPU configuration, machine configuration, security configuration etc.

So the IL code is half compiled and on run-time this code is compiled into machine specific code using the environment properties (CPU,OS,machine configuration etc.)

3.  Who compiles the IL code and how does it works?

IL code is compiled by the JIT (Just in time) compiler.

4.  How does JIT compilation work ?

JIT Compiles the code just before execution and then saves this translation in memory.

Just before execution JIT can compile, per-file ,per function or a code fragment.

5.   What are different types of JIT ?

In Microsoft .NET framework there are 3 types of JIT compilers:

Normal-JIT (Default): This type of JIT compiler compiles only those methods that are called at run time.

These methods are compiled the first time they are called, and then they are stored in the cache.

When the same method are called again, the compiled code from cache is used for execution.

Econo-JIT:  This type of JIT compiler compiles only those methods that are called at run-time.

But these compiled methods are not saved into cache so that RAM memory can be utilized in an optional manner.

Pre-JIT:  Pre-JIT compiles complete source code into native code in a single compilation cycle. 

This is done at the time of deployment of the application.

We can implement Pre-JIT by using ngen.exe.

Normal JIT is the default compiler implemented in the .Net framework.

It produces the optimized code. Econo-JIT just replaces IL instruction with native counterpart.

It doesn't do any kind of optimization. Econo-JIT doesn't store the compiled code in cache so it requires less memory comparatively.

The choice of Normal-JIT and Econo-JIT is being decided internally. Econo-JIT is chosen when devices have limitation of memory and CPU cycle issues like windows CE powered device.

When there is no memory crunch and CPU power is higher than Normal-JIT is used.

Pre-JIT is implemented by using ngen.exe. 

6.  What is Native Image Generator (Ngen.exe) ?

Ngen stores full compiled .Net code into cache.

Rather than dynamically compiling the code on run-time a full image of native code is stored in cache while installing the application. 

This leads to better performance as the assembly loads and execute faster.

In order to Install full compiled native code in cache we can execute the below command line from visual studio command prompt.

ngenx.exe install <assemblyname>

7.  So does it mean that ngen.exe will always improve performance?

No it's not always necessary that ngen.exe produces optimized code because it uses the current environments parameters which can change over a period of time. 

For instance a code compiled in windows XP environment will not be the optimized code to run under windows 2008 server. 

So we need to once test with ngen and without ngen to conclude if really the performance differs.

8.  What is a CLR?

CLR - Common Language Runtime

It is the heart of .Net framework and it does 4 primary important things:
  • Garbage collection:
  • CAS - Code Access Memmory
  • CV -  Code Verification
  • IL to Native translation

9.  What is the difference between managed and unmanaged code?

Code that executes under CLR execution environment is called as managed code. Unmanaged code executes outside CLR boundary. Unmanaged code is nothing but code written in C++, vB6, VC++ etc.

Unmanaged code codes have their own environment in which the code runs and it's completely outside the control of CLR.

10.  What is garbage collector?

Garbage collector is a feature of CLR which does the cleaning of the unused managed objects and reclaims memory.It does not clean unmanaged objects.

It's a background thread which runs continuously and at a specific intervals it checks if there are any unused objects whose memory can be claimed.

Content Contributor
Prashant Surya

Prashant Surya

Software developer at Uniserve Data Technologies Pvt. Ltd.  |   Noida, Uttar Pradesh, India

I am a software developer, freelancer and trainer working on technologies likes. MEAN stack, MERN Stack, ASP.NET full stack , SQL, JavaScript, jQuery, HTML, CSS, SEO, responsive UI/UX designing... having 7 years of experience in development in multiple domains like, eCommerce, capital markets, education, real estate...

Want to sell your software ?-

If you want to sell your readymade software to the genuine clients or businessman, list your software with details and demo links.

  • Sell ERP
  • Sell Website Clones
  • Sell App Clones
  • Sell Readymade Portals
  • Sell Readymade Websites
  • Sell Mobile Apps
  • Sell Window Apps

Clients will find it using our advanced search filter and will contact you directly.

No any charge for the product lsiting.

Do you own a Company ?+

Buy or Sell Commercial Property+

Are you a freelancer ?+

Looking for a job ?+

Are you a Service Provider ?+

Are you a blogger ?+

Do you own an IT Institute ?+