0% found this document useful (0 votes)
9 views

DotNet Interview Questions

.NET Framework is a Microsoft platform for building and running applications, supporting multiple languages and providing a large library of pre-built code. Key concepts include value types vs. reference types, namespaces for organization, and the Common Language Runtime (CLR) for execution management. Advanced topics cover C#, garbage collection, delegates, ASP.NET, and the differences between .NET Core and .NET Framework.

Uploaded by

jordanrai183
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

DotNet Interview Questions

.NET Framework is a Microsoft platform for building and running applications, supporting multiple languages and providing a large library of pre-built code. Key concepts include value types vs. reference types, namespaces for organization, and the Common Language Runtime (CLR) for execution management. Advanced topics cover C#, garbage collection, delegates, ASP.NET, and the differences between .NET Core and .NET Framework.

Uploaded by

jordanrai183
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

**Beginner Level:**

1. **What is .NET Framework?**

.NET Framework is a platform created by Microsoft to build and run software applications. It includes a large library
of pre-built code (Framework Class Library) that developers can use, and it supports multiple programming languages
like C#, VB.NET, and F#. It provides tools and libraries to develop applications for various platforms, including Windows,
web, mobile, and more.

2. **Explain the difference between value types and reference types.**

- **Value Types:** These hold the actual value within their memory space. Examples are integers, floating-point
numbers, and structs. They are stored directly where they are declared, making access faster.

- **Reference Types:** These store references or pointers to where the data is held in memory. Examples include
objects, arrays, and classes. They are stored in the heap memory and need to be accessed indirectly via these
references, making them a bit slower than value types.

3. **What are namespaces in .NET?**

Namespaces are used to organize and group related classes, interfaces, structures, enumerations, and delegates in
.NET. They prevent naming conflicts and make it easier to manage and locate classes within larger applications.

4. **What is the Common Language Runtime (CLR)?**

CLR is the core part of the .NET Framework responsible for managing the execution of .NET programs. It handles tasks
like memory management, code compilation, code execution, and exception handling. It ensures that .NET programs
run efficiently and securely by providing features like garbage collection and type safety.

5. **Explain the difference between managed code and unmanaged code.**

- **Managed Code:** Code that runs under the control of CLR is called managed code. It's written in .NET languages
and benefits from CLR's services like automatic memory management (garbage collection) and type safety.

- **Unmanaged Code:** Code that doesn't run under CLR's control. It's typically written in languages like C or C++ and
requires manual memory management and lacks the services provided by CLR.

**Intermediate Level:**

6. **What is C#? How is it related to .NET?**

C# (pronounced as C-sharp) is a programming language developed by Microsoft specifically for building .NET
applications. It's closely tied to the .NET Framework and provides a powerful and easy-to-learn syntax for developers.

7. **What are the different types of assemblies in .NET?**

- **Private Assemblies:** These contain resources that are used by a single application. They're kept within the
application's directory.
- **Shared Assemblies:** These contain resources that can be shared by multiple applications. They are stored in the
Global Assembly Cache (GAC) to facilitate their sharing across applications.

8. **Explain the concept of garbage collection in .NET.**

Garbage collection is the process by which the CLR automatically manages memory by identifying and freeing up
memory that is no longer in use (i.e., not referenced by any part of the program). It prevents memory leaks and helps
in efficient memory utilization.

9. **Describe the purpose of the Global Assembly Cache (GAC).**

The GAC is a central repository that stores shared assemblies intended to be used by multiple applications. It helps
in versioning and sharing of assemblies across different applications, ensuring that multiple applications can use the
same assembly without conflicts.

10. **What is the role of the JIT compiler in .NET?**

The JIT (Just-In-Time) compiler in .NET converts the Intermediate Language (IL) code, generated by the language
compiler, into native machine code that the processor can execute. It does this on demand at runtime, improving
performance by compiling only the necessary code.

**Advanced Level:**

11. **What are delegates and events in C#?**

Delegates are similar to function pointers in C++. They are type-safe, object-oriented, and can reference one or more
methods. Events in C# are built on delegates and allow objects to notify other objects when something significant
happens.

12. **Explain the concept of inheritance and how it's implemented in C#.**

Inheritance is a fundamental concept in object-oriented programming where one class (derived or child class)
inherits properties and behaviors from another class (base or parent class). In C#, inheritance is implemented using
the colon (:) symbol to indicate the derived class and the base class.

13. **Describe the various access modifiers in C#.**

Access modifiers control the visibility or accessibility of classes, methods, variables, etc.

- **Public:** Accessible from anywhere.

- **Private:** Accessible only within the same class.

- **Protected:** Accessible within the same class or its derived classes.

- **Internal:** Accessible within the same assembly.

- **Protected Internal:** Accessible within the same assembly or derived class.


14. **What are the different types of collections available in .NET? Explain their differences.**

Collections in .NET are data structures used to store and manipulate groups of objects. They include Lists, Arrays,
Dictionaries, Queues, and Sets. Each collection type has its unique way of organizing and managing data, catering to
specific needs like ordering, searching, and uniqueness of elements.

15. **Discuss the use of LINQ (Language Integrated Query) in .NET.**

LINQ is a powerful feature in .NET that enables developers to write queries directly within C# or VB.NET code to
retrieve and manipulate data from different sources such as databases, XML, and collections. It allows for a more
natural and readable way of querying data, similar to SQL.

**Framework-Specific (ASP.NET, .NET Core, etc.):**

16. **What is ASP.NET and how does it differ from ASP.NET Core?**

ASP.NET is a web application framework developed by Microsoft for building web applications using .NET Framework.
ASP.NET Core, on the other hand, is a cross-platform and open-source framework for developing modern web
applications. It's more modular, lightweight, and can run on multiple platforms.

17. **Describe the MVC (Model-View-Controller) architecture in ASP.NET.**

MVC is a design pattern used in ASP.NET for organizing code into three interconnected components:

- **Model:** Represents the data and business logic.

- **View:** Represents the user interface or presentation layer.

- **Controller:** Handles user input, processes requests, and interacts with the model to control the application
flow.

18. **Explain the concept of middleware in ASP.NET Core.**

Middleware in ASP.NET Core is a series of components that are combined to form the request pipeline. Each
middleware component can handle an aspect of an HTTP request or response, such as authentication, logging, routing,
etc.

19. **What is Entity Framework in .NET? How does it simplify database interactions?**

Entity Framework is an Object-Relational Mapping (ORM) framework in .NET that enables developers to work with
databases using .NET objects. It eliminates the need for writing complex SQL queries by allowing developers to interact
with databases using familiar object-oriented programming techniques.

20. **Discuss the differences between .NET Core and .NET Framework.**

- **.NET Core:** It's a modern, cross-platform framework that's open-source and modular. It's designed for building
applications that can run on Windows

You might also like