Code reviewInterview preparation
Intermediate·Concept·2 min read

What review comment would I leave?

Practice this question

Short explanation:

A useful review comment explains an observable problem, its consequence and a concrete improvement. It should be specific enough to act on while leaving room for the author to discuss constraints. Focus on behavior and evidence rather than criticizing who wrote the code or whether AI generated it.

Key points:

  • “Two requests can read the same stock before either saves.”

  • “Please use a conditional atomic update and reject non-positive quantities.”

  • “Add a concurrent-request test to confirm stock and reservation records stay consistent.”

  • Separate blocking correctness/security concerns from optional cleanup suggestions so the author can prioritize.

Interview point:

  • Link the proposed test to the failure scenario and explain why the fix closes that scenario.
Adapted from 11_AI_CODE_REVIEW.md · “What review comment would I leave?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.