You are on page 1of 2

## The Interview Process

Should have reasonable and well-organized code, use good style.

Think of potential errors?

1. analytical skills - coming up with a solution

2. coding skills - implementing solution in clean code

3. tech knowledge - foundation in CS

4. experience - have you built challenging projects; initiative

5. culture t - good communication

## Recursion and Dynamic Programming

Identify recursion - ` nd n-th...`, `compute all...`, `list the rst n...`

`Dynamic Programming` is taking recursive algorithm and caching the results of recursion step for
further re-use.

### Bottom-up Dynamic Programming

1. build for 1 element

2. based on 1 elem ent build for 2-3

3. scale for more. each next step uses the previous result

(not recursive)

```c++

1 int bonacci(int n) {

2 if (n == 0) return 0;

3 if (n == 1) return 1;

5 int[] memo new int[n];

6 memo[0] = 0;

7 memo[1] = 1;

8 for (int i= 2; i < n; i++) {

9 memo[i] = memo[i - 1] + memo[i - 2];

10 }

11 return memo[n - 1] + memo[n - 2];

12 }

```

### Top-down

Divide Nth problem into subproblems (be careful with overlap cases)

```python

def get_ b_number(n: int) -> int:

if n == 0:

return 0

if n == 1:

return 1

return get_ b_number(n-1) + get_ b_number(n-2)

```

### Half-half

1. merge sort is example - divide into halves

2. sort halves

3. merge halves

fi
fi
fi
fi
fi
fi
fi
### Key Concepts:

1. `Horizontal vs Vertical Scaling`

2. `Load Balancer`

3. `Denormalization` - adding redundant information into a database to speed up reads to avoid


`JOIN`

- two tables - projects and tasks

- instead of using join add project name column to tasks table (in addition to projects table)

4. `NoSQL` - doesn't support joins - structures in a di erent way to scale better

5. `Database Partitioning (Sharding)` - Sharding means splitting the data across multiple machines
while ensuring you have a way of guring out which data is on which machine.

- `vertical` - by feature

- `directory-based`- lookup table for where the data can be found

- single point of failure - if lookup table doesn't work - we can't do anything

- not performant

- `key-based` or `hash-based` - like PAUD does with lid.

- The number of servers should be xed

- changing servers num = relocating data - expensive

6. `Caching` - key-value pairing between app and data store

- when to invalidate cache

7. Asynchronous Processing & Queues

- for slow operations

- can be used for pre-processing - preparing heavy data for when user requests it and it's ok to
be a bit outdated

- if user requests it before it's ready - tell the user we are processing it and will notify them
when done

8. Networking Metrics

- `Bandwidth` - bits/second - max amount of data can be transferred in a unit of time

- `Throughput` - the actual amount of data that is transferred. (when the machines perhaps
aren't operating smoothly)

- `Latency` - transit time - time between the sender sending request and receiver getting it

Unlike `throughput` where at least you have the option of speeding things up through data
compression,

there is often little you can do about `latency`.

9. MapReduce (p642) - program to process large amounts of data

fi
fi
ff

You might also like