# Revision: Cheat Sheet and Self-Check — AI Coding Assistants: Use Them Well and Review Them Hard

Source: https://www.geekswithgeeks.com/en/ai-coding-assistants/wrap-revision

> Review the habits, risks and workflows from the whole course.

## Cheat sheet

**Modes**: completion, chat, agent; more autonomy needs more review. **How it works**: predicts plausible code, does not verify it. **Prompting**: give files, exact errors and constraints; write tests first; ask for small steps. **Workflows**: explain, write, debug, refactor with tests green before and after. **Review**: hallucinated APIs, off-by-one and empty cases, injection and secrets, read the diff, break the code to test the tests. **Safety**: no secrets in prompts, check policy and licences, agents on a branch with limited permissions, content from outside is data. **Learning**: attempt first, understand always. **Teams**: shared guide, author owns the code, measure outcomes.

## Questions interviewers ask

Be ready to explain: how coding assistants work and why they can be confidently wrong, how you review AI-written code, how you use tests to guide an assistant, what you never paste into a prompt, and how you keep learning while using AI tools.

**Quiz:** An assistant's generated tests all pass. What should you still do?

- [ ] Nothing, green means correct
- [ ] Delete the tests
- [x] Break the code on purpose to confirm the tests can fail
- [ ] Ask the assistant to say they are fine

*Answer:* Break the code on purpose to confirm the tests can fail. Green tests only help if they would turn red when the code is wrong.

**Quiz:** Which of these should never be pasted into an assistant prompt?

- [x] A production database password
- [ ] A public function signature
- [ ] A generic error message
- [ ] A question about syntax

*Answer:* A production database password. Credentials must stay out of prompts because prompts leave your machine.

**Quiz:** You do not understand a block of generated code. What is the best next step?

- [ ] Commit it, it probably works
- [ ] Delete the tests
- [ ] Hide it in a comment
- [x] Ask the assistant to explain it and verify by running it, or simplify it

*Answer:* Ask the assistant to explain it and verify by running it, or simplify it. You are responsible for every line you commit, so understand it or replace it with something you do.
