Interview Questions Related To ASP.NET, SQL, AJAX And JQuery

Introduction

In this article, we will discuss some of the interview questions and will try to answer those. This article is for helping the fresher developers who are trying to crack their interview. I will not explain the whole concept here but will try to answer the main concept of each question. So, this article is just to polish your answers but it will not give you the deep insight of the concepts. For that, you can search each concept on C# Corner. So, let's start.
 
Question 1 - What is default Access Modifier of Class in C#.NET?

Ans - Default Access Modifier of class in C#.NET is Internal that hides all its members, variables, and function details from other classes and objects that come under a different namespace. Internal member can be accessed from anywhere within the same assembly, within the same project.
 
Question 2 - What do you mean by Access Modifier?

Ans - Access modifier means the accessibility of class, class members, and function. We use some keywords to define the scope of class and its members, like Public, Protected, Private, Internal, ProtectedInternal. 
 
Question 3 - What is Sealed class?

Ans - We use Sealed keyword with the class when we want that the class shouldn't be inherited by another class.
 
Question 4 - If the Sealed classes prevent inheriting the class, then what is the use of Static Class?
Ans Static classes implicitly are Sealed classes which also can't be inherited. But, there is some difference between Sealed and Static Class. For Example, 1) We cannot create the object of Static class but we can create object of Sealed Class; and, 2) Static class cannot inherit the features of other class but Sealed class can.
 
Question 5 - Can we have Non-static methods within a Static Class?

Ans - No, we can have only Static methods and members with in a static class.
 
Question 6 - When we can't create the object of a Static class, then in what scenario we need to use Static Class?

Ans - We create a static class for Utility functions which we use in our application often, for returning something by passing parameters into it. For example, creating a Math Class and some functions within it, like Add, Sub. When we want to use them, we will call it by class name and method name. For example, Math.Add(13,15). We don't need to create the object of the static class. So, it will save the memory because we don't need to create the object of the class. We call it directly through class name.
 
Question 7 - What is the difference between Primary Key and Unique Key? If both can provide uniqueness of record, then why don't we use Unique Key instead of Primary Key?
Ans-
  1. We can have only one Primary Key within a table but we can have multiple Unique Keys within a table.
  2. Primary Key doesn't allow null value whereas Unique Key does allow null value but only one null value.
Now, the question is if Unique Key also provides uniqueness, then why we need Primary Key?

Primary key creates clustered index but Unique Key creates non-clustered index.
 
Question 8 - What is the use of writing code with Using keyword?

Ans - When you create an object and use it, then you need to clean it by calling the Dispose method. The Using statement simplifies the code and at last cleans the code by automatically calling the Dispose method.
 
Question 9 - What do you understand by State of web page?

Ans - Web pages are stateless, which means that they can't hold the data by themselves. So, in .NET, we have two kinds of State Management - Client Side and Server Side.
 
Question 10 - Can we use a name instead of $, in jQuery? If yes, How?
Ans - Yes we can. We have to write like this,
  1. var anil=$.noConflict();  
  2. anil(document).ready( function() {  
  3.   alert("Hello, how are you");  
  4.  }); 
That's it for now. I will come back with many other questions and will try to share as much as I can. Until then, work hard, party harder. 

Up Next
    Ebook Download
    View all
    Learn
    View all