Week 2 Flashcards

1
Q

When looking at integration testing, what do we look at?

A

Incremental and non-incremental.

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

When looking at performance testing, what do we look at.

A

Scalability, stability, speed and memory.

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

What do we look for in algorithms?

A

We seek algorithms that are correct (ideally a proof) , efficient, and easy to implement.

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

Will iterative cases always be faster than recursive, or the other way around?

A

No, it is not always the case that one will be faster than the other purely based on whether they are iterative or recursive.

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

How do we determine if an application is too slow?

A

The application is too slow if it doesn’t meet your project’s stated performance requirements.

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

What are some internal factors that could affect an algorithm performance analysis?

A

Runtime and memory requirement.

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

What are some external factors which affect an algorithm performance analysis?

A

Input size, computer specs, compiler quality.

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

How is complexity analysis computed?

There are three.

A
  • Time complexity (The time required)
  • Computational complexity (The number of steps or arithmetic operations)
  • Space complexity (The amount of memory required)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the issues with python’s time module? Why is timeit better?

A

The time module records the start and end. However, it can be effected by alot of outside factors and is considered quite noisy.

The timeit module is better since it helps eliminate non-functional, non-essential time consuming tasks. It is generally more accurate.

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

What is profiling.

A

Profiling is measuring relative system statistics.

It tells us, where most of the time is being spent. (classical profiling)
Which method takes the most time, and which is called the most.

Profiling is not the same as benchmarking or optimizing.

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

What is optimization? Why do we warn not to optimize too quickly?

A

Optimizing is refactoring and enhancing to speed up the code. Optimizing too quickly can lead to code that is barely used being unnecessarily optimized.

In general only optimize if you have a clear idea of what is actually slowing down your code.

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

What is the Pareto Principle?

A

80% of a program’s execution occurs within 20% of its code.

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

What is Big-O Notation? What is it used to specify?

A

Big-O is used to specify an upper bound on a function.

For a bound, choose the smallest simplest function that satisfies the inequality. Choose the inequality.

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

True or false, Big-O ignores the constant in analysis, so g(n) is identical to g(n) = 2n.

A

Yes, Big-O ignores the constant. g(n) and g(n) = 2n are identical.

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

What are the types of Algorithms?

A

Constant
Logarithmic
Linear
N-Log-N
Quadratic
Cubic
Exponential

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

What is considered an efficient algorithm?

A

Quadratic algorithms an above are only practical with small inputs.

Anything log to linear are considered good operation times.

17
Q

What is Big-Omega used to specify?

A

It is used to specify a lower bound on a function.

18
Q

How should we choose the bound for Big Omega?

A

We should choose the largest simple function that satisfies the inequality.

Choose the tightest bound possible.

19
Q

What is Big-Theta used to specify?

A

It is used to specify both upper and lower bounds on a function.

20
Q

When is the only time that we can use Big Theta?

A

We can only use it if big-O and big-Omega have the same complexity.

21
Q

Which case do we usually care the most about? Best, worst or average case?

A

We usually care about the worst case. That is unless the worst case is very unlikely.

Then we would choose the average case.

22
Q

What do we ignore in complexity analysis?

A

Constants, addition, subtraction