3. .NET Questions Flashcards

1
Q

What is CLR?

A

Common Language Runtime: the virtual machine component of Microsoft’s .NET framework and is responsible for managing the execution of .NET programs. In a process known as just-in-time (JIT) compilation, the CLR compiles the intermediate language code known as Common Intermediate Language (CIL) into the machine instructions that in turn are executed by the computer’s CPU. The CLR provides additional services including memory management, type safety and exception handling. All programs written for the .NET framework, regardless of programming language, are executed by the CLR.

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

What is FCL?

A

Framework Class Library is a collection of reusable classes, interfaces, and value types.

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

What is BCL?

A

Base Class Library provides the most foundational types and utility functionality and are the base of all other .NET class libraries. It aims to provide very general implementations without any bias to any workload.

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

What is .NET?

A

.NET is a managed execution environment to build and run applications.

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

What is managed code?

A

Managed code is what C# compilers create. It runs on the CLR, which among other things offer services like garbage collection, runtime type checking, and reference checking.

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

What is unmanaged code?

A

Code not managed by the CLR, which compiles straight to machine language.

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

Are boxing and unboxing generally a good practice?

A

No.

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

What is boxing?

A

A process of converting a value type to the type of an object. When the CLR boxes a value type, it wraps it inside an object and stores it under a managed heap. In general, boxed values use more memory and take a minimum of two memory look-ups to access.

eg.

int i = 123;
object o = i;
~~~
~~~

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

What is unboxing?

A

A process of extracting a value type from an object.

eg.

o = 442;
i = (int)o;
~~~
~~~

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