.Net Framework Flashcards

1
Q

What is the .NET Framework architecture?

A

The .NET Framework architecture is a software platform developed by Microsoft that consists of the Common Language Runtime (CLR) and the Base Class Library (BCL). It provides tools and libraries for building various types of applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the Common Language Runtime (CLR)?

A

The CLR is the execution environment in the .NET Framework responsible for managing memory, handling exceptions, managing security, and executing code written in different languages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain the role of the Base Class Library (BCL) in .NET Framework.

A

The BCL is a collection of classes and functions that provide fundamental building blocks for .NET applications, such as data types, input/output, networking, and more.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Managed Code?

A

Managed code is code that runs within the CLR environment, providing features like memory management, automatic garbage collection, and enhanced security.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Unmanaged Code?

A

Unmanaged code refers to code that is executed outside the CLR’s control and doesn’t adhere to .NET’s memory management and security features.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does the CLR ensure memory management and garbage collection?

A

The CLR manages memory using automatic garbage collection. It keeps track of object references and automatically releases memory when objects are no longer reachable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain the Just-In-Time (JIT) compilation process.

A

The JIT compilation converts Intermediate Language (IL) code into machine-specific instructions at runtime, optimizing performance by adapting to the executing system’s architecture.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are assemblies in .NET?

A

Assemblies are the basic unit of deployment and version control in .NET. They contain compiled code, metadata, and resources needed to execute an application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Differentiate between value types and reference types.

A

Value types store their data directly, while reference types store a reference to their data. Value types are stored on the stack, and reference types are stored on the heap.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the Global Assembly Cache (GAC)?

A

The GAC is a central repository for storing and managing shared assemblies that are accessible across different applications on the same machine.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does .NET provide language interoperability?

A

.NET supports language interoperability through the Common Type System (CTS) and Common Language Specification (CLS), which define a common set of data types and rules for interaction between languages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain the role of the AppDomain.

A

An AppDomain is a lightweight, isolated environment within a process that provides isolation and security boundaries for executing .NET applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Reflection and what is it used for?

A

Reflection allows a program to inspect and interact with metadata about types, methods, properties, and more at runtime. It’s commonly used for tasks like dynamic loading and invocation of assemblies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does .NET handle exceptions?

A

.NET provides a structured exception handling mechanism through try-catch blocks. Exceptions are objects that inherit from the System.Exception class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Boxing and Unboxing?

A

Boxing is the process of converting a value type to a reference type, and unboxing is the process of converting a reference type back to a value type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Explain delegates and events.

A

Delegates are function pointers that allow methods to be treated as first-class objects. Events are a mechanism for implementing the observer design pattern, allowing one object to notify others when a certain action occurs.

17
Q

What are attributes in .NET?

A

Attributes are metadata annotations that provide additional information about types, methods, properties, and more. They are used for various purposes, including code annotations and runtime behaviors.

18
Q

How does .NET achieve code access security?

A

.NET uses a combination of code access security (CAS) and role-based security to control the permissions and privileges of code based on its origin and trust level.

19
Q

What are P/Invoke and COM Interop?

A

P/Invoke (Platform Invocation Services) is used to call functions from native libraries in managed code. COM Interop enables communication between .NET code and COM components.

20
Q

Explain the concept of Threading in .NET.

A

Threading allows multiple tasks to run concurrently within the same process. The System.Threading namespace provides classes and tools for managing threads and synchronization.

21
Q

What is the purpose of the Globalization and Localization features in the .NET Framework?

A

Globalization features allow applications to adapt to different cultures, languages, and regions. Localization features enable the customization of applications for specific cultures.

22
Q

Explain the concept of Application Domains and their benefits.

A

Application Domains provide isolation and separation between different applications within the same process. They enhance security, stability, and manageability by allowing multiple applications to run independently.

23
Q

How does .NET handle multi-threading, and what are potential challenges in multi-threaded programming?

A

.NET provides the Thread class and other synchronization constructs for multi-threading. Challenges include thread synchronization, race conditions, deadlocks, and resource contention.

24
Q

Describe the purpose and usage of the “using” statement in C#.

A

The “using” statement is used for resource management and ensures that disposable objects are properly cleaned up after their use, improving memory management and reducing resource leaks.

25
Q

Explain the differences between IEnumerable and IQueryable interfaces.

A

IEnumerable is used for querying data from in-memory collections, while IQueryable is used for querying data from external data sources (e.g., databases) using deferred execution.

26
Q

What is the purpose of the ADO.NET framework?

A

ADO.NET is used for data access in .NET applications. It provides classes for connecting to databases, executing SQL commands, and managing data retrieval and manipulation.

27
Q

Differentiate between WCF (Windows Communication Foundation) and Web API.

A

WCF is a framework for building distributed services, including SOAP-based and other types of communication. Web API is a framework for building HTTP-based services that adhere to REST principles.

28
Q

What are Dependency Injection and Inversion of Control (IoC)?

A

What are Dependency Injection and Inversion of Control (IoC)?

29
Q

Explain the purpose of the MVC (Model-View-Controller) and MVVM (Model-View-ViewModel) architectural patterns.

A

MVVM (Model-View-ViewModel) architectural patterns.
MVC separates an application into three components: Model (data), View (presentation), and Controller (user interactions). MVVM is a variation that adds a ViewModel to mediate between the Model and View.

30
Q

What is Asynchronous Programming in .NET, and how does it relate to the “async” and “await” keywords?

A

Asynchronous programming allows non-blocking execution of code, enhancing responsiveness. The “async” and “await” keywords in C# simplify asynchronous programming by making it look more like synchronous code.