Best .NET Interview Questions And Answers

If you're looking for a decent developer obviously you have to test applicants' software development skills. Your future .NET developer should know not only the Microsoft .NET Framework but also effective programming and software development techniques. In addition to other challenging .NET developer interview questions, an interviewer should test the candidates’ technical knowledge of the .NET Framework. 

Also, this list will be useful for applicants preparing for the interview.

Thus, this article featuring a list of interview questions and answers for .NET developers will assist both sides of the interview.

Junior .NET Developer Interview Questions

01

What is the .NET framework?

The .NET platform supports the object-oriented approach that is used to build applications on Windows. It supports various languages like C#, VB, Cobol, Perl, .NET, etc. It has a wide range of tools and functions like classes, libraries, and APIs that are used to build, deploy and run web services and various applications.

02

What are the different components of .NET?

The following are the components of .NET:

  • Common language runtime
  • Application domain
  • Generic type system
  • .NET class library
  • .NET Framework
  • Profiling

03

What do you know about CTS?

CTS stands for Common Type System. It follows certain rules according to which a data type must be declared and used in program code. CTS also describes the data types that will be used in the application. We can even create our own classes and functions following the rules of CTS, this helps to call a data type declared in one program language with other programming languages.

04

What is the CLR?

CLR stands for common language run-time; it is an essential component of the .NET platform. We can use the CLR as a building block for various applications and provide a secure runtime environment for applications.

Whenever an application written in C# is compiled, the code is converted to an intermediate language. The code then targets the CLR, which then performs several operations such as memory management, security checks, assembly loading, and thread management.

05

Explain CLS

The Common Language Specification helps developers to use components that are compatible in different languages ​​with specific rules that come with the CLS. It then helps to reuse code in other .NET compatible languages.

06

What do you know about JIT?

JIT is a compiler that stands for Just In Time. It is used to convert intermediate code to the native language. At run time, the intermediate code is converted to the native language.

07

What is MIME?

MIME stands for Multipurpose Email Extensions, it is an email protocol extension that allows users to use the protocol to exchange files over the Internet.

Servers insert the MIME header at the beginning of the web transfer. Clients then use this header to select the appropriate "player" for the data type that the header indicates. Some of these players are built into the web browser.

08

What is the difference between Response.Redirect and Server.Transfer?

Response.Redirect basically redirects the user's browser to another page or site. The user's browser history is updated to reflect the new URL as well. It also performs a backtracking path to the client where the client's browser is redirected to a new page.

Whereas Server.Transfer transfers from one page to another without returning to the client browser. In the case of Server.Transfer, the history is not updated.

09

What do you know about BCL?

  • BCL is a core library of classes, interfaces, and value types.
  • It is the foundation of the .NET framework applications, components, and controls.
  • It encapsulates a huge number of common functions and makes them easily accessible to developers.
  • It provides features like multithreading, I / O, security, diagnostics, resources, globalization, etc.
  • Also serves for interaction between the user and the runtime.
  • It also provides very commonly used namespaces. for example system, system.Activities, etc.

10

What is the difference between namespace and assembly?

An assembly is a physical group of logical units, whereas a namespace is a group of classes. In addition, a namespace can span multiple assemblies.

Mid .NET Developer Interview Questions

01

What is LINQ?

It is an abbreviation for Language Integrated Query, which was introduced in Visual Studio 2008. LINQ is a set of functions that extend the capabilities of queries to the .NET framework language syntax that allows you to manipulate data regardless of the data source. LINQ bridges the gap between the world of objects and the world of data.

02

What is MSIL?

MSIL is Microsoft's intermediate language and provides instructions for calling methods, storing and initializing values, handling memory, handling exceptions, and so on. All .NET codes are first compiled into an intermediate language.

03

Explain the different parts of the assembly.

Below are the different parts of the assembly:

  • Manifest: Contains assembly version information.
  • Metadata type: contains binary information about the program.
  • MSIL: Microsoft Intermediate Language Code
  • Resources: List of Related Files

04

What types of constructors are there in C#?

Following are the types of constructors in C#:

  • Default constructor
  • Parameterized constructor
  • Copy constructor
  • Static constructor
  • Private constructor

05

What are the types of assemblies?

There are two types of assemblies:

  • Private assembly: available only to the application, installed in the application installation directory.
  • Shared assembly: It can be used by multiple applications, it is installed in the GAC.

06

What are MDI and SDI?

  • MDI (Multiple Document Interface): MDI allows you to open multiple windows, it will have one parent window and the same number of child windows. Components are shared from the parent window, such as menu bar, toolbar, etc.
  • SDI (Single Document Interface): Opens each document in a separate window. Each window has its own components like menu bar, toolbar, etc. Therefore, it is not limited to the parent window.

07

What is a garbage collector?

The .NET garbage collector function frees unused code objects in memory. The memory head is divided into 3 generations:

  • Generation 0: Stores short-lived objects.
  • Generation 1: This is for objects of average lifespan.
  • Generation 2: It stores long-lived objects.

Garbage collection refers to the collection of objects stored across generations.

08

What is caching?

Caching simply means storing data temporarily in memory so that the data can be accessed from memory rather than looking for it in its original location. This increases the efficiency of the application and also increases its speed.

Following are the types of caching:

  • Page caching
  • Data caching
  • Fragment caching

09

Explain MVC.

MVC stands for Model View Controller, which is an architecture for building .NET applications.

  • Model: They are a logical part of any application that handles object storage and retrieval from databases for the application.
  • View: View handles part of the application's user interface. They get information from models for their display.

Controller: They handle user interactions, define responses to user input, and also render the view required to interact with the user.

10

What is CAS?

CAS stands for Code Access Security, CAS is part of the security model that prevents unauthorized access to resources. It also allows users to set code permissions. The CLR then executes the code based on the permissions.

CAS can only be used for managed code. If the assembly uses CAS, it is considered partially trusted. Although it passes checks every time the assembly tries to access resources.

Senior .NET Developer Interview Questions

01

What is an application domain?

ASP.NET introduces the concept of an application domain, or AppDomain, which is like a lightweight process that acts as a container and as a boundary. The .NET runtime uses the application domain as a container for data and code. The CLR allows you to run multiple .NET applications in the same application domain.

02

What is a delegate in .NET?

A delegate in .NET is like a function pointer in other programming languages ​​such as C or C++. The delegate allows the user to encapsulate a method reference in a delegate object. The delegate object can then be passed to a program that will call the specified method. We can even use the delegate method to create a custom event in the class.

03

What are the validators in ASP.NET?

Client-side validation - when validation is performed in the browser on the client-side, this is called client-side validation. Typically JavaScript is used for client-side validation.

Server-side validation - when validation is performed on the server, this is called server-side validation. Server-side validation is considered a safe form of validation because even if the user bypasses client-side validation, we can still catch it in server-side validation.

04

What are EXE and DLL?

EXE and DLL are executable assembly modules.

EXE: This is the executable file that launches the application for which it is designed. When we create the application, an exe file is created. Therefore, the assemblies are loaded directly when we run the exe. But the exe file cannot be shared with other applications.


DLL: This is a dynamic link library of code that needs to be hidden. The code is encapsulated in this library, the application can have many DLLs, and can also be shared with other applications.

05

Explain role-based security.

Role-based security is used to implement security controls based on the role assigned to users in an organization. We can then authorize users based on their roles in the organization. For example, windows have access based on roles such as users, administrators, and guests.

06

What is cross-page publishing?

Every time we click the submit button on the page, the data is saved on the same page. But if the data is stored on another page, this is called interstitial publishing.

Publishing between pages can be achieved with the POSTBACKURL property, which triggers a postback.

The FindControl method can be used to retrieve the values ​​that are published to the page it was posted to.

07

Explain passport authentication.

During passport authentication, it first checks the passport authentication cookie, if the cookie is not available, the app redirects to the passport login page. The Passport service then authenticates the user's credentials to the login page and, if valid, stores it on the client computer and then redirects the user to the requested page.

08

What are ASP.NET Security Controls?

  • <asp: Login>: Provides a login facility that allows users to enter their credentials.
  • <asp: LoginName>: Allows you to display the name of the logged-in user.
  • <asp: LoginStatus>: Indicates whether the user is authenticated or not.
  • <asp: LoginView>: Provides different types of login depending on the selected template.
  • <asp: PasswordRecovery>: Sends lost passwords to users via email.

09

What is an HTTP Handler?

Each request to an ASP.NET application is processed by a specialized component called an HTTP handler. It is the most important component for handling requests for ASP.NET applications.

It uses different handlers to serve different files. The web page handler creates the page and controls, runs your code, and then renders the final HTML code.

The following are the default HTTP handlers for ASP.NET:

  • Page handler (.aspx): handles web pages.
  • Custom Control Handler (.ascx): It handles web user control pages.
  • Web service handler (.asmx): Processes web service pages.
  • Trace handler (trace.axd): handles trace functions

10

What is the appSettings section in the web.config file?

If we want to set user-defined values for all applications, we can use the appSettings block in the web.config file. For example, the code below uses ConnectionString throughout the project to connect to the database:

<em><configuration>

<appsettings>

<add key= "ConnectionString" value="server=local; pwd=password; database=default" />

</appSettings></em>

home-05
Hiring .NET developers?
We have the people you are looking for!
Get in touch
Looking for vetted .NET developers to join your team?

There are hundreds of battle-proven software development experts in our Talent Network.

Are you a .NET developer looking for amazing projects? Join as a Talent