Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Week 4 Quiz: AI Fundamentals

Total questions: 8

Worksheet time: 6mins

Name
Class
Date
1.

You're setting up the Gemini API for the first time. Where should you store your API key for a Python project?

a)

Hardcode it directly in your Python script: api_key = "AIzaSy..."

b)

Store it in a .env file and load with python-dotenv

c)

Pass it as a command-line argument every time you run the script

d)

Store it in a public GitHub repository for easy access

2.

You're building a chatbot that should always respond as a friendly pirate. Where should you define this behavior?

a)

In each user message: "Respond like a pirate: [user question]"

b)

In the system prompt, set once at the beginning

c)

In the temperature parameter

d)

In the model selection

3.

Which temperature setting should you use when extracting specific dates and dollar amounts from contracts?

a)

temperature=2.0

b)

temperature=1.0

c)

temperature=0.5

d)

temperature=0.0

4.

You want to classify support tickets into 5 categories. How many examples should you include in your prompt for optimal few-shot learning?

a)

1 example (one-shot learning)

b)

3-5 examples (standard few-shot)

c)

20+ examples (many-shot)

d)

No examples (zero-shot is better)

5.

When using response_mime_type="application/json", what problem does this solve?

a)

It makes the API request faster

b)

It reduces API costs

c)

It prevents the LLM from wrapping JSON in markdown code blocks

d)

It allows the model to understand JSON input better

6.

What is the correct way to send a PDF file to Gemini's multimodal API?

a)

Extract text with PyPDF2 first, then send as string

b)

Convert PDF to images, then send each image separately

c)

Read PDF as bytes and send with mime_type="application/pdf"

d)

Upload PDF to cloud storage and send the URL

7.

Your document processor receives a scanned PDF (image-only, no text layer).

What happens when you send it to a multimodal Gemini model via the API?

a)

The API returns an error because it can't read scanned documents

b)

Gemini automatically performs OCR and extracts the text

c)

You must use Tesseract OCR first, then send the extracted text

d)

The API only reads the metadata, not the content

8.

You're processing 100 documents but hit "Rate limit exceeded" after 15 documents. What's the best solution?

a)

Reduce temperature to 0.0 to speed up processing

b)

Add time.sleep(4) between API calls to stay under 15 requests/minute

c)

Switch to a smaller model like Gemini Nano

d)

Process all 100 documents simultaneously with threading