.NET Interview Questions and Answers | Part-1

Most Frequently Asked Question in .Net Interview.

Q.1 What is the .Net framework?

Answer: It is a platform for building various applications on windows. It has a list of inbuilt functionalities in the form of class, library, and APIs which are used to build, deploy and run web services and different applications. It supports different languages such as C#, VB .Net, Cobol, Perl, etc.

This framework supports the object-oriented programming model.

Q.2 What are the important components of .Net?

Answer: The components of .Net are Common language run-time, .Net Class library, Application domain, Common Type System, .Net framework, Profiling, etc. However, the two important components are the Class library and the Common Language Runtime.

CLR provides building blocks for a wide variety of applications. The class library consists of a set of classes that are used to access common functionality. The functionality can be shared among different applications.

Q.3 What is CLS?

Answer: CLS stands for Common Language Specification. With the rules mentioned under CLS, the developers are made to use the components that are inter-language compatible. They are reusable across all the .Net Compliant languages.

Q.4 What is CTS?

Answer: CTS stands for Common Type System. It has a set of rules which state how a data type should be declared, defined and used in the program. It describes the data types that are to be used in the application.

We can design our own classes and values by following the rules that are present in the CTS. The rules are made so that the data type declared using a programming language can be called by an application that is developed using a different language.

Q.5 What is CLR?

Answer: CLR stands for Common Language Runtime. It is one of the most important components of the .Net framework. It provides building blocks for many applications.

An application built using C# gets compiled by its own compiler and is converted into an Intermediate language. This is then targeted to CLR. CLR does various operations like memory management, security checks, assemblies to be loaded and thread management. It provides a secure execution environment for applications.

Q.6 What is MSIL?

Answer: MSIL stands for Microsoft Intermediate Language.

MSIL provides instructions for calling methods, initializing and storing values, operations such as memory handling, exception handling and so on. All .Net codes are first compiled to IL.

Q.7 What is JIT?

Answer: JIT stands for Just In Time. JIT is a compiler that converts Intermediate Language to a Native code.

The code is converted into Native language during execution. Native code is nothing but hardware specifications that can be read by the CPU. The native code can be stored so that it is accessible for subsequent calls.

Q.8 How is a Managed code executed?

Answer: Follow these steps while executing a Managed code:
  • Choosing a language compiler depending on the language in which the code is written.
  • Converting the above code into Intermediate language by its own compiler.
  • The IL is then targeted to CLR which converts the code into native code with the help of JIT.
  • Execution of Native code.

Q.9 What is an Assembly? What are the different types of Assemblies?

Answer: An Assembly is a collection of logical units. Logical units refer to the types and resources which are required to build an application and deploy them using the .Net framework. The CLR uses this information for type implementations. Basically, Assembly is a collection of Exe and DLLs. It is portable and executable.

There are two types of Assemblies, Private and Shared:
  • Private Assembly, as the name itself suggests, it is accessible only to the application. It is installed in the installation directory of the application.
  • Shared Assembly can be shared by multiple applications. It is installed in the GAC.

Q.10 What is Caching?

Answer: Caching means storing data temporarily in the memory so that the application can access the data from the cache instead of looking for its original location. This increases the performance of the application and its speed. System.Runtime.Caching namespace is used for Caching information in .Net.

Q.11 What is MVC?

Answer: MVC stands for Model View Controller. It is an architectural model for building the .Net applications.
  • Models – Model objects store and retrieve data from the database for an application. They are usually the logical parts of an application that is implemented by the application’s data domain.
  • View – These are the components that display the view of the application in the form of UI. The view gets the information from the model objects for their display. They have components like buttons, drop boxes, combo box, etc.
  • Controllers – They handle user interactions. They are responsible for responding to the user inputs, work with the model objects, and pick a view to be rendered to the user.

Q.12 Explain CAS (Code Access Security).

Answer: .Net provides a security model that prevents unauthorized access to resources. CAS is a part of that security model. CAS is present in the CLR. It enables the users to set permissions at a granular level for the code.

CLR then executes the code depending on the available permissions. CAS can be applied only to the managed code. Unmanaged code runs without CAS. If CAS is used on assemblies, then the assembly is treated as partially trusted. Such assemblies must undergo checks every time when it tries to access a resource.


.NET Interview Questions and Answers

Download the Android app to get all Government Job Notifications on your Mobile.
Download Now
Important: Please always Check and Confirm the above details with the official Advertisement / Notification.
Previous Post Next Post