Code Review Notebook / 01

Full-Stack Code Review

Nine broken snippets, the defect class behind each, and what a senior engineer says out loud

A five-pass method you can run on unfamiliar code under time pressure, then nine real defects: dropped errors, unowned timers, unparsed input, routes that answer three times. Each one names the class, not just the fix.

pages
76
sections
34
editions
Reading, Print, Tablet

Sign in to read it

The whole notebook is free for 7 days. No card, no payment. We ask for an account so the download link belongs to someone.

Sign in with GitHub or Google

What is inside

The full table of contents. Nothing here is hidden: if a section you need is not in this list, the notebook is not the right one and you should not spend a week on it.

  1. The nine cases on one page
  2. 1. The five-pass method
  3. 2. What the interviewer is actually scoring
  4. 3. Case 1: the callback that drops the error
  5. 4. Fixing Case 1, three ways
  6. 5. Depth: the event loop, in the detail that gets asked
  7. 6. Case 2: timers with no owner
  8. 7. Depth: what else goes wrong with timers
  9. 8. Case 3: the query string that was never parsed
  10. 9. Depth: query strings, and the traps inside them
  11. 10. Case 4: the login route that answers three times
  12. 11. Case 4 rewritten
  13. 12. Case 5: the connect() counter
  14. 13. Case 5 rewritten with Redux Toolkit
  15. 14. Depth: the re-render bugs Redux Toolkit does not fix
  16. 15. Case 6: ALTER TABLE on forty million rows
  17. 16. Depth: which ALTER TABLE forms rewrite the table
  18. 17. The safe migration playbook
  19. 18. Case 7: the library schema with no relationships
  20. 19. Depth: the decisions inside that schema
  21. 20. Case 8: the average that should have been a sum
  22. 21. Depth: the accumulator table, and $unwind
  23. 22. Case 9: the producer that sends a null key
  24. 23. Depth: what else the null key changed
  25. 24. Node and JavaScript drills
  26. 25. Express and API drills
  27. 26. React and Redux drills
  28. 27. PostgreSQL drills
  29. 28. MongoDB and Kafka drills
  30. 29. The thirty-second answer, rehearsed
  31. 30. The one-page cheat sheet
  32. 31. The night before
  33. Appendix A. Where each case came from
  34. Appendix B. Answer key index

How to read it

Read with a pen. Every notebook opens with a question to answer before you start and asks you to redo the answer at the end, and the margin in the Print edition exists so you have somewhere to be wrong first. The Tablet edition is 16:9 with vector text, so note apps draw on it rather than treating it as a photograph.

more notebooks