My first mistake was fixing the display logic in the UI layer and thinking I was done.
Start by thoroughly reading the README to understand the expected API contract, then reproduce the bug by creating and updating comments while observing the responses. Systematically trace the request flow through the code to identify where the contract is violated, fix each issue, and verify with tests covering status codes, error messages, and authorization.
Pro tip: Demonstrate a test-driven debugging approach: write failing tests for each contract requirement before fixing the code, and consider edge cases like unauthorized access and invalid inputs to ensure a robust fix.
Read the README carefully to list all expected behaviors for comment endpoints, including status codes, response bodies, error messages, and authorization rules.
Use tools like curl or Postman to create and update comments, capturing the actual responses and comparing them to the contract to pinpoint discrepancies.
Follow the request through the code (routes, controllers, services, database) to locate where the behavior diverges from the contract, checking for issues like missing data in responses, incorrect status codes, or skipped authorization checks.
Implement targeted fixes for each identified bug, then re-run your tests and manual checks to confirm the API now meets the contract, including edge cases.
Explain your debugging process, the root causes, and any trade-offs considered (e.g., quick fix vs. refactor), and suggest preventive measures like automated contract tests.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.