Professional Documents
Culture Documents
`Dynamic Programming` is taking recursive algorithm and caching the results of recursion step for
further re-use.
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;
6 memo[0] = 0;
7 memo[1] = 1;
10 }
12 }
```
### Top-down
Divide Nth problem into subproblems (be careful with overlap cases)
```python
if n == 0:
return 0
if n == 1:
return 1
```
### Half-half
2. sort halves
3. merge halves
fi
fi
fi
fi
fi
fi
fi
### Key Concepts:
2. `Load Balancer`
- instead of using join add project name column to tasks table (in addition to projects table)
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
- not performant
- 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
- `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,
fi
fi
ff