General Topics Flashcards

First Six Chapters

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?

A

8

21
Q

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

A

4

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
Q

What are the Exponential Complexities?

A

Quadratic, Cubic and Exponential

26
Q

What complexity is the sole member of the Factorial category?

A

Factorial

27
Q

What is the Big O notation for Constant complexity?

A

O(1)
What

28
Q

What is the Big O notation for Linear complexity?

A

O(n)

29
Q

What is the Big O notation for Logarithmic complexity?

A

O(log(n))

30
Q

What is the Big O notation for Log-Linear complexity?

A

O(nlog(n))

31
Q

What is the Big O notation for Quadratic complexity?

A

O(n^2)

32
Q

What is the Big O notation for Cubic complexity?

A

O(n^3)

33
Q

What is the Big O notation for Exponential complexity?

A

O(2^n)

34
Q

What is the Big O notation for Factorial complexity?

A

O(n!)

35
Q

What do the variables (usually n) in Big O notation represent?

A

The size of the inputs into algorithms

36
Q

What are the adjacent complexities of Constant

A

O(1) is the fasted of the set that I’m responsible knowing:
O(log(n)) -> O(1)

37
Q

What are the adjacent complexities of Logarithmic

A

O(n) -> O(log(n)) -> O(1)

38
Q

What are the adjacent complexities of Linear

A

O(nlog(n)) -> O(n) -> O(log(n))

39
Q

What are the adjacent complexities of Log-Linear

A

O(n^2) -> O(nlog(n)) -> O(n)

40
Q

What are the adjacent complexities of Quadratic

A

O(n^3) -> O(n^2) -> O(nlog(n))

41
Q

What are the adjacent complexities of Cubic

A

O(2^n) -> O(n^3) -> O(n^2)

42
Q

What are the adjacent complexities of Exponential

A

O(n!) -> O(2^n) -> O(n^3)

43
Q

What are the adjacent complexities of Constant

A

O(n!) is the slowest algorithm that I’m responsible for knowing:
O(n!) -> O(2^n)

44
Q

In coding interviews, what is the implied base of the logarithm?

A

2

45
Q

Explain O(log(n)) in plain English.

A

Every time the log input doubles, the number of operations need to process that input one increases by one unit.

46
Q

What are the two rules of thumb that indicate a complexity of O(log(n))

A

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.