Skip to main content

Common DotNet And C# Interview Questions (IL, CLR, JIT, Ngen)

          Feeling worried or hesitant with your first interview at a software house? Worried if you might not be able to ans questions asked by the interviewer? Worry no more. In this article I'll be covering some of the questions asks by the interviewers about C# and .Net. Lets start straight away with the questions.

          Question 1: One of the most common question asked is what is IL? And the common answer given is It is intermediate language which is not quite the right answer. The answer given by you should be that Intermediate code is partially compiled or half compiled code.

          Question 2: After that answer, another questions comes right away is that Why is it half compiled? The subtle answer for this question is IL code is half compiled so compiler can be able to figure out the system, hardware and configs in order to give optimal code for that environment.

          Question 3: Who compiles this IL code? JIT (Just in time)  compiles the IL code.
                              -Per file (complete C# file)
                              -Per Method/Function 
                              -Per fragment

          Question 4: How does JIT compile the IL code? JIT compiles in 3 ways:
                              -Per file (complete C# file)

          Question 5: How many types of JIT are there? There are 3 types of JIT

                              Normal JIT: It is a Dynamic compilation and compilations is done on demand                                     bases. Compiled code is stored in Cache, Ram.

                              Econo JIT: It is a Dynamic compilation and compilations is done on demand                                       bases. Same as Normal JIT but Compiled code is not stored in Cache, Ram.                                           Better for smartphones with low memory.

                              Pre-JIT: It is not a dynamic compilation. It can be done by running Ngen.exe. It                                 will compile all the .net code in machine language. 

          Question 6: Where is Ngen located? Ngen resides in framework directory.

          Question 7: How can we force the compiler to use which JIT? You cant force, it is done 
                               internally. Econo JIT is used when less memory is available.
                               If memory is available, it will use normal JIT.

         These were some of the questions that are usually asked by the interviewer. Now you are able to answers these questions without a problem!











Comments

Popular posts from this blog

How to create Animation in Blend for Visual Studio: Intro Tutorial

          In this tutorial we will learn to make a very simple animation. We shall make a ball and make it bounce like it should naturally. Now it is a very basic level tutorial and if you're coming form any experience this might be slow learning curve for you. For these kind of animations a user have to write a long piece of code and a complex one too. Blend makes it easy for us to make simple animations by just drag n drop tools. I'm using Blend for VC 2015.           Firstly we'll create a Blank Universal Windows App. Name it what you would like to.           The following page will be open with Designer up front for with Photoshop like toolbar on your left. Behind the toolbar you will have the options like Assets, Stats etc.           Now you need to right click on the Triangle button from the toolbox on your left and select Ellipse. Now you can draw it on your screen. Give it any color you want from the Brush tab under properties on your right.       

How To Make Your First UWP Application - Simple Calculator Tutorial

          In this tutorial we will learn how to use some of the very basic features of Visual Studio and create a UWP(Universal Windows Platform) application.  Windows 10 introduces the Universal Windows Platform (UWP), which further evolves the Windows Runtime model and brings it into the Windows 10 unified core. As part of the core, the UWP now provides a common app platform available on every device that runs Windows 10. By the end of this tutorial you will have basic knowledge about how to create a simple UWP application and how to drag and drop objects in order to make UI and also how to edit their internal code.           Firstly we'll start with simply opening with the Visual Studio 2015. On the left side you will be able to see following options.            From this menu you need to click on the "New Project.." option. A dialog box will be shown and then you will choose C# and extend the tree then you will select Universal. From the Universal option, you

How to connect SQL Database to your Web Form (Tutorial)

          In this tutorial we will see how to connect SQL Database to our WebForm page created in Visual Studio 2015. You will need SQL Server 2014 which you can download from  here . The tutorial will include how to make a simple webform page and add textbox and buttons to it. And then apply database to it with CRED operations but we will only be checking insertion.           Now open Visual Studio and create a ASP.NET Web App in WEB section. Add a new web form to your project. If you do not know this previously you can follow my previous tutorial,  How to create a beginner web form . Now what we want a is a view like this.           Now in order to do that, we will select Split view from the bottom on Visual Studio. Now you also able to see the code section behind your webform. You can see the textbox ID and the Button ID. We will use these Ids in order to receive data from the fields.            For textboxes to show text in the picture above, you add placeholder in textb