cs1 Flashcards

1
Q

What <b>CLR</b> stands for?

A

Common Language Runtime

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

Core features of the CLR are…

A
  1. Memory management
  2. Assembly loading
  3. Security
  4. Exception handling
  5. Thread synchronization
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What DEP and ASLR stand for?

A

DEP - Data Execution Prevention

ASLR - Address Space Layout Randomization

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

Uses of Metadata are…

A
  1. Removes need for native C/C++ header and lib files
  2. IntelliSense parses metadata to offer help within VS
  3. CLR’s code verification process uses metadata to ensure code performs type-safe operations
  4. Allows object’s fields to be serialized/deserialized
  5. Allows garbage collector to track lifetime of objects - knows which fields refer to other objects
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an assembly?

A
  • Logical grouping of 1 or more modules or resource files.

- Smallest unit of reuse, security and versioning

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

How to check if .NET is installed and what version?

A
  1. %SystemRoot%\System32\MSCorEE.dll
  2. %SystemRoot%\Microsoft.NET\Framework
  3. .NET Framework SDK -> CLRVer.exe - lists all installed CLR versions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a unit of work for CLR’s JIT?

A

Method

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

When a method get’s JITted? How does it proceed?

A

On first occurence.

  1. Look up method in the assembly’s metadata
  2. Get IL for the method
  3. Allocate block of memory
  4. Compile the IL into native CPU instructions and save in the allocated memory
  5. Modify the method’s entry in the Type’s table to point to the allocated memory block
  6. Jump to the native code in the allocated block
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Two IL characteristic features

A
  1. stack-based - all instructions push operands onto an execution stack. No register manipulation. Easy to create new languages.
  2. Typeless - e.g. single add instruction - determines the types of operands on execution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is IL verification process?

A

During compilation of IL into native CPU instructions CLR performs verification, it checks:

  • correctness of method calls (proper number of parameters etc.)
  • for improper accesses to memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Pros and cons of NGen

A

Pros:
1. Improving startup time
2. Reducing working set - if the assembly is loaded by multiple processes simultaneously
Cons:
1. Can get out of sync (CLR version changes, CPU changes, OS ver. changes, etc.)
2. Inferior execution-time performance

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

What FCL stands for?

A

Framework Class Library

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

What PCL stands for?

A

Portable Class Library

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

What is a Type by CTS’s definition?

A
CTS - Common Type System
Type contains zero or more members such as:
Field
Method
Property
Event
with optional modifiers:
Private
Family - derived only (C#: protected)
Family and assembly - derived in same assembly (C#: not available)
Assembly - only assembly (C#: internal)
Family or assembly - derived or same assembly (C#: protected internal)
Public
Type can only derive from one base class
Every type inherit from System.Object
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

System.Object - what it allows for?

A
  1. Compare two instances for equality
  2. Obtain a hash code for the instance
  3. Query the true type of an instance
  4. Perform bitwise copy of the instance
  5. Obtain a string representation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is CLS?

A

Common Language Specification - a minimal subset of CLR/CTS that must be implemented by all of the languages for CLR.
To check for compliance (for public and protected members): [assembly: CLSCompliant(true)]

17
Q

Interoperability with unmanaged code

A
  1. Managed code can call an unmanaged function in a DLL - Platform Invoke
  2. Managed code can use an existing COM component
  3. Unmanaged code can use a managed type - you can implement a COM component in .NET
18
Q

What is the name of C# compiler exec?

A

csc.exe

19
Q

Compiler’s referenced assembly search order

A
  1. Working directory
  2. Directory that contains CSC.exe (%SystemRoot%\Microsoft.NET\Framework\v4.0….)
  3. Any directories specified with /lib switch
  4. Any directories specified using LIB env variable
20
Q

.NET standard versioning number format

A

Major.Minor.Build.Revision