Interview coding tests
- Listen: usually all the information in the question is useful
- Example: make examples larger, avoid special cases
- Brute force: better to have brute force than nothing at all; don't necessarily code it, maybe just state the runtime
- Optimise
- Walk through your algorithm
- Code
- Test: use small test cases, then edge cases
- Analyse and optimise: check for loops, maths, walk through the code, not the algorithm
Whiteboard
- Use straight lines
- Start top left
- Leave space to insert lines of code
- Modularise up front (use a function that you haven't yet written)
B.U.D.
- Bottlenecks
- Unnecessary work
- Duplicated work
Space / time tradeoffs
- Consider saving time by using extra space (often hash tables)