Latest Qualification Jobs

.NET Interview Questions and Answers | Commonly Asked in HR Interviews

.NET Interview Questions and Answers

Information Technology or IT is a vast career sector. Among all the options available in the IT sector, Dot Net provides high growth prospect to youngsters! .NET Interview Questions and Answers available here will definitely lead you to get success.

Here, we have brought to you Commonly Asked in HR Interviews which may puzzle you sometimes. You just need to go through the Dot NET Interview Questions and Answers provided below. Let’s have a look…

.NET Interview Questions and Answers (.NET Framework)

Question 1: What is an IL?

Answer: 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.

Question 2: What is Manifest?

Answer: Assembly metadata is stored in Manifest. Manifest contains all the metadata needed to do the following things

  • Version of assembly.
  • Security identity.
  • Scope of the assembly.
  • Resolve references to resources and classes.

Also Check- ASP .NET Developer Interview Questions

Question 3: What are code contracts?

Answer: Code contracts help you to express the code assumptions and statements stating the behavior of your code in a language-neutral way. The contracts are included in the form of pre-conditions, post-conditions and object-invariants. The contracts help you to improve-testing by enabling run-time checking, static contract verification, and documentation generation.

Question 4: What is managed extensibility framework?

 Answer: Managed extensibility framework (MEF) is a new library that is introduced as a part of .NET 4.0 and Silverlight 4. It helps in extending your application by providing greater reuse of applications and components. MEF provides a way for host application to consume external extensions without any configuration requirement.

Also Check- DBMS Interview Questions and Answers

Question 5: What is code access security (CAS)?

Answer: Code access security (CAS) is part of the .NET security model that prevents unauthorized access of resources and operations, and restricts the code to perform particular tasks.

Do you know? SQL Interview Questions and Answers

.NET Interview Questions and Answers (.NET Programming Concepts)

Question 1: Which statement is used to replace multiple if-else statements in code.

Answer: In Visual Basic, the Select-Case statement is used to replace multiple If – Else statements and in C#, the switch-case statement is used to replace multiple if-else statements.

Prepare- Interview Questions and Answers

Question 2: What is the syntax to declare a namespace in .NET?

Answer: In .NET, the namespace keyword is used to declare a namespace in the code.

  • The syntax for declaring a namespace in C# is: namespace UserNameSpace
  • The syntax for declaring a namespace in VB is: Namespace UserNameSpace

Question 3: Differentiate between the while and for loop in C#.

Answer: The while and for loops are used to execute those units of code that need to be repeatedly executed, unless the result of the specified condition evaluates to false. The only difference between the two is in their syntax. The for loop is distinguished by setting an explicit loop variable.

Read- Interview Preparation Tips

Question 4: What does a break statement do in the switch statement?

Answer: The switch statement is a selection control statement that is used to handle multiple choices and transfer control to the case statements within its body. The following code snippet shows an example of the use of the switch statement in C#:

Question 5: Determine the output of the code snippet.


int a = 29;


a -= ++a;

Console.WriteLine(“The value of a is: {0}”, a);

/* The output of the code is -1. */

Must Check- Java Programming Interview Questions for Freshers

.NET Interview Questions and Answers (Object-Oriented Programming)

Question 1: What is an object?

Answer: They are instance of classes. It is a basic unit of a system. An object is an entity that has attributes, behavior, and identity. Attributes and behavior of an object are defined by the class definition.

Question 2: What is the difference between arrays and collection?


You need to specify the size of an array at the time of its declaration. It cannot be resized dynamically.The size of a collection can be adjusted dynamically, as per the user’s requirement. It does not have fixed size.
The members of an array should be of the same data type.Collection can have elements of different types.

Check Here- How To Dress For An Interview

Question 3: How can you prevent your class to be inherited further?

Answer: You can prevent a class from being inherited further by defining it with the sealed keyword.

Question 4: What is the index value of the first element in an array?

Answer: In an array, the index value of the first element is 0 (zero).

Question 5: Can you specify the accessibility modifier for methods inside the interface?

Answer: All the methods inside an interface are always public, by default. You cannot specify any other access modifier for them.

Also Check- C Language Interview Questions & Answers

.NET Interview Questions and Answers (Windows Controls)

Question 1: How can we auto size a button to fit its text?

Answer: 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.

Check Answer of most imp question- Why Should We Hire You?

Question 2: How can we display an icon or a bitmap image on the Button control?

Answer: The Button class contains the Image property, which is used to set an image on the Button control. We can also set the alignment of the image by using the ImageAlign property of the Button class.

Question 3: Which method is used to generate the click event of the Control class for the Button control in C#?

Answer: The PerformClick() method of the Button class is used to generate the Click event of the System.Windows.Forms.Control class.

Check- Java Interview Questions 

Question 4: A Windows Form will not show the Minimize, Maximize, and Close buttons, if the ControlBox property of the form is set to False. (True/False)

Answer: True.

Question 5: How is anchoring different from docking?

Answer: Docking refers to attaching a control to either an edge (top, right, bottom, or left) or the client area of the parent control. On the other hand, anchoring is a process in which you need to specify the distance that each edge of your control maintains from the edges of the parent control.

Read Here- C++ Interview Questions Answers 

.NET Interview Questions and Answers (ADO.NET)

Question 1: What is the full form of ADO?

Answer: The full form of ADO is ActiveX Data Object.

Question 2: What are the two fundamental objects in ADO.NET?

Answer: DataReader and DataSet are the two fundamental objects in ADO.NET.

Question 3: Which namespaces are required to enable the use of databases in ASP.NET pages?

Answer: The following namespaces are required to enable the use of databases in ASP.NET pages:

The System.Data namespace.

The System.Data.OleDb namespace (to use any data provider, such as Access, Oracle, or SQL)

The System.Data.SQLClient namespace (specifically to use SQL as the data provider)

Check Here- Core Java Interview Questions and Answers for Freshers 

Question 4: Which properties are used to bind a DataGridView control?

Answer: The DataSource property and the DataMember property are used to bind a DataGridView control.

Question 5: What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?

Answer: You must set the DataSource property and call the DataBind() method.

.NET Interview Questions and Answers (Language-Integrated Query (LINQ))

Question 1: What is Language Integrated Query (LINQ)?

Answer: LINQ is a programming model that is the composition of general-purpose standard query operators that allow you to work with data, regardless of the data source in any .NET based programming language. It is the name given to a set of technologies based on the integration of query capabilities into any .NET language.

Question 2: Write the basic steps to execute a LINQ query.

Answer: The following are the three basic steps to execute a LINQ query:

  • Obtain the data source (The data source can be either an SQL database or an XML file)
  • Create a query
  • Execute the query

Question 3: In which statement the LINQ query is executed?

Answer:  A LINQ query is executed in the For Each statement in Visual Basic and in the foreach statement in C#.

Question 4: In LINQ, lambda expressions underlie many of the standard query operators. Is it True or False?

Answer: It is true.

Question 5: What are the different Visual Basic features that support LINQ?

Answer: Visual Basic includes the following features that support LINQ:

Anonymous typesEnables you to create a new type based on a query result.
Implicitly typed variablesEnables the compiler to infer and assign a type when you declare and initialize a variable.
Extension methodEnables you to extend an existing type with your own methods without modifying the type itself

Check here- Unix Interview Questions And Answers

.NET Questions Commonly Asked in HR Interviews (Dynamic Programming)

Question 1: What is Dynamic Language Runtime (DLR)?

Answer: DLR is a runtime environment that allows you to integrate dynamic languages with the Common Language Runtime (CLR) by adding a set of services, such as expression trees, call site caching, and dynamic object interoperability to the CLR.

Question 2: Name the binders provided by .NET Framework 4.0.

Answer: .NET Framework 4.0 provides the following binders:

Object Binder Enables to communicate with .NET objects.
JavaScript Binder Enables to communicate with JavaScript in Silverlight.
Python Binder Enables to communicate with IronPython.
Ruby Binder Enables to communicate with IronRuby.
COM Binder Enables to communicate with COM.

Question 3: What is the difference between dynamic and var data types?

Answer: The difference between the var and dynamic data types is that the var data type is strongly type checked at the compile time; whereas, the dynamic data type is type checked by the compiler only at run time.

Must Know- PHP Developer Interview Questions 

Question 4: Which class is used for converting the data types?

Answer: The System.Convert class provides a complete set of methods for converting the data types.

Question 5: Give a brief introduction to Binders.

Answer: Binders are used by DLR to communicate with not the .NET Framework but also with various other services, such as Silverlight and COM. These services represent language-specific semantics and specify how a particular operation can be performed at the call site.


If you’ve any query or doubts regarding .NET Interview Questions and Answers, you can ask by leaving your comment in comment box. And join us through Google+ or Facebook for receiving career related latest updates.

Something That You Should Put An Eye On

How to Write a Good ResumePersonality Improvement Tips
What Are Your Strength and WeaknessGroup Discussion: Dos and Don’ts
Interview Preparation for Getting a JobHow To Prepare For Online Exam

Filed in: Interview

Leave a Reply

Submit Comment