Dot Net Interview Questions – Set 06

Explain the difference between the Stack and the Heap.

in the Stack are stored value types (types inherited from System.ValueType), and in the Heap are stored reference types (types inherited from System.Object).

We can say the Stack is responsible for keeping track of what is actually executing and where each executing thread is (each thread has its own Stack). The Heap, on the other hand, is responsible for keeping track of the data, or more precise objects.

What is Object-Role Modeling (ORM)?

Object-Role Modeling (ORM) is a powerful method for designing and querying information systems at the conceptual level. It is an easy and understandable description of the application for non-technical users.

How do you check whether a DataReader is closed or opened?

There is a property named “IsClosed” property is used to check whether a DataReader is closed or opened. This property returns a true value if a Data Reader is closed, otherwise a false value is returned.

What is Object Pooling?

Object Pooling is a concept for optimal use of limited resources through software constructs. The ready-to-use objects, connections, and threads are stored in a pool (group) of objects in memory for later use. For creating a new object, it is pulled from the pool and allocated for the request. Pooling helps in improving performance and facilitates scalability.

What are client-side and server-side validations in Web pages?

Client-side validations take place at the client end with the help of JavaScript and VBScript offering a better user experience. The inputs for client-side validation are validated in the user’s browser. While, server-side validations take place at the server end using ASP.Net and PHP, and the feedback is sent through a dynamically generated new webpage.

What is CLR?

CLR stands for common language run-time, it is an important component of the .NET framework. We can use CLR as a building block of various applications and provides a secure execution environment for applications.

Whenever an application written in C# is compiled, the code is converted into an intermediate language. After this, the code is targeted to CLR which then performs several operations like memory management, security checks, loading assemblies, and thread management.

Explain passport authentication.

During the passport authentication, it first checks the passport authentication cookie, if the cookie is not available the application redirects to the passport sign on page. Passport service then authenticates the details of the user on the sign on page and if they are valid, stores them on the client machine and then redirects the user to the requested page.

What is the difference between the While and For loop? Provide a .NET syntax for both loops.

The For loop provides a concise way of writing the loop structure, but the While loop is a control flow statement that allows repetitive execution of the code. Initialization, condition checking, iteration statements are written at the top of the For loop, but only initialization and condition checking is done at the top of the while loop.

Syntax:

  1. While loop:
  2. while(condtion) {
  3. //statements to excute.
  4. }
  5. For loop:
  6. for(intialization; condition; Increment or decrement)
  7. {
  8. // statements to be excuted.
  9. }

What is the .Net framework?

It is a platform for building various applications on windows. It has a list of inbuilt functionalities in the form of class, library, and APIs which are used to build, deploy and run web services and different applications. It supports different languages such as C#, VB .Net, Cobol, Perl, etc.

This framework supports the object-oriented programming model.

What is variable and constant in .NET programming language?

Variable: A variable is a data storage location in the computer memory that contains a value and has a meaningful name. Every variable is attached to a data type which determines what type of value can be stored in the variable.

Variables can be declared by using the following syntax:

;
Constant: Constant is also similar to the variable except that the value. Value once assigned to a constant can’t be changed. Constants must be initialized at the same time they are declared.

Constants can be declared by using the following syntax:

const int interestRate =10;