1. Listen - usually all of the information in the question is useful.
  2. Example - make examples larger, avoid special cases.
  3. Brute force - better to have brute force than nothing at all, don’t necessarily code it, maybe just state the runtime.
  4. Optimise.
  5. Walk through your algorithm.
  6. Code.
  7. Test - use small test cases, then edge cases.
  8. Analyse and optimise - check for loops, maths, walk through the code, not the algorithm.

See Hackerrank’s interview guidelines.

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).