> ## Documentation Index
> Fetch the complete documentation index at: https://prompt.university/llms.txt
> Use this file to discover all available pages before exploring further.

# Module 1 Quiz

> Test your knowledge of prompting fundamentals

<Info>
  **Time Estimate:** 30-45 minutes\
  **Passing Score:** 80% (12/15 questions)
</Info>

## Assessment Overview

This assessment tests your understanding of the foundational concepts covered in Module 1:

* The prompt-response paradigm
* Prompt structure and components
* In-context learning techniques
* Core prompting principles

<Note>
  Take your time and refer back to the lessons if needed. This is a learning tool, not just a test!
</Note>

***

## Part 1: Multiple Choice Questions (15 questions)

### Question 1: Prompt-Response Paradigm

What does it mean when we say LLMs maximize Pr(y|x)?

<Tabs>
  <Tab title="Your Answer">
    Select the best answer:

    A) The model memorizes training data and retrieves exact matches\
    B) The model calculates probability of outputs given input and selects the most likely\
    C) The model randomly generates text based on keywords\
    D) The model uses a database to look up pre-written responses
  </Tab>

  <Tab title="Correct Answer">
    **B) The model calculates probability of outputs given input and selects the most likely**

    **Explanation:** LLMs are probabilistic models that calculate Pr(y|x) - the probability of output y given input x. They generate text by predicting the most statistically likely sequences based on patterns learned during training.
  </Tab>
</Tabs>

***

### Question 2: In-Context Learning

Which statement about in-context learning is TRUE?

<Tabs>
  <Tab title="Your Answer">
    A) It requires updating the model's parameters\
    B) It only works with very large language models\
    C) It enables task adaptation through examples in the prompt\
    D) It's slower than traditional fine-tuning
  </Tab>

  <Tab title="Correct Answer">
    **C) It enables task adaptation through examples in the prompt**

    **Explanation:** In-context learning allows models to adapt to new tasks by providing examples within the prompt itself, without any parameter updates or training.
  </Tab>
</Tabs>

***

### Question 3: Prompt Components

Which of the following is NOT one of the four core prompt components?

<Tabs>
  <Tab title="Your Answer">
    A) Instruction\
    B) Context\
    C) Temperature\
    D) Output Indicator
  </Tab>

  <Tab title="Correct Answer">
    **C) Temperature**

    **Explanation:** The four core components are: Instruction, Context, Input Data, and Output Indicator. Temperature is a model parameter, not a prompt component.
  </Tab>
</Tabs>

***

### Question 4: Zero-Shot vs Few-Shot

When should you prefer zero-shot prompting over few-shot?

<Tabs>
  <Tab title="Your Answer">
    A) For complex, ambiguous tasks\
    B) For well-defined tasks with strong models\
    C) When you need maximum accuracy\
    D) When working with small language models
  </Tab>

  <Tab title="Correct Answer">
    **B) For well-defined tasks with strong models**

    **Explanation:** Zero-shot works best when the task is clear, the model is capable, and instructions are unambiguous. Complex or ambiguous tasks benefit from few-shot examples.
  </Tab>
</Tabs>

***

### Question 5: Reasoning Guidance

What is the primary benefit of adding "Let's think step-by-step" to prompts?

<Tabs>
  <Tab title="Your Answer">
    A) It makes the model run faster\
    B) It activates deeper reasoning and improves accuracy\
    C) It reduces the length of responses\
    D) It prevents the model from using training data
  </Tab>

  <Tab title="Correct Answer">
    **B) It activates deeper reasoning and improves accuracy**

    **Explanation:** Research shows that explicit reasoning guidance like "Let's think step-by-step" significantly improves LLM performance on reasoning tasks by encouraging systematic thinking.
  </Tab>
</Tabs>

***

### Question 6: Role Assignment

Why does role assignment (e.g., "You are a poet") improve prompt effectiveness?

<Tabs>
  <Tab title="Your Answer">
    A) It changes the model's training data\
    B) It activates relevant patterns from the model's training\
    C) It increases the model's creativity\
    D) It makes the model more confident
  </Tab>

  <Tab title="Correct Answer">
    **B) It activates relevant patterns from the model's training**

    **Explanation:** Role assignment works by activating patterns in the model's training data associated with that role, guiding it toward appropriate vocabulary, style, and knowledge.
  </Tab>
</Tabs>

***

### Question 7: Context Provision

What is the main purpose of providing context in prompts?

<Tabs>
  <Tab title="Your Answer">
    A) To make prompts longer and more impressive\
    B) To ground responses in facts and reduce hallucination\
    C) To confuse the model with extra information\
    D) To test the model's reading comprehension
  </Tab>

  <Tab title="Correct Answer">
    **B) To ground responses in facts and reduce hallucination**

    **Explanation:** Providing context (like in RAG approaches) grounds the model's responses in actual information, preventing it from generating plausible but incorrect answers.
  </Tab>
</Tabs>

***

### Question 8: Format and Delimiters

Why are delimiters (like triple quotes) important in prompts?

<Tabs>
  <Tab title="Your Answer">
    A) They make prompts look more professional\
    B) They clearly separate different parts of the prompt\
    C) They are required by all LLMs\
    D) They increase processing speed
  </Tab>

  <Tab title="Correct Answer">
    **B) They clearly separate different parts of the prompt**

    **Explanation:** Delimiters help models parse prompts correctly by clearly marking boundaries between instructions, context, input data, and expected output format.
  </Tab>
</Tabs>

***

### Question 9: Few-Shot Learning

How many examples typically constitute "few-shot" learning?

<Tabs>
  <Tab title="Your Answer">
    A) 1 example\
    B) 2-5 examples\
    C) 10-20 examples\
    D) 100+ examples
  </Tab>

  <Tab title="Correct Answer">
    **B) 2-5 examples**

    **Explanation:** Few-shot typically means 2-5 demonstrations. One example is "one-shot," and more than 5-10 examples often shows diminishing returns.
  </Tab>
</Tabs>

***

### Question 10: Prompt Clarity

Which prompt demonstrates better clarity and specificity?

<Tabs>
  <Tab title="Your Answer">
    A) "Write about dogs"\
    B) "Write a 300-word article about dog training for first-time owners"\
    C) "Tell me everything about dogs"\
    D) "Dogs are interesting, write something"
  </Tab>

  <Tab title="Correct Answer">
    **B) "Write a 300-word article about dog training for first-time owners"**

    **Explanation:** This prompt specifies the format (article), length (300 words), topic (dog training), and audience (first-time owners), making expectations clear.
  </Tab>
</Tabs>

***

### Question 11: Common Pitfalls

Which is an example of contradictory instructions?

<Tabs>
  <Tab title="Your Answer">
    A) "Be brief but comprehensive"\
    B) "Write in a formal tone"\
    C) "Provide three examples"\
    D) "Explain step-by-step"
  </Tab>

  <Tab title="Correct Answer">
    **A) "Be brief but comprehensive"**

    **Explanation:** "Brief" and "comprehensive" are contradictory. Better: "Provide a comprehensive overview in under 200 words" - this clarifies the priority.
  </Tab>
</Tabs>

***

### Question 12: Template Structures

What is the advantage of using the "Name:Content" format?

<Tabs>
  <Tab title="Your Answer">
    A) It looks more professional\
    B) It provides clear structure and is easy to modify\
    C) It's required by most LLMs\
    D) It reduces token usage
  </Tab>

  <Tab title="Correct Answer">
    **B) It provides clear structure and is easy to modify**

    **Explanation:** The Name:Content format (e.g., "Task: Translation") creates clear structure, reduces ambiguity, and makes it easy to modify individual components.
  </Tab>
</Tabs>

***

### Question 13: Example Quality

In few-shot learning, what matters more?

<Tabs>
  <Tab title="Your Answer">
    A) Quantity of examples\
    B) Quality and diversity of examples\
    C) Length of examples\
    D) Complexity of examples
  </Tab>

  <Tab title="Correct Answer">
    **B) Quality and diversity of examples**

    **Explanation:** Research shows that example quality and diversity matter more than quantity. Well-chosen, diverse examples help the model generalize better.
  </Tab>
</Tabs>

***

### Question 14: Output Format

Why should you specify output format in prompts?

<Tabs>
  <Tab title="Your Answer">
    A) To make parsing and using the output easier\
    B) To make the prompt longer\
    C) To test the model's capabilities\
    D) It's not necessary
  </Tab>

  <Tab title="Correct Answer">
    **A) To make parsing and using the output easier**

    **Explanation:** Specifying format (JSON, bullet points, etc.) ensures the output is structured in a way that's easy to parse and integrate into your workflow.
  </Tab>
</Tabs>

***

### Question 15: Prompting vs Training

How does prompting differ from traditional model training?

<Tabs>
  <Tab title="Your Answer">
    A) Prompting is slower than training\
    B) Prompting requires no parameter updates and enables immediate adaptation\
    C) Prompting only works for simple tasks\
    D) Prompting requires more computational resources
  </Tab>

  <Tab title="Correct Answer">
    **B) Prompting requires no parameter updates and enables immediate adaptation**

    **Explanation:** Unlike training/fine-tuning, prompting works with pre-trained models, requires no parameter updates, and allows immediate task adaptation through natural language.
  </Tab>
</Tabs>

***

## Part 2: Hands-On Project

### Project: Restaurant Recommendation Chatbot

**Objective:** Create a complete prompt system for a restaurant recommendation chatbot that demonstrates all concepts from Module 1.

**Requirements:**

Your prompt system must include:

1. **Role Assignment** - Define the chatbot's persona and expertise
2. **In-Context Learning** - Provide 2-3 example conversations
3. **Clear Structure** - Use proper formatting and delimiters
4. **All Four Principles** - Demonstrate clarity, reasoning guidance, context, and format

**Scenario:**
Users will ask for restaurant recommendations based on:

* Cuisine type
* Price range
* Dietary restrictions
* Location/neighborhood
* Occasion (casual, date night, business, family)

### Project Template

```
[Your prompt system here]

Example structure:

ROLE:
[Define the chatbot's role and capabilities]

GUIDELINES:
[How should it handle queries?]

EXAMPLES:
[2-3 example conversations]

CONSTRAINTS:
[What should it avoid or always include?]

FORMAT:
[How should responses be structured?]
```

### Sample Solution

<Accordion title="View Sample Solution">
  ```
  ROLE:
  You are RestaurantGuru, a knowledgeable and friendly restaurant 
  recommendation assistant with expertise in diverse cuisines and 
  dining experiences. You provide personalized recommendations based 
  on user preferences.

  GUIDELINES:
  1. Always ask clarifying questions if preferences are unclear
  2. Consider all stated requirements (cuisine, price, dietary needs)
  3. Provide 2-3 specific recommendations with brief descriptions
  4. Include key details: price range, atmosphere, signature dishes
  5. Be enthusiastic but honest about each restaurant's strengths

  EXAMPLES:

  Example 1:
  User: "I need a good Italian restaurant for a date night"
  RestaurantGuru: "Great choice for a romantic evening! To give you 
  the best recommendations, could you tell me:
  - Your preferred neighborhood or area?
  - Budget per person ($ = under $30, $$ = $30-60, $$$ = $60+)?
  - Any dietary restrictions?

  This will help me suggest the perfect spot!"

  User: "Downtown, $$, no restrictions"
  RestaurantGuru: "Perfect! Here are my top picks:

  1. **Bella Notte** ($$)
     - Intimate candlelit atmosphere
     - Signature: Homemade pasta, truffle risotto
     - Why: Romantic ambiance, excellent wine list

  2. **Trattoria Luna** ($$)
     - Cozy, authentic Italian
     - Signature: Wood-fired pizzas, osso buco
     - Why: Warm service, great for conversation

  3. **Il Giardino** ($$$)
     - Upscale with garden patio
     - Signature: Seafood pasta, tiramisu
     - Why: Special occasion worthy, beautiful setting

  Would you like more details about any of these?"

  Example 2:
  User: "Quick lunch spot, vegetarian, under $15"
  RestaurantGuru: "I can help! Which area are you in, and do you 
  prefer sit-down or grab-and-go?"

  User: "Near the university, grab-and-go is fine"
  RestaurantGuru: "Perfect for a quick campus lunch:

  1. **Green Bowl** ($)
     - Build-your-own salad and grain bowls
     - Fast, fresh, lots of vegan options
     - 5-minute walk from main campus

  2. **Falafel Express** ($)
     - Mediterranean wraps and plates
     - Generous portions, under $12
     - Popular with students

  3. **Veggie Delight** ($)
     - Indian vegetarian cuisine
     - Daily lunch specials around $10
     - Flavorful, filling options

  All three are quick and budget-friendly!"

  CONSTRAINTS:
  - Never recommend restaurants without considering stated preferences
  - Always provide at least 2 options when possible
  - Include price indicators ($, $$, $$$)
  - Ask follow-up questions if critical information is missing
  - Be honest if you need more details to give good recommendations

  FORMAT:
  Responses should include:
  1. Acknowledgment of user's request
  2. Clarifying questions (if needed)
  3. Recommendations with:
     - Restaurant name and price range
     - Brief atmosphere description
     - Signature dishes
     - Why it fits their needs
  4. Offer for additional information

  Now, ready to help users find their perfect dining experience!
  ```
</Accordion>

### Project Evaluation Criteria

Your project will be evaluated on:

<CardGroup cols={2}>
  <Card title="Role Definition" icon="user-tie">
    Clear persona with defined expertise and approach
  </Card>

  <Card title="Example Quality" icon="star">
    Diverse, realistic examples showing different scenarios
  </Card>

  <Card title="Structure & Format" icon="table">
    Well-organized with clear sections and delimiters
  </Card>

  <Card title="Principle Application" icon="check-double">
    Demonstrates all four core principles effectively
  </Card>
</CardGroup>

***

## Assessment Scoring

### Multiple Choice (15 points)

* 1 point per correct answer
* Passing: 12/15 (80%)

### Hands-On Project (10 points)

* Role Assignment: 2 points
* In-Context Learning: 3 points
* Structure & Format: 2 points
* Principle Application: 3 points

### Total Score

* **Maximum:** 25 points
* **Passing:** 20 points (80%)

***

## Next Steps

<Steps>
  <Step title="Complete the Assessment">
    Answer all questions and complete the hands-on project
  </Step>

  <Step title="Review Your Answers">
    Check the correct answers and understand any mistakes
  </Step>

  <Step title="Achieve 80% or Higher">
    Ensure you understand the core concepts before proceeding
  </Step>

  <Step title="Move to Module 2">
    Ready to learn task-specific prompting patterns!
  </Step>
</Steps>

***

## Congratulations! 🎉

You've completed Module 1: Foundations of Prompting!

You now have a solid understanding of:

* ✅ The prompt-response paradigm and how LLMs work
* ✅ How to structure effective prompts with proper components
* ✅ Zero-shot, one-shot, and few-shot learning techniques
* ✅ The four core principles that make prompts effective

<CardGroup cols={2}>
  <Card title="Review Module 1" icon="rotate-left" href="/module-1/index">
    Revisit any lessons you'd like to review
  </Card>

  <Card title="Start Module 2" icon="arrow-right" href="/module-2/index">
    Learn task-specific prompting patterns
  </Card>
</CardGroup>

<Note>
  **Pro Tip:** Keep the four core principles handy as a reference. You'll apply them throughout Modules 2 and 3!
</Note>
