General Topics Flashcards

First Six Chapters (46 cards)

1
Q

What are the core tools for solving coding interview problems?

A

Data Structures and Algorithms

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

Questions to keep in mind when reading a coding interview problem:

A
  • What is the input?
  • What is the output?
  • What is the ask?
  • What transformation is needed?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a Data Structure (General Definition)?

A

A way to organize and manage data

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

What is a Data Structure (Precise Definition)?

A

The collection of 1) data values, 2) the relationships among those values and 3) the operations/functions that can be performed on those values.

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

What is Complexity Analysis

A

The process of determining how efficient and algorithm is.

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

What are the two types of complexity?

A

Time and Space.

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

What do we use Complexity Analysis for?

A

It is how we can measure how “good” an algorithm is compared to other algorithms.

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

What is Time Complexity?

A

A measure of how fast and algorithm runs.

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

What is Space Complexity?

A

A measure of how much auxilliary memory and algorithm takes up.

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

What is Big O notation?

A

Notation for describing time complexity and space complexity of algorithms.

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

Bit

A

Binary Digit

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

What is the fundamental unit of information in Computer Science?

A

Bit. Any data store in a computer is composed of bits.

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

What values can a bit be?

A

Either 0 or 1.

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

Byte

A

A grouping of 8 bits.

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

How many bits (or data values) can a byte represent?

A

If unsigned, 0 to 255 or 2^8 (staring at 0). If signed, -128 to 127 or -2^7 to (2^7 - 1)

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

Fixed-width Integer

A

An integer represented by a fixed number of bits, regardless of the value of the integer.

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

What does “O” stand for in “Big O notation?”

A

Order. It represents the order (i.e. rate) of growth of an algorithm’s running time and/or space requirements in relation to the size of the input.

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

What scenario of algorithm performance does Big O notation aim to emulate.

A

Worst-case or upper-bound performance.

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

What does “n^2” stand for in “O(n^2)?”

A

The running time (and/or space depending on what kind of complexity we are analyzing for) of the algorithm grows proportionally to the square of the input size.

20
Q

How many complexities am I responsible for knowing for my coding interviews?

21
Q

How many categories of complexities am I responsible for know in my coding interviews?

22
Q

What are the categories of complexities I am responsible for knowing in my coding interviews?

A

Linear, Logarithmic, Exponential, Factorial

23
Q

What are the Linear Complexities?

A

Constant and Linear

24
Q

What are the Logarithmic Complexities?

A

Logarithmic and Log-Linear

25
What are the Exponential Complexities?
Quadratic, Cubic and Exponential
26
What complexity is the sole member of the Factorial category?
Factorial
27
What is the Big O notation for Constant complexity?
O(1) What
28
What is the Big O notation for Linear complexity?
O(n)
29
What is the Big O notation for Logarithmic complexity?
O(log(n))
30
What is the Big O notation for Log-Linear complexity?
O(nlog(n))
31
What is the Big O notation for Quadratic complexity?
O(n^2)
32
What is the Big O notation for Cubic complexity?
O(n^3)
33
What is the Big O notation for Exponential complexity?
O(2^n)
34
What is the Big O notation for Factorial complexity?
O(n!)
35
What do the variables (usually n) in Big O notation represent?
The size of the inputs into algorithms
36
What are the adjacent complexities of Constant
O(1) is the fasted of the set that I'm responsible knowing: O(log(n)) -> O(1)
37
What are the adjacent complexities of Logarithmic
O(n) -> O(log(n)) -> O(1)
38
What are the adjacent complexities of Linear
O(nlog(n)) -> O(n) -> O(log(n))
39
What are the adjacent complexities of Log-Linear
O(n^2) -> O(nlog(n)) -> O(n)
40
What are the adjacent complexities of Quadratic
O(n^3) -> O(n^2) -> O(nlog(n))
41
What are the adjacent complexities of Cubic
O(2^n) -> O(n^3) -> O(n^2)
42
What are the adjacent complexities of Exponential
O(n!) -> O(2^n) -> O(n^3)
43
What are the adjacent complexities of Constant
O(n!) is the slowest algorithm that I'm responsible for knowing: O(n!) -> O(2^n)
44
In coding interviews, what is the implied base of the logarithm?
2
45
Explain O(log(n)) in plain English.
Every time the log input doubles, the number of operations need to process that input one increases by one unit.
46
What are the two rules of thumb that indicate a complexity of O(log(n))
1) You are removing half of your inputs for every step or 2) Doubling the inputs only results in one extra step in the algorithm.