Demonstrate a structured workflow for using AI coding tools: first restate the problem and constraints, then break it into small, testable units. Write precise prompts for each unit, run tests, and iteratively refine prompts based on failures. Emphasize that you never write code manually but guide the AI with clear specifications and debugging feedback.
Pro tip: Treat the AI as a junior engineer: give it context, constraints, and examples, and always verify its output with tests. When tests fail, don't just say 'fix it'—provide the exact error and expected behavior to get a targeted fix.
Read the problem statement and partial codebase carefully. Identify inputs, outputs, edge cases, and constraints. Break the solution into small, independent functions or modules that can be tested separately.
For each unit, write a prompt that includes the function signature, expected behavior, input/output examples, and any relevant code context. Ask the AI to generate code and tests for that unit.
Execute the generated tests. If they fail, capture the exact error messages and identify which unit is problematic. Determine whether the issue is in the prompt, the generated code, or the test itself.
Refine the prompt by adding the failure details, clarifying edge cases, or providing counterexamples. Ask the AI to fix the specific issue without breaking other parts. Repeat until all tests pass.
Once individual units pass, integrate them and run the full test suite. If integration fails, use prompts to adjust interfaces or data flow. Ensure the final solution meets all requirements.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.