Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

In this blog we will discuss about important c# interview questions and answers which are asked to .NET developers.
Browse by Tags · View All
CLR interview questions 4
IL code interview questions with answers 4
.NET interview questions with answers 4
c# interview questions with answers 4
FizzBuzz interview questions with answers 1
c# interview questions with answers for FizzBuzz 1

Archive · View All
May 2013 4
July 2013 1

c# interview question and answers blog.

8 important C# Interview questions on IL code, JIT, CLR, CTS, CLS and CAS

May 14 2013 12:00AM by shivkoirala   

Introduction

 This article will revise 6 important c#/.NET interview questions around concepts like IL code, just in time compiler, common type system; common language specification, code access security and common language run time. Now many .NET developers would frown at the article saying this is basic and simple.

 But what I have seen is as you climb up the ladder you get engrossed in to projects, production issues, or you start doing too many non-technical activities and you start forgetting fundamentals.  It’s not that you do not know, you have just forgotten. And if you are not able to answer questions around these topics how much ever senior you are, it sends a very bad message to the interviewer.

 

What is IL code?


IL code is a partially compiled code.

Why it is partially compiled and why not full compiled?

When a compiler compiles a code he takes in to consideration things like operating system version, hardware etc and then compiles a optimized code as per those environmental data.

Now let’s say your compiler has compiled an optimized code as per “Windows 98” operating system. Now this code when run on windows server will not probably run in a optimized manner.

So what .NET does it only compiles the code partially. Later when the code runs the compiler kicks off, detects the environment and does a fully optimized code compiler as per that operating system and hardware.

So every time compiling on the fly can lead to performance issues?

Once the code is compiled it’s maintained in cache. So the performance hit is only for the first time when .NET application runs.

Who compiles IL code?

JIT (Just in time compiler) compiles the IL code to a fully compiled format.

Can we see  IL code?

Yes, we can see the IL code by using the ILDASM tool.

What is use of CTS?


In .NET there are lots of languages like C#, VB.NET, VF.NET etc.  There can be situations when we want code of one language to be called in other language. In order to ensure smooth communication between these languages the most important thing is data type compatibility. CTS (Common types system) ensures that data types defined in two different languages get compiled to a common data type.

So “Integer” data type in VB6 and “int” data type in C++ will be converted to System.int32, which is data type of CTS.

                        

What is the use of CLS ?

 CLS is a subset of CTS. CLS is a specification or set of rules or guidelines. When any .NET  code adheres to these set of rules it can be consumed by any .NET language.

For instance let’s say you have a c# class which has two variables defined “I” and “i”. In other words one variable is in capital and the other is in small.

 

Now this is perfectly valid in c# , but if this class is consumed in VB.NET it will go for a toss. Because VB.NET is not case sensitive and will not know which “I /i” variable to choose. So if you want this c# code to be consumed in VB.NET you need to define variable with two different names. This is one of the rules of CLS, that you should not have variable with same name with case sensitive.

So in this way we have number of CLS rules which if followed will ensure that your code can be consumed in any .NET compatible language.

What is CAS?

CAS is the part of .NET security model which determines whether or not a particular code is allowed to run and what kind of resources can the code access.

What is CLR ?

CLR (Common language run time) is the heart of.NET framework and it does 4 primary important things:-

· Garbage collection

· CAS (Code Access security)

· CV (Code verification)

· IL to Native translation.

I have created this nice video here which talks about what kind of questions are asked in c# interviewshttp://www.youtube.com/watch?v=3PXspVcSSKE

You can also visit my site c# and .NET interview questions where  i have created range of videos on various topics of c# from interview preparation aspect.

Tags: c# interview questions with answers,.NET interview questions with answers,IL code interview questions with answers,CLR interview questions


shivkoirala
476 · 0% · 82
2
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"8 important C# Interview questions on IL code, JIT, CLR, CTS, CLS and CAS" rated 5 out of 5 by 2 readers
8 important C# Interview questions on IL code, JIT, CLR, CTS, CLS and CAS , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]