Omni Flashcards

1
Q

What is a Delegate?

A

A way of passing behavior as a parameter

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

What are Default Constructors?

A

Methods that don’t return anything or take any parameters

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

What are Static Members shared between?

A

Static Members are shared between Instances of a Class

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

What is a Model?

A

A Model is an abstraction of something

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

What does the “new” keyword do?

A

It allocates memory at run time

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

What is Inheritance?

A

If a Class B inherited from Class A then it contains all characteristics (information structure and behavior) of Class A

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

What is a naive way of writing code line by line?

A

Procedural Programming

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

What is Error Handling?

A

Error Handling is the term for all techniques involving Finding and Correcting Errors

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

What are the 3 categories that Operators can be divided into?

A

Unary, Binary, and Ternary

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

What is the term for a variable in a Struct?

A

a Data Member

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

In C#, what is a Field?

A

A Field is a Variable of any type that is declared directly in a Class or Struct. Fields are Members of their containing type.

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

What is the difference between a Function and a Method?

A

A Method is a special type of function with an Implicit Argument Passed (an instance of the class that the method is defined on). This is important, as a Function, in strict terms, should not use or modify anything not in its argument list

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

Where can you access Private Members from?

A

Only from Inside the Class

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

In a Switch statement, it is legal to execute more than one case?

A

Yes

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

Can you instantiate an Abstract class?

A

No

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

What is the “Diamond Problem”?

A

In multiple Inheritance, if intermediate classes inherit from same base class then the 3rd level of child class will have the same behavior from two classes

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

What is Association in OOP?

A

Object interaction with each other is called Association

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

What are the 2 main types of Association?

A
  • Class association (inheritance)

- Object association (simple association, composition, aggregation)

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

What is the difference between “.” and “->” ?

A

The dot operator “.” accesses type through name

The arrow key operator “->” accesses type through a pointer

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

What is the purpose of the scope resolution operator?

A

If you declare a Function inside a Class and define it Outside the Class then you need to use the Scope Resolution Operator “::”

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

What is a Constructor?

A

A Constructor is used to Initialize the Objects of Class. The Constructor is automatically called when the Object is Created. It does not have return type.

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

What is a Destructor?

A

A Destructor is used to free the memory that is allocated through dynamic memory allocation. It destroys an object when it goes out of scope. Destructors use “~” as prefix

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

Can Destructors be overloaded?

A

Yes

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

How is a Destructor called?

A

In reverse order

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

What are Accessors?

A

Accessors are used to access data members that are defined as private.

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

Name four Integer Types

A

Byte, Short, Int, Long. All are also available in Signed and Unsigned versions.

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

Can Interfaces exist on their own?

A

No

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

What is an Interface?

A

A collection of Private instance Methods and Properties that are grouped together

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

What does the term Inheritance mean in OOP?

A

Inheritance is when one class inherits all the Members of another class

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

What is a Struct?

A

Data structures that are composed of several pieces of data, possibly of different types

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

In C#, all Classes are derived from what?

A

The Base Class Parent at the Root of the Class, and ultimately System

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

What are Non-default Constructors?

A

Non-default Constructors are Constructors that include Default Parameters

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

What does Polymorphism allow?

A

All Objects Instantiated from a Derived Class can be Treated as if they were Instances of a Parent Class

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

Are Protected Members accessible anywhere?

A

No, only from code that is either part of the Class or a Derived Class

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

Are Public Members accessible anywhere?

A

Yes

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

Within a Class definition, do all Members have the same accessibility levels?

A

No

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

Which Keyword makes Members Accessible only from code within the assembly (project) where they are defined?

A

Internal

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

What are the 4 Class Definition Modifiers for accessibility?

A

Public, Private, Internal, and Protected

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

Why would you use the Global keyword?

A

If you have a conflict between a Class Name and a Namespace, for example, you can use the Global keyword to access the Namespace

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

If Override is used, can sealed also be used to specify that no further modifications can be made to this method in derived classes?

A

Yes

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

Can Accessors be used to control the access level of the Property?

A

Yes

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

Accessors are defined using what keywords?

A

Get and Set

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

What does the Override modifier do?

A

The Override Modifier is required to extend or modify the Abstract or Virtual implementation of an Inherited Method, Property, Indexer, or Event

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

What is Inheritance in classes?

A

If a Class B inherited from Class A then it contains all the characteristics (information structure and behavior) of Class A

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

What is Generalization?

A

Generalization means multiple Classes can Inherit the same Attributes from the parent Class

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

A Generalization of Cats and Dogs could be?

A. Tabby
B. Mammals
C. Yellow Lab
D. Fur

A

Mammals

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

A Specialization of Fish could be?

A. Under Water
B. Animals
C. Whales
D. Tuna

A

Tuna

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

What is Containment?

A

When one class contains another

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

What is the base class in C#?

A

System

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

Abstract classes can possess what kind of members?

A

Abstract Members and Non-Abstract Members.

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

Can Abstract Classes contain Members that can be Inherited by a Derived Class?

A

Yes

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

Can Interfaces contain Members that can be Inherited by a Derived Class?

A

No

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

When you assign an object to a variable, are you actually assigning that variable with a pointer to the object to which it refers?

A

Yes

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

What does passing a parameter by reference mean?

A

The referenced variable will be used each time a function is run rather than using a constant number

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

A Full Copy is referred to as what?

A

A Deep Copy

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

What is the term for the .Net method of freeing up unused memory?

A

Garbage collection

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

Properties contain a Type Name, a Property Name, and one or both kind of Blocks?

A

Get and Set

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

Do you have to use an Accessor to make a Property useful?

A

Yes

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

Do Properties use the same keywords as Fields and Methods?

A

Yes

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

What does the keyword “value” refer to?

A

Equates to a value of the same type as the property

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

Is Refactoring usually done by hand, or with a tool?

A

A tool

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

What is Refactoring?

A

Code Refactoring is the process of Restructuring existing computer code, Without changing its external Behavior

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

What is an Object?

A

A collection of Variables and possibly Functions

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

Is the main limitation of Automatic Properties that they must include both a Get and Set Accessor?

A

Yes

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

When you inherit a Non-Abstract Member from a Base Class, do you also inherit an Implementation?

A

Yes

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

Why are Properties the preferred way to access the State of an Object?

A

They shield external code from the implementation of data storage within the object

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

With an Automatic Property, you declare what?

A

A Property with a simplified syntax

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

When a Base Implementation is hidden, how can you still access it?

A

By using the Base keyword

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

Can you define Types such as Classes in Namespaces?

A

Yes

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

Can you define Types inside other Classes?

A

Yes

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

Is the most useful function of the Base keyword the capability to pass a reference to the current Object instance to a method?

A

No

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

Like Base, this refers to an Object instance, although it is a Future Object instance

A

No

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

What does the “this” keyword refer to?

A

An Object Instance

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

How do Implicit and Explicit Conversions differ?

A

Implicit: conversion is possible in all circumstances, and the compiler can do it.

Explicit: conversion is possible only in certain circumstances

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

What is the keyword “this” used for in C#?

A

To pass a reference of the current object instance to a method

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

What type of language is C#?

A

a Strongly Typed, Block-Structured language

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

Are Interface Members have implementations (bodies)?

A

No

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

Can Interfaces can contain code bodies?

A

No

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

Why would you want to use the “new” keyword in defining Interface Members?

A

If you want to hide Members inherited from base Interfaces

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

A Class that implements an Interface Must Contain implementations for All Members of that Interface

A

Yes

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

Do Interface values specify how the property data should be stored?

A

No

82
Q

It is possible to Implement Interface Members using the keyword Virtual or Abstract?

A

Yes

83
Q

Is it true Interface Members cannot be Implemented Explicitly by a Class?

A

No

84
Q

It is possible to add a Get block to a property in a Class in which the Interface defining that property only contains a Set block, and vice versa?

A

Yes

85
Q

How do you declare an array?

A

”[ ]”

86
Q

What is the code that allows fields to expand and contract?

A

region and #endregion

87
Q

In what two forms can you copy the Constructor?

A

Deep Copy

Shallow Copy

88
Q

What is the difference between a Class variable and an Instance variable?

A

Class variables only have one copy that is shared by all the different objects of a class, whereas every object has it’s own personal copy of an instance variable. So, instance variables across different objects can have different values whereas class variables across different objects can have only one value.

89
Q

Can Static Methods be instantiated?

A

No

90
Q

What is a Deep Copy?

A

If an object has pointers to dynamically allocated memory, and the dynamically allocated memory needs to be copied when the original object is copied, then a Deep Copy is required.

91
Q

What is a Shallow Copy?

A

A Shallow Copy of an object copies all of the member field values.

92
Q

It is possible to Implement Interface members using the keyword Static or Const?

A

No

93
Q

Can Overloading effect Associativity?

A

No

94
Q

Are Unary operators and Assignment operators right or left associative?

A

Right

95
Q

What is an Explicit Conversion or Cast?

A

Casting is required when information might be lost in a conversion from one type to another, or when the conversion might not succeed for other reasons. A typical example would be numeric conversion to a type that has less precision or a smaller range.

float x = 3.25;
int y = (int)x; // y == 3

96
Q

How would you Cast “x” as an int?

A

(int)x

97
Q

What is the goal of Object Oriented Programming?

A

Modularity and Extensibility

98
Q

Write code using a Ternary Operator that sets x equal to y if x is greater than y, or sets x equal to b if x is less than or equal to y

A

x > y ? x = y : x = b

99
Q

In .NET, do you immediately create operating system-specific native code, or do you compile into Common Intermediate Language code?

A

Common Intermediate Language code

100
Q

What are Collection classes used for in general?

A

Maintaining lists of objects

101
Q

What keyword can you use to declare a variable without specifying a data type explicitly?

A

var

102
Q

Are strings Immutable in C#?

A

Yes

103
Q

Can you apply Access Modifiers to Interface Members?

A

No

104
Q

What would the code look like where a FileInfo class implements an IFile interface?

A

class FileInfo : IFile

105
Q

What keyword would you use to split a Method?

A

partial

106
Q

How might a partial class definition be used?

A

Put the fields, properties, and constructor in one file, and the method in another

107
Q

Can a Method be split between files?

A

Yes. Using partial

108
Q

Can Partial Methods be static?

A

Yes

109
Q

Must a Class that implements an Interface implement all of the Members defined by that interface?

A

Yes

110
Q

A Class that Implements an Interface must implement the members with what modifier?

A

Private

111
Q

What are some restrictions Partial methods have?

A

No return value, No out parameters

112
Q

Properties and Methods can be defined as ______ or ______ in Base Classes to define Inheritance

A

Abstract or Virtual

113
Q

What do Collections enable you to maintain?

A

Groups of Objects

114
Q

What is the Ternary Operator syntax?

A

condition ? do if true : do if false

115
Q

How would you declare a “x” as a nullable int?

A

int? x

116
Q

Why not to use “var” everywhere?

A

“var” isn’t a performance hit, but it can make code harder to understand. “var” obscures the actual variable type, so if the initializer doesn’t return a clearly defined type then you may not be able to tell the what type of data you’re dealing with

117
Q

How would you declare a function called “MyFunc” with a nullable boolean parameter named “flag”?

A

MyFunc (bool? flag) { }

118
Q

How would you declare a function called “EvalPi” with a parameter of type double called “input” that has a default value of “3.14”?

A

EvalPi (double input = 3.14) { }

119
Q

Which type of Case should you use to name a Method or Function in C#?

A.  Camel Case
B.  Snake Case
C.  Pascal Case
D.  _lowerCamelCase
E.  Kebab Case
F.  lowerCamelCase
A

C. Pascal Case

120
Q

Which type of Case should you use to name a Namespace in C#?

A. Camel Case
B. Snake Case
C. Pascal Case
D. Kebab Case

A

C. Pascal Case

121
Q

What is the best practice for naming Interfaces in C#?

A

Start the name with an upper case “I”, followed by Pascal Case. For example, “IMyInterface”

122
Q

Which type of Case should you use to name a Private Field in C#?

A

_lowerCamelCase

123
Q

Which type of Case should you use to name a Local Variable in C#?

A

lowerCamelCase

124
Q

Which type of Case should you use to name a Parameter in C#?

A

lowerCamelCase

125
Q

Which Member has an Accessibility, Return Type, and Parameters?

A

Fields

126
Q

Declare a pointer variable x, which can hold the address of an int type

A

int *x

127
Q

Assign the memory address of x to a pointer variable

A

int ptr = & x;
Console.WriteLine((int)ptr) // Displays the memory address
Console.WriteLine(
ptr) // Displays the value at the memory address.

128
Q

What is the C# name for a Destructor?

A

A Finalizer

129
Q

Can Finalizers be defined in Structs?

A

No

130
Q

How many Finalizers can a class have?

A

1

131
Q

Can Finalizers be inherited?

A

No

132
Q

Can Finalizers be overloaded?

A

No

133
Q

Can a Finalizer be called?

A

No

134
Q

Does a Finalizer take modifiers or have parameters?

A

No

135
Q

How would you write Auto Implemented Properties for a public property called “Name” of type String?

A

public string Name { get; set; }

136
Q

Do you have to instantiate an Object to make use of a Static Class?

A

No. In fact, you can’t

137
Q

What kind of linkage does the keyword Static create?

A

Internal

138
Q

If the keyword Static is used outside of a class, what does that do?

A

That function’s scope is limited to the file where it is declared. It can’t be exported, or called elsewhere

139
Q

How would you create a list of type string?

A

List

140
Q

What does the Abstract Keyword enable you to do?

A

The abstract keyword enables you to create classes and class members that are incomplete and must be implemented in a derived class

141
Q

Can an Abstract class be instantiated?

A

No

142
Q

How many Base Classes can a Class have?

A

1

143
Q

What is Lazy Initialization of an object?

A

Assume you have property that contains a large array of objects that, to be initialized, requires a database connection. If the user never asks to display the Orders or use the data in a computation, then there is no reason to use system memory or computing cycles to create it.

144
Q

What is a wrapper class that provides lazy initialization for any class library or user-defined type?

A

Lazy

145
Q

What is Caching?

A

If you have an expensive object, you save it to process memory and reuse it, instead of running the code to produce it over and over

146
Q

What types of relationships are in OOP?

A

Is-a and Has-a

147
Q

Another name for a Parent Class could be a?

A

Super Class

148
Q

Another name for a Child Class could be a?

A

Sub Class

149
Q

What does the keyword “virtual” allow?

A

For a method to be overrideable when it’s inherited

150
Q

What Keyword is used to make a method behave differently in a sub class than in its super class?

A

override

151
Q

Can an Abstract Method declare a body (or block) ?

A

No

152
Q

Can a Virtual Method declare a body (or block) ?

A

Yes

153
Q

What is another name for a non-abstract class?

A

A concrete class

154
Q

What type of class MUST be overridden, Abstract or Virtual?

A

Abstract

155
Q

What is Polymorphism?

A

How we change the behavior of the base class when we create a sub class

156
Q

What is a Class Hierarchy?

A

The design, or topology, of how classes are inherited from other classes

157
Q

What are the three pillars of OOP?

A

Polymorphism, Encapsulation and Inheritance

158
Q

What Keyword can we use to re-use the name of a method in the base class in the sub class for a different purpose?

A

new

Bonus: This is called Hiding

159
Q

What is Client Code?

A

Some methods and properties are meant to be called or accessed from code outside a class or struct

160
Q

Classes may be declared as _______, which means that one or more of their methods have no implementation

A

abstract

161
Q

True or False, to inherit from an interface means that the type implements all the methods defined in the interface

A

True

162
Q

What does the Keyword Static do?

A

One copy of the class is loaded into memory when the program loads, and its members are accessed through the class name

163
Q

Can you instantiate and initialize class or struct objects, and collections of objects, without explicitly calling their constructor?

A

Yes

164
Q

What are Anonymous Types?

A

Anonymous types provide a convenient way to encapsulate a set of read-only properties into a single object without having to explicitly define a type first. The type name is generated by the compiler and is not available at the source code level.

You create anonymous types by using the new operator together with an object initializer.

“var” is almost always used

165
Q

What is an Extension Method?

A

You can “extend” a class without creating a derived class by creating a separate type whose methods can be called as if they belonged to the original type

166
Q

What are Generics?

A

Generics make it possible to design classes and methods that defer the specification of one or more types until the class or method is declared and instantiated by client code.

For example, by using a generic type parameter T, you can write a single class that other client code can use without incurring the cost or risk of runtime casts or boxing operations

167
Q

What does passing a parameter by reference mean?

A

Passing a parameter by reference means the referenced variable will be used each time a function is run rather than making a copy of the variable, such as with a value type

168
Q

What are some differences between Arrays and Collections?

A

Unlike Arrays, Collections can Control Access to the objects they contain, Search and Sort, and more

169
Q

What does the Sealed Keyword do?

A

The Sealed Keyword enables you to Prevent the Inheritance of a Class Or certain class Members that were previously Marked Virtual

170
Q

Where is a Class stored in memory?

A

On the Heap

171
Q

Where are Structs stored?

A

On the Stack

172
Q

Typically, which is smaller, the Stack or the Heap?

A

The Stack

173
Q

Write a foreach loop that uses regex to look for the word “you” in a string named input

A

foreach(Match m in Regex.Matches(input, “you”)) {}

174
Q

What is IL?

A

Intermediate Language code. It is a partially compiled code

175
Q

What is JIT?

A

Just In Time compilation. In C#, JIT compiles IL into machine language

176
Q

Is it possible to view IL code?

A

Yes, by using a Disassembler, such as DASM

177
Q

Why do we need to compile into IL first? Why not directly to machine code?

A

The developer environment and the runtime environment can be very different. You may develop on Windows 10, but the code may be run on Mac, for example. Intermediate Language can be compiled into almost any platform

178
Q

What language must you code a .NET project in?

A

Trick question. You can code a .NET project in several languages.

179
Q

What is the importance of CLR?

A

Common Language Runtime invokes IL to compile into Native code. Also, Garbage collection is done in the CLR

180
Q

What is unmanaged code?

A

Code that is imported, and used as is, that is not under the control of the CLR. Unmanaged code has its own environment and runtimes.

Importing .dll’s that were written in C++ is one example

181
Q

Does garbage collection run on unmanaged resources?

A

No

182
Q

What is CTS?

A

Common Types System. It ensures that data types created in different languages get compiled to a common data type.

183
Q

What is CLS?

A

Common Language Specification. A set of guidelines that helps ensure any program written in a .NET language can be consumed by .NET CLR.

Rules for different data types, use of pointers, functional programming, etc

184
Q

When an object is instantiated, is it’s pointer stored on the Heap or the Stack?

A

The Stack

185
Q

Where is the data, or values, of an object stored? Heap or Stack?

A

Heap

186
Q

How are Value Types stored as far as the Stack and the Heap are concerned?

A

With Value Types, the value and the pointer are both stored on the Stack.

int, bool, etc

187
Q

How are Reference Types stored as far as the Stack and the Heap are concerned?

A

With Reference Types, the the pointer is stored on the Stack, however the value(s) are stored on the Heap.

string, objects, etc

188
Q

What is Boxing?

A

Moving a Value Type to a Reference Type

189
Q

What is Unboxing?

A

Moving a Reference Type to a Value Type

190
Q

What is the problem with Boxing and Unboxing?

A

Performance. It’s expensive to move data around, especially from Stack to Heap.

191
Q

What is an Array?

A

An Array is a data structure of a series of data of the same type. It is a specific contiguous location in memory and it has a fixed length. (technically yes, an array can be resized, but this is expensive)

192
Q

What is an ArrayList?

A

Flexible length, can mix and match different types

193
Q

What two data types do you get the best of with Generics?

A

Arrays and Lists

194
Q

What is Threading in a simple sense?

A

When you want to run processes in parallel, or more than one process at a time

195
Q

How would you create a variable named v with an anonymous type of Amount = 108 and Message = “Hello”

A

var v = new { Amount = 108, Message = “Hello” };

196
Q

What is the Big O notation for Binary search?

A

O(log n)

197
Q

What is the Big O notation for Simple search?

A

O(n)

198
Q

What is the Big O notation for Quicksort?

A

O(n * log n)

199
Q

What is the Big O notation for Selection Sort?

A

O(n^2)

200
Q

What is the Big O notation for Traveling Salesperson?

A

O(n!)

201
Q

What’s 1 example of a possible problem with Hash Tables?

A

Collisions

202
Q

What is a common way of dealing with Collisions in Has Tables?

A

Chaining