Explain about JIT

In .Net framework we have just in time compiler present in Common Language Runtime which converts MSIL code into native code.

Different types of  Jit are:

  • Pre-Jit -Compiles complete source code into native code at the time of deployment
  • Ecno-Jit -Compiles the code associated with required item like loading form or button click etc
  • Normal Jit -Compiles the code required and stores in cache, whenever the same thing is required it loads from cache.
By default we have normal Jit in CLR. To use pre jit we make use ngen.exe. In theory it seems that Pre-Jit is useful but when you look at realty Jit compiles and generates native code specific to machine depending on the various properties of the run time environment ,so it is beneficial to go with normal jit.

what is MSIL

MSIL is Microsoft intermediate language. When we compile a program in .net, the source code is converted into an intermediate language called Microsoft Intermediate Language. At this point the code is partially compiled and it cannot be run on the operating system. When we run the application this partially compiled code is compiled to machine specific  by the Just In Time compiler present in Common Language Runtime using the operating system  environment properties like CPU,OS etc

difference between “IS” and “AS”

“IS” keyword can be used to check whether two variables are of same type.

Ex:
object obj=”narendra”;
object obj1=1234;

if(obj is string)
{
Console.WriteLine(“Success”);//this statement executes as obj is string
}

if(obj1 is string){
Console.WriteLine(“Success”);//this statement is not executed as obj1 is not string
}

“AS” keyword is used to convert variables from one type to another and if conversion is not successful then null is stored.

string str=obj as string;//here it succeeds and str has value of “narendra”

string str1=obj1 as string;// here it fails and str1 has null value

Explain about WPF?

WPF(Windows Presentation Foundation) is a graphical subsystem to display user interfaces. One should be wondering we have win forms for this then what is need for WPF. WPF has the following advantages over win forms.

Anywhere execution

We use XAML in wpf which makes it possible to use the same code for various types of applications like windows, web or silver light etc.

Binding

Binding objects is very easy in WPF. Without writing single code we can bind two objects.

Common Look and Feel

We can make use of styles and the same style is applied to our entire application as and when required.

Declarative Programming(XAML)

We describe abstractly what need to be done and visual studio will do the directive programming for us in the back end.

Express Blend and animation

WPF internally uses Directx, directx is used for animation, so WPF can do animation as well. Express Blend is a tool which is used to create animation and reuse it.

Fast Execution

WPF uses directx and supports software, partial, hardware rendering depending on requirement, whereas win forms uses software rendering only.

Graphic Independent

WPF uses DIP(device independent pixel) 1 dip =1/96 of an inch and it adjusts itself to any screen based on this .

What is Sharding?

Sharding can be considered as a horizontal partitioning in which a large database is partitioned into smaller, faster, more easily managed parts called data shards.


The basic idea is as the size of database and number of transactions increase linearly, the response time to query the database increases exponentially. And maintaining large database is also costly as it requires high-end computers. Contrast to this data shards can be distributed across a number of less expensive servers.