Dot Net Interview Questions
Choose A Topic
Interview Questions
1. What is .NET framework?
.NET is one of the platforms provided by Microsoft, which is used to build a variety of applications using Windows.
The ability to develop classes, libraries, and APIs and run, debug, and deploy code onto web services and applications form are the key uses of this framework. It supports a lot of languages, and you can work with everything from C# to VB all the way to Perl, and more.
The object-oriented model is championed here in the .NET framework
2. What are some of the common components of .NET?
There are a lot of components that make up the .NET framework, and some of them are as follows:
- .NET Class Library
- .NET Framework
- Language Runtime
- Application Domain
- Profiling
3. What does JIT stand for in .NET?
JIT is the abbreviation of Just in Time. It is a compiler that is used to convert intermediate code into native code easily.
In .NET, during execution, the code is converted into the native language, also called the byte code. This is processed by the CPU, and the framework helps with the conversion.
4. What is the meaning of MSIL?
MSIL is the abbreviation for Microsoft Intermediate Language. It is used to provide the instructions required for operations such as memory handling, exception handling, and more. It can also provide instructions to initialize and store values and methods easily.
The next .NET interview question involves an important concept.
5. What is CTS?
The acronym CTS stands for Common Type System, which encompasses a predefined set of systematic regulations dictating the proper definition of data types in relation to the values provided by a user. Its primary purpose is to characterize and encompass all the various data types utilized within a user’s application.
Nevertheless, it is also permissible for users to construct custom calls using the guidelines established by the CTS. This feature is primarily provided to accommodate the diverse range of programming languages that can be employed when working within the .NET framework.
6. What does CLR stand for in .NET?
CLR stands for Common Language Runtime. It forms to be the most vital component of .NET as it provides the foundation for many applications to run on.
If a user writes an application in C#, it gets compiled and converted to intermediate code. After this, CLR takes up the code and works on it with respect to the following aspects:
- Memory management
- Security protocols
- Libraries for loading
- Thread management
7. What is the difference between managed code and unmanaged code in .NET?
Managed Code | Unmanaged Code |
Managed by CLR | Not managed by any entity |
Garbage collection is used to manage memory | Runtime environment takes care of the management |
The .NET framework is necessary for the execution | N
ot dependant on the .NET framework to run |
8. How does managed code execute in the .NET framework?
There are four main steps that include in the execution of the managed code. They are as follows:
- Choosing a compiler that can execute the code written by a user
- Conversion of the code into Intermediate Language (IL) using a compiler
- IL gets pushed to CLR, which converts it into native code using JIT
- Native code is now executed using the .NET runtime
9. What is the meaning of state management in .NET?
State management, as the name suggests, is used to constantly monitor and maintain the state of objects in the runtime. A web page or a controller is considered to be an object.
There are two types of state management:
- Client-side: It is used to store information on the client’s machine and is formed mostly of reusable and simple objects.
- Server-side: It stores the information on the server and makes it easier to manage and preserve the information on the server.
10. What is the difference between an object and a class in .NET?
Object | Class |
An instance of a class | The template for creating an object |
A class becomes an object after instantiation | The basic scaffolding of an object |
Used to access properties from a class | The description of methods and properties |
11. What is the difference between system.stringbuilder and system.string in .NET?
system.stringbuilder | system.string |
Mutable | Immutable |
Supports using append | Cannot use the append keyword |
12. What is the meaning of LINQ?
LINQ is the abbreviated form of Language Integrated Query. It was first brought out in 2008, and it provides users with a lot of extra features when working with the .NET framework. One highlight is that it allows the users to manipulate data without any dependency on its source.
13. What is an assembly in .NET?
An assembly is the simple collection of all of the logical units present. Logical units are entities that are required to build an application and later deploy the same using the .NET framework. It can be considered as a collection of executables and DLL files.
14. What are some of the components of an assembly in .NET?
There are four main components of an assembly. They are as follows:
- Resource: A collection of related files
- MSIL: The Intermediate Language code
- Metadata: The binary data of a program
- Manifest: A collection of information about the assembly
- What is the meaning of caching?
Caching is a term used when the data has to be temporarily stored in the memory so that an application can access it quickly rather than looking for it in a hard drive. This speeds up the execution to an exponential pace and helps massively in terms of performance.
There are three types of caching:
- Data caching
- Page caching
- Fragment caching
The next .NET interview question we will check involves an important concept.
15. What is the difference between a function and a stored procedure in .NET?
Function | Stored Procedure |
Can only return one value | Can return any number of values |
No support for exception handling using try-catch blocks | Supports the usage of try-catch blocks for exception handling |
The argument consists of only one input parameter | Both input and output parameters are present |
A function can be called from a stored procedure | The stored procedure cannot be called from a function |
16. What are the constructor types present in C# .NET?
There are five main types of constructor classes in C# as listed below:
- Copy constructor
- Default constructor
- Parameterized constructor
- Private constructor
- Static constructor
17. What are some of the advantages of using a session?
There are numerous advantages of making use of a session are as mentioned below:
- It is used to store user data across the span of an application.
- It is very easy to implement and store any sort of object in the program.
- Individual entities of user data can be stored separately if required.
- The session is secure, and objects get stored on the runtime server.
18. What is the use of manifest in the .NET framework?
Manifest is mainly used to store the metadata of the assembly. It contains a variety of metadata which is required for many things as given below:
- Assembly version information
- Security identification
- Scope checking of the assembly
- Reference validation of classes
19. What are memory-mapped files used for in .NET?
Memory-mapped files in .NET are used to instantiate the contents of a logical file into the address of the application. This helps a user run processes simultaneously on a single machine and have the data shared between processes.
The MemoryMappedFile.CreateFromFiles() function is used to obtain a memory-mapped file object easily.
20. What is the meaning of CAS in .NET?
CAS stands for Code Access Security. It is vital in the prevention of unauthorized access to programs and resources in the runtime. It can provide limited access to the code to perform only certain operations rather than providing all at a given point in time. CAS forms to be a part of the native .NET security architecture.