Updated June 22, 2023
Introduction To .NET Interview Questions And Answers
NET is a framework developed by Microsoft. .NET mainly runs on Microsoft Windows. .Net Framework provides a large class library mostly known as Framework Class Library. .NET is used to create Console based applications, Mobile applications for Windows, Web applications, Windows Server, and so on. .NET framework addressed in the programming languages such as Programming with Win32 API, Programming with VC++, Programming with Visual Basic 6.0 and Programming with COM.
Languages like C#, F#, and Visual Basic has been used to develop .NET applications.
C# (C sharp)
C# is commonly known as C sharp which basically follows type-safe Object-Oriented Programming Pattern. For its object-oriented pattern, it is familiar to C, C++, and Java programmers. A developer can develop Client Applications, Web Services, Web-based Applications, different reusable components, and so on. The developer can also develop User Interfaces using Visual C sharp which provides an advanced code editor. There are many available tools that are used to develop applications using C sharp and .NET.
Code:
var dayNameArray = new List<String>{"Sunday","Monday","Tuesday","Wednesday","Thrusday","Friday","Saturday"};
foreach (var dayName in dayNameArray) {
Console.WriteLine($"Day {dayName}");
}
F# (F sharp)
F# is commonly known as F sharp which basically an open-source and cross-platform Programming language. F sharp is a functional programming language for .NET. It also follows the Object-Oriented Programming Pattern. For its object-oriented pattern, it is familiar to C, C++ and Java programmers.
To build a new F# app below command needs to execute:
- dotnet new console -lang F# -o myFirstAppInFSharp
- cd myFirstAppInFSharp
the donet command creates a new console-based app that uses F# programming language in the directory myFirstAppInFSharp.
Program.fs is the main file that exists in the myFirstAppInFSharp folder. It contains a default code that will print “Hello World from F#!” to the console.
To run the code snippet we need to run the command “dotnet run”. To write something new we need to open Program.fs, and to write the necessary code in it.
Code:
let dayNameArray = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]
dayNameArray
|> List.iter (fun dayName -> printfn "Day %s" dayName)
Visual Basic
Visual Basic is a type-safe and Object-Oriented Programming Language that is used to develop different apps on the .NET platform. The syntax of Visual Basic is much simpler with respect to the other programming languages. Visual Basic is used to develop Windows Applications, Web Applications as well as Mobile Applications. Visual Studio IDE is used for developing applications on Visual Basic and .NET.
Code:
Dim dayNameArray As New List(Of String)({
"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"
})
For Each dayName In dayNameArray
Console.WriteLine($"Day {dayName}")
Next
LINQ (Language Integrated Query)
LINQ stands for Language Integrated Query. LINQ is a set of extensions to the .NET and its related languages that consider query as an Object. LINQ provides some common syntax and programming model to query.
Now, if you are looking for a job that is related to .NET then you need to prepare for the 2023 .NET Interview Questions. It is true that every interview is different as per the different job profiles. Here, we have prepared the important .NET Interview Questions and Answers which will help you get success in your interview.
Below are the top 10 .NET Interview Questions which are frequently asked in a .NET Interview. These interview questions are divided into two parts are as follows:
Part 1 – .NET Interview Questions (Basic)
This first part covers the basic .NET Interview Questions and Answers
1. What is BCL?
Answer:
BCL stands for Base Class Library. It basically encapsulates a huge number of common functionalities which are available to .NET based languages. BCL implements different functionalities such as Graphical User Interfaces, I/O operations, Data Access activities and interfaces to different hardware devices. Different kinds of Applications, Components, and controls are provided by the Base Class Library.
2. What is a base class and derived class?
Answer:
A class is Logical binding or container of attributes and functions having different access scopes. Base Class is the parent class from which other child classes derived from the Base class functionalities. Where Derived Class are the classes that derive the functionalities of Base Class.
Let us move to the next .NET Interview Questions
3. What is an extender class?
Answer:
Extender Class allows extending the functionalities of .NET Control Class. Error Provider and Tooltip classes are examples of extender classes of .NET Framework. We need to change in some existing control properties to manipulate these extender classes.
4. How do you prevent a class from being inherited?
Answer:
This is the basic .NET Interview Questions asked in an interview. Not Inheritable is the keyword which will use to prevent a class from being inherited in VB.NET. And in C Sharp the keyword is sealed.
5. What is an Assembly? Explain different types of Assemblies?
Answer:
A versioned and secured deployable unit is known as an Assembly. It can be considered as a collection of types and resources which together work as a logical unit of functionalities in the .NET framework. It can be designed as executable i.e..EXE or reusable i.e..DLL.
There are four types of Assembly:
- Manifest.
- Type Metadata.
- Intermediate Language.
- Resources.
Manifest – It contains the data about the assembly such as Version of an assembly if the assembly is shared assembly then the public key. To verify assembly it also contains the security demands. To load the assembly CLR uses the manifest.
Type Metadata – Provides complete information about the type like Class, Interface, Structure, Methods, and their parameters. The compiler automatically generates this metadata.
Intermediate Language – Language specific compiler generate this code. This is a Machine independent code which is compiled on one machine and deployed in another.
Resources – Assembly contains the embedded resources like images, string tables, icons etc.
There are some other available assemblies that have been supported by .NET Framework. Those assemblies are Private Assembly, Shared/Global/Public Assembly, and Satellite Assembly.
Part 2 – .NET Interview Questions (Advanced)
Let us now have a look at the advanced .NET Interview Questions and Answers.
6. What is the global assembly cache?
Answer:
.NET applications share libraries using GAC. It is a machine-wide cache. Problems associated with DLL’s has been solved by a global assembly cache mechanism.
7. What is a multiple-document interface?
Answer:
MDI is a user interface container by which user can able to work on multi-documents at a time.
Let us move to the next .NET Interview Questions
8. What is Click Once?
Answer:
This is one of a feature which is basically used to build and publish applications. It also used to install and run applications with minimal user intervention.
9. What is a binary for matter?
Answer:
This is the frequently asked .NET Interview Questions in an interview. Binary for matter is used to serialize and de-serialize the Object in binary format.
10. What is a COM Callable Wrapper and Runtime Callable Wrapper?
Answer:
COM Callable Wrapper used to enable COM components to access .NET components whereas Runtime Callable Wrapper used to enable .NET components to call COM components.
Recommended Article
This has been a guide to a List Of .NET Interview Questions and Answers so that the candidate can crackdown these Interview Questions easily. Here in this post, we have studied top .NET Interview Questions which are often asked in interviews. You may also look at the following articles to learn more –