Scenario
You’re given a poorly written frontend code change (e.g., a React/TypeScript component + related state and API calls) authored by a junior engineer. The code “works” but is hard to maintain.
Task
Conduct a code review and explain:
-
What issues you would point out
, prioritized by impact (correctness, security, performance, accessibility, maintainability).
-
How you would communicate feedback
so the junior engineer learns (tone, framing, asking questions vs. prescribing).
-
What concrete refactors you would suggest
(component structure, state management, separation of concerns, naming, typing, error handling).
-
What tests you would add or request
(unit, integration, UI/e2e) and what behaviors they should cover.
-
How you’d follow up
after the review (pairing, docs, conventions, future prevention).
Assume you can ask clarifying questions about requirements and constraints.