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