Loading, please wait...

A to Z Full Forms and Acronyms

Interview questions for Asp.Net and .Net

Jun 24, 2021 ASP.net, 4148 Views
The objective of this article is to make a list of interview questions and answers. So, It can help those peoples who are preparing for an interview.

Q1.When should you use Abstract Class vs Interface while programming?

 Ans: When we want that subclass must implement all the methods of the base class. In such a situation we will implement the interface. On the other hand when we want only some method of base class in our subclass then use the base class as an abstract class.

Q2.What is the difference between constants, read-only and, static?

Ans:
Constants: The value can’t be changed

Read-only: The value will be initialized only once from the constructor of the class.

Static: Value can be initialized once.

Q3.What is a Partial class?

Ans: Instead of defining an entire class, you can split the definition into multiple classes by using a partial class keyword. When the application compiled, the c# compiler will group all the partial classes together and treat them as a single class. There are a couple of good reasons to use partial classes. Programmers can work on different parts of classes without needing to share the same physical file

Ex:

Public partial class employee
{
 Public void somefunction()
 {
 }
}

Public partial class employee
{
 Public void function ()
 {
 }
}

Q4.Declaration of authorization is

<authorization>
<allow users=”Sarthak, Uday”/>
<deny users=”Ram, ”>
</authorization>
Sometimes authorization allows the unauthorized persons at that time we will use
<deny users=”?”/>

Authentication means

Authentication is a process where we identify the credentials of user i.e. username, password and create an identity to mention users as authenticated.  

Q5 How to get the version of the assembly?

Ans: lbltxt.text=Assembly. GetExecutingAssembly().GetName().Version.ToString();

Q6 What is the location of Global Assembly Cache on the system?

Ans: c:\Windows\assembly

Q7 What is serialization?

Ans: Serialization is a process of converting an object into a stream of bites.

Q8 What is synchronization?

Ans: The mechanism needed to block one thread access to the data. If the data is being accessed by another thread.

Synchronization can be accessed by using system.monitor class

A monitor class methods are entered, exit, pulse for this lock statement is also used

Suppose if we need to synchronize some data at that time we need to place that data in this block

Lock
{
}

Whatever the data has been placed into the lock block that data has been blocked

Q9 What are the thread priority levels?

Ans: Thread priority levels are five types

        0 - Zero level

        1 - Below Normal

        2 - Normal

        3 - Above Normal

        4 - Highest

By default priority level is 2

Q10 What is the use of the business logic layer in 3-tier architecture in .net?

Ans: In spite of the fact that a site could converse with the information access layer straightforwardly, it generally experiences another layer called the business layer. The business layer is essential in that it approves the information conditions before calling a technique from the information layer. This guarantees the information info is right before continuing, and can regularly guarantee that the yields are right also. This approval of the information is called business rules, which means the principles that the business layer uses to make "decisions" about the information.

However, business rules don’t only apply to data validation; these rules apply to any calculations or any other action that takes place in the business layer. Normally, it’s best to put as much logic as possible in the business layer, which makes this logic reusable across applications.

One of the best reasons for reusing logic is that applications that start small usually grow in functionality. For instance, a company begins to develop a web site, and as they realize their business needs, they later decide to add a smart client application and windows service to supplement the web site. The business layer helps move logic to a central layer for “maximum reusability.”

 

Q11 What is the difference between .tostring(), Convert.tostring()?

Ans: The basic difference between them is the “Convert” function handles NULLS while“.ToString()” does not it will throw a NULL reference exception error. So as a good coding practice using “convert” is always safe.

Q12 What is Collation?

Ans: Collation refers to a set of rules that determine how the data is sorted and compared.

Q13 What is the difference between the Primary key and a unique key?

Ans: The primary key does not allow the null values but a unique key allows one null value. The primary key will create a clustered index on the column but the unique key will create a non-clustered index by default.

Q14 How many web.config files are there in 1 project?

Ans: There might be multiple web.config files for a single project depending on the hierarchy of folders inside the root folder of the project, so for each folder, we can use one web.config file

Q15 What is the static keyword in .Net?

Ans: Static is the same as a constant variable but we can change the value of the static variable and we can access the variables without creating any instances

Q16 What is the difference between the view state and the hidden field?

Ans: ViewState is secured hidden field is insecure

Viewstate will store a large amount of data but hidden filed will store a small amount of data. 

Q17 What is the difference between read-only and constant variables?

Ans: Read-only can assign the values at runtime only. Constant will assign the values at compile time only. We cannot modify both variable values.

 

A to Z Full Forms and Acronyms

Related Article