Skip to main content

Quiz: Code Generation

Test your knowledge about AI code assistants and best practices.

30 questions - Click on each question to reveal the correct answer.


Question 1​

What is GitHub Copilot?

A) A version control system
B) An AI-powered code assistant
C) A project management tool
D) A code repository

Show Answer

Correct Answer: B

GitHub Copilot is an AI-powered code assistant that provides real-time code suggestions and completions.


Question 2​

Which company developed GitHub Copilot?

A) Google
B) Microsoft/GitHub/OpenAI
C) Amazon
D) Meta

Show Answer

Correct Answer: B

GitHub Copilot was developed by GitHub (owned by Microsoft) in partnership with OpenAI.


Question 3​

What is Cursor?

A) A mouse pointer
B) An AI-first code editor
C) A database tool
D) A text formatter

Show Answer

Correct Answer: B

Cursor is an AI-first code editor with deep AI integration for multi-file operations and chat capabilities.


Question 4​

Which AI coding tool is completely free for individuals?

A) GitHub Copilot
B) Cursor Pro
C) Codeium
D) All are paid

Show Answer

Correct Answer: C

Codeium offers a completely free tier for individual developers with good quality suggestions.


Question 5​

What should you always do with AI-generated code?

A) Use it immediately
B) Review it before using
C) Delete it
D) Encrypt it

Show Answer

Correct Answer: B

You should always review AI-generated code for correctness, security issues, and best practices before using it.


Question 6​

What type of code needs extra scrutiny from AI generation?

A) Comments
B) Security-critical code
C) Variable names
D) Import statements

Show Answer

Correct Answer: B

Security-critical code (authentication, encryption, input validation) needs extra human review when AI-generated.


Question 7​

What is a common security risk in AI-generated code?

A) Too many comments
B) SQL injection vulnerabilities
C) Too much documentation
D) Consistent formatting

Show Answer

Correct Answer: B

AI may generate code vulnerable to SQL injection (using string concatenation instead of parameterized queries).


Question 8​

What pricing does GitHub Copilot Individual cost?

A) Free
B) $10/month
C) $50/month
D) $100/month

Show Answer

Correct Answer: B

GitHub Copilot Individual costs $10/month or $100/year.


Question 9​

Who gets free access to GitHub Copilot?

A) Everyone
B) Verified students and educators
C) Only businesses
D) No one

Show Answer

Correct Answer: B

Verified students, educators, and open-source maintainers get free access to GitHub Copilot.


Question 10​

What does Amazon CodeWhisperer integrate well with?

A) Google Cloud
B) AWS services
C) Azure
D) IBM Cloud

Show Answer

Correct Answer: B

Amazon CodeWhisperer integrates particularly well with AWS services.


Questions 11-30​

Question 11: What is code completion?

A) Deleting code B) AI suggesting code as you type C) Copying code D) Formatting code

Answer: B - Code completion is AI suggesting code in real-time as you type.

Question 12: What makes a good prompt for code generation?

A) Vague requests B) Specific requirements with context C) Single words D) No requirements

Answer: B - Good prompts include specific requirements, constraints, and context.

Question 13: What should you never commit to a repository?

A) Code comments B) Hardcoded secrets and API keys C) Function names D) Test files

Answer: B - Never commit secrets, even if AI generates them.

Question 14: What is Tabnine known for?

A) Free only B) Privacy-focused with local model option C) Only JavaScript D) Video editing

Answer: B - Tabnine emphasizes privacy with local model options.

Question 15: When is AI code generation high confidence?

A) Security code B) Common patterns and boilerplate C) Complex algorithms D) Threading code

Answer: B - AI excels at common patterns and boilerplate code.

Question 16: What can AI help generate for functions?

A) Only the name B) Documentation and tests C) File extensions D) Computer hardware

Answer: B - AI can generate documentation, docstrings, and unit tests.

Question 17: What is a sign of over-reliance on AI coding?

A) Reviewing code B) Unable to code without AI C) Writing tests D) Learning new languages

Answer: B - Being unable to code without AI indicates over-reliance.

Question 18: What should team policies include for AI code?

A) No rules needed B) Review requirements and security rules C) Only formatting D) License keys

Answer: B - Policies should cover review requirements, security, and testing.

Question 19: What does refactoring with AI involve?

A) Breaking code B) AI suggesting code improvements C) Deleting all code D) Adding bugs

Answer: B - AI can suggest improvements to existing code structure and patterns.

Question 20: What is multi-file context awareness?

A) Opening many windows B) AI understanding relationships across files C) File compression D) File encryption

Answer: B - Understanding how code relates across multiple files.

Question 21: What should be reviewed for AI-generated security code?

A) Only comments B) Everything by an expert C) Nothing D) Only formatting

Answer: B - Security code should be expert-reviewed regardless of source.

Question 22: What is a benefit of Codeium?

A) Most expensive B) Free for individuals with good quality C) Only paid plans D) Only one language

Answer: B - Codeium is free for individuals while maintaining good quality.

Question 23: Why might AI generate outdated code patterns?

A) Intentionally B) Training data may include older code C) User request D) Server issues

Answer: B - Training data includes older code, so patterns may be outdated.

Question 24: What can AI help with when learning new tech?

A) Nothing B) Working examples and syntax help C) Hardware setup D) Account creation

Answer: B - AI can provide working examples and explain syntax.

Question 25: What is code explanation?

A) Writing documentation B) AI describing what code does C) Deleting comments D) Renaming files

Answer: B - AI can explain what existing code does in plain language.

Question 26: What key should trigger suggestion acceptance in most IDEs?

A) Enter B) Tab C) Space D) Escape

Answer: B - Tab typically accepts AI suggestions in most IDEs.

Question 27: What does Cursor's Composer mode enable?

A) Music creation B) Complex multi-file tasks C) Email writing D) Image editing

Answer: B - Composer mode handles complex tasks across multiple files.

Question 28: What licensing concern exists with AI code?

A) None B) May reproduce copyrighted training code C) Always free D) Never an issue

Answer: B - AI might reproduce code from training data with licensing implications.

Question 29: What is essential alongside AI coding tools?

A) Nothing else needed B) Maintaining fundamental coding skills C) Only documentation D) More AI tools

Answer: B - Maintaining coding skills independent of AI is essential.

Question 30: What is the recommended approach for AI-generated code?

A) Trust completely B) AI generates, human reviews and verifies C) Never use D) Use without testing

Answer: B - AI generates suggestions, humans review and verify before use.


Results​

ScoreLevel
27-30Excellent - Strong understanding of AI coding tools
21-26Good - Some review may be helpful
15-20Average - Review the chapters again
Below 15Needs comprehensive review

Return to Module 7 | Continue to Module 8