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.
01
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
The following are the components of .NET:
03
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
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
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
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
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
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
10
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.
01
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
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
Below are the different parts of the assembly:
04
Following are the types of constructors in C#:
05
There are two types of assemblies:
06
07
The .NET garbage collector function frees unused code objects in memory. The memory head is divided into 3 generations:
Garbage collection refers to the collection of objects stored across generations.
08
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:
09
MVC stands for Model View Controller, which is an architecture for building .NET applications.
Controller: They handle user interactions, define responses to user input, and also render the view required to interact with the user.
10
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.
01
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
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
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
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
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
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
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
09
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:
10
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>
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