.Net Framework Basic Interview Questions

In this post, we try to cover all .net framework basic interview questions answer which is more about framework related, rather than application development, there are various .net framework from Microsoft, but some interview questions remain same for all the frameworks.

What is .Net Framework?
The .NET is a Framework, which is a collection of classes of reusable libraries given by Microsoft to be used in other .NET applications and to develop, build and deploy any types of applications.
.Net Framework interview question
Dot net Framework Interview Questions
What is CTS?

Common Type System known as CTS in .Net Framework, CTS is one of the core architectural part of .Net Framework.

Learn more about CTS (Common Type System) in .Net.
What is GAC?
Global Assembly Cache is known as GAC, GAC is a shared location of the computer where we can put any assembly, then we can access the assembly from many different locations, I mean it is accessible from another project or application.
What is CLR?

The CLR stands for Common Language Runtime and it is an Execution Environment. It works as a layer between Operating Systems and the applications written in .NET languages.

The main function of CLR (Common Language Runtime) is to convert the Managed Code into native code and then execute the program.

CLR runtime engine comes with set of services.
  • Assembly Resolver
  • Assembly Loader
  • Type Checker
  • COM marshalled
  • Debug Manager
  • Thread Support
  • IL to Native compiler
  • Exception Manager
  • Garbage Collector
Learn more about CLR in .Net Framework (Common Language Runtime).
How many type of assembly we have in .net?

Private assembly, Shared assembly & Satellite Assembly.

Private assembly:

Private assemblies are not designed to be shared. They are designed to be used by one application and must reside in that application's directory or subdirectory. This isolated methodology is nostalgically reminiscent of the DOS days when applications were fully contained within their own directories and did not disturb one another. By default, all assemblies (like the one we created in the previous example) are private. If you wish to make them shared, you must explicitly do so by signing them, as the upcoming example will illustrate. It is expected that the majority of assemblies you create will be of the private type.

Shared Assemblies:

For those components that must be distributed, Microsoft offers the shared assembly. The shared assembly concept is centered around two principles. The first, called side-by-side execution, allows the CLR to house multiple versions of the same component on a single machine. The second, termed binding, ensures that clients obtain the version of the component they expect. Together, these two principles free developers from having to ensure that their components are compatible with earlier versions. If a component evolves through versions 1.0, 1.1, and 2.0, the CLR will maintain separate copies of each version and invoke the correct one accordingly.

Satellite Assembly:

A satellite assembly is defined as an assembly with resources only, no executable code.

What is strong name & how to create a strong name?
Open command prompt go to Dll folder path.
  • 1. Type sn -k HP.snk
  • 2. This create HP.snk file in E:\hemant\practice\HP\bin\Debug folder.
  • 3. Open the AssemblyInfo.cs file of project.
  • 4. Type path of snk file in strongname key attribue.
What are the difference between managed and unmanaged code?

Managed code is executed by the CLR, in any .net application managed code is created by the .NET compiler. It does not depend on the architecture of the targeted machine, because the code is executed by Common Language Runtime, and not by the operating system itself.

On the other hand, unmanaged code is directly compiled to machine code or native code, which depends on the architecture of the target machine. the code is executed directly by the operating system.

What is the application domain?
Application Domain is a logical container for a set of assemblies. An AppDomain can be independently secured.

The AppDomain class is used to create and terminate Application Domains, the class has properties like CurrentDomain, FriendlyName, SetupInformation, BaseDirectory etc.

What is a portable executable (PE) file?
In the .NET framework, every program executes (communicate) in an operating system by using CLR (Common Language Runtime).

Managed module is standard windows Portable Executable (PE) file, which contain

  • PE Header: common object file format.
  • CLR Header: it contains the CLR version required to run this managed module, location & metadata.
  • Metadata: contains table information means variable with its data types and default values, functions/methods which are declared & defined in our program

What is a dynamic assembly in .Net ?
Dynamic assembly is any external assemblies, which are loaded on demand, known as Dynamic assembly loading; Dynamic assembly can be private or shared assembly.
What is a garbage collector?
Garbage Collector is often termed as GC in .NET Framework that allocates and releases memory for any .NET applications, basically application memory management is controlled by Garbage Collector in .net
Entity Framework Interview Questions Answers
ASP.NET Course Online
Asp.net Course Online
learn entity framework
Interview Question Answers | Fresher Job Interview Tips