Dot Net Interview Questions – Set 07

What are MDI and SDI?

  • MDI( Multiple Document Interface): An MDI lets you open multiple windows, it will have one parent window and as many child windows. The components are shared from the parent window like menubar, toolbar, etc.
  • SDI( Single Document Interface): It opens each document in a separate window. Each window has its own components like menubar, toolbar, etc. Therefore it is not constrained to the parent window.

What is JIT?

JIT stands for Just In Time. It is a compiler in CLR responsible for the execution of .NET programs of different languages by converting them into machine code. It speeds up the code execution and supports multiple platforms.

What are the types of Polymorphism?

There are two types of Polymorphism:

i. Static or compile-time polymorphism

ii. Dynamic or runtime polymorphism

What is the session object?

A Session object stores information and variables about a user and retains it through the session.

Explain deferred execution vs. immediate execution in LINQ. Provide examples.

In LINQ, deferred execution simply means that the query is not executed at the time it is specified. Specifically, this is accomplished by assigning the query to a variable. When this is done, the query definition is stored in the variable but the query is not executed until the query variable is iterated over. For example:

DataContext productContext = new DataContext();

var productQuery = from product in productContext.Products
where product.Type == “SOAPS”
select product; // Query is NOT executed here

foreach (var product in productQuery) // Query executes HERE
{
Console.WriteLine(product.Name);
}
You can also force immediate execution of a query. This can be useful, for example, if the database is being updated frequently, and it is important in the logic of your program to ensure that the results you’re accessing are those returned at the point in your code where the query was specified. Immediate execution is often forced using a method such as Average, Sum, Count, List, ToList, or ToArray. For example:

DataContext productContext = new DataContext();

var productCountQuery = (from product in productContext.Products
where product.Type == “SOAPS”
select product).Count(); // Query executes HERE

What are the disadvantages of using session?

The disadvantages of using session are:

  • Performance overhead occurs in case of large number of users, because session data is stored in server memory.
  • Overhead involved in serializing and De-Serializing session Data. Because In case of StateServer and SQLServer session mode we need to serialize the object before store.

What are globalization and localization?

Globalization is designing and coding culture-neutral and language-neutral applications. Localization is customizing the application and translating the UI based on specific cultures and regions.

What are the basic requirements for connection pooling?

The following two requirements must be fulfilled for connection pooling:

  • There must be multiple processes to share the same connection describing the same parameters and security settings.
  • The connection string must be identical.

What is Serialization?

Serialization is the process of converting the state of an object into a form (a stream of bytes) to be persisted or transported. Deserialization converts a stream into an object and is the opposite of serialization. These processes allow data to be stored and transferred.

Explain CLS.

Common language specification helps the developers to use the components that are inter-language compatible with certain rules that come with CLS. It then helps in reusing the code in other .NET compatible languages.