Top Interview Questions that Software Engineer (.NET) Candidates Need to Know.
 What is .NET Framework?
Dot NET Framework is a complete environment that allows developers to develop, run, and deploy the following applications:
- Console applications
- Windows Forms applications
- Windows Presentation Foundation (WPF) applications
- Web applications (ASP.NET applications)
- Web services
- Windows services
- Service-oriented applications using Windows Communication Foundation (WCF)
- Workflow-enabled applications using Windows Workflow Foundation (WF)
 What is object-oriented programming (OOP)? Which languages are supported by .NET framework?
OOP is a technique to develop logical modules, such as classes that contain properties, methods, fields, and events. For example, an object is created in the program to represent a class. OOP allows developers to develop modular programs and assemble them as software.
.NET Framework supports only OOP languages, such as Visual Basic .NET, Visual C Sharp, and Visual C++.
 Describe the main components of .NET Framework.
Dot .NET Framework provides enormous advantages to software developers in comparison to the advantages provided by other platforms. The following are the key components of .NET Framework:
- .NET Framework Class Library
- Common Language Runtime
- Dynamic Language Runtimes (DLR)
- Application Domains
- Runtime Host
- Common Type System
- Metadata and Self-Describing Components
- Cross-Language Interoperability
- .NET Framework Security
- Side-by-Side Execution
 What is an IL?
Intermediate Language is also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET source code is compiled to IL. IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In-Time (JIT) compiler.
 What are the main roles of CLR in .NET Framework?
CLR provides common runtime environment for all .NET code irrespective of their programming language, as the compilers of respective language in .NET Framework converts every source code into a common language known as MSIL or IL (Intermediate Language).CLR performs various tasks to manage the execution process of .NET applications. The responsibilities of CLR are listed as follows:
- Automatic memory management
- Garbage Collection
- Code Access Security
- Code verification
- JIT compilation of .NET code
 What is the relationship between a class and an object?
A class defines the properties, states and behaviors that is common to a number of objects where an object is an instance of the class.
 Explain the basic features of OOPs.
The following are the four basic features of OOP:
- Abstraction – Refers to the process of exposing only the relevant and essential data to the users without showing unnecessary information.
- Polymorphism – Allows you to use an entity in multiple forms.
- Encapsulation – Prevents the data from unwanted access by binding of code and data in a single unit called object.
- Inheritance – Promotes the reusability of code and eliminates the use of redundant code.
 What is ASP.NET? What is the main difference between ASP and ASP.NET?
ASP.NET is Microsoft’s server-side technology for creating dynamic and user-friendly Web applications, Web sites and Web services. You can create ASP.NET applications in most of the .NET compatible languages, such as VB, C Sharp, and J Sharp. The ASP.NET compiles the Web pages and provides much better performance than scripting languages. The main difference between ASP and ASP.NET is that ASP is interpreted; whereas, ASP.NET is compiled.
 What is the concept of Postback in ASP.NET? How can we identify that the Page is Post Back?
A postback is a request sent from a client to the server from the same page where a user is already working. It’s basically posting a complete page back to server (i.e. sending all of its data) on the same page. So, the whole page is refreshed.
Page object has an “IsPostBack” property, which can be checked to know that is the page posted back.
 What is an assembly?
An assembly is one of the elements of a .NET application and is termed as a primary unit of all .NET applications. This assembly can be either a DLL or an executable file.
 How can we auto size a button to fit its text?
The button control has the AutoSize property, which can be set to true or false. If we set the value of the AutoSize property to true, then the button control automatically alters its size according to the content displayed on it.
 What is the difference between method overriding and method overloading?
Overriding involves the creation of two or more methods with the same name and same signature in different classes.
Overloading is a concept of using a method at different places with the same name and different signatures within the same class.
 What is constructor and why we use constructor?
Constructor is a special method of a class, which is called automatically when the instance of a class is created. It is created with the same name as the class and initializes all class members, whenever you access the class.The main features of a constructor are as follows:
- Constructors do not have any return type
- Constructors are always public
- It is not mandatory to declare a constructor; it is invoked automatically by .NET Framework
 What is a delegate and multicast delegates?
A delegate is similar to a class, used for storing the reference to a method and invoking that method at runtime, if required. Some of the examples of delegates are type-safe functions, pointers or callbacks.A delegate object is to hold references of and invoke multiple methods. Such delegate objects are called multicast delegates or combinable delegates.
 What is a namespace?
Namespace is considered as a container that contains a functionally related group of classes and other types.
 Can you declare a private class in a namespace?
The classes in a namespace are internal, by default. However, you can explicitly declare them as public only and not as private, protected, or protected internal.
 What is garbage collection?
Garbage collection prevents memory leaks during execution of programs. Garbage collection is a low-priority process that manages the allocation and de-allocation of memory for your application. If GC finds any object that is no longer used by the application, it frees up the memory from that object.
 What is Extensible Mark-up Language (XML)?
A: XML is a simple and flexible mark-up language in the text format. Nowadays, it is widely used to exchange a large variety of data over the Internet. XML consists of data as text in well-defined customized layouts by using self-defining tags. These user-defined tags are user friendly and make the information easily understandable to a user.
 What are the main differences between XML and HTML?
Following are the main differences:-
- HTML is about displaying information while XML is about describing information.
- XML supports user-defined tags while HTML provides pre-defined tags.
- XML is a case-sensitive language while HTML language is not case-sensitive.
- In XML, all tags must be closed; while in HTML, it is not necessary to close each tag.
 Difference between Response.Redirect and Server.Transfer?
In case of Response.Redirect, a new request is generated from client-side for redirected page. It’s a kind of additional round trip. As a new request is generated from the client, the new URL is visible to users in the browser after redirection.
While in the case of Server.Transfer, a request is transferred from one page to another without making a round trip from the client. For the end user, the URL remains the same in the browser even after transferring to another page.
 Briefly explain the use of Global.asax.
Global.asax is basically ASP.NET Application file. It’s a place to write code for Application-level events such as Application start, Application end, Session start and end, Application error etc. raised by ASP.NET.
 Which namespaces are used for XML in the .NET environment?
Namespace System.xml.dll is the real physical file, which contains the XML implementation. Some of the other namespaces that allow .NET to use XML are as follows:
 What is an XML schema?
An XML schema provides the definition of an XML document. It defines the following in an XML document:
- The elements that can appear in an XML document
- The attributes that can appear in an XML document
- The elements that are child elements
- The order of child elements
- The number of child elements
- Whether an element is empty or it includes some text
- The data types for elements and attributes