Courseiva

AI0-001 Implementing AI Solutions Practice Question

A company is deploying an LLM-based chatbot that must output responses in a structured JSON format for downstream processing. Which THREE prompt engineering techniques should the team use to ensure the output is valid and correctly structured? (Select three.)

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Include few-shot examples of correct JSON outputs

Option A is correct because few-shot examples of correct JSON outputs demonstrate the exact structure, key names, and formatting the model should reproduce, which strongly improves adherence to the desired schema. Option C is correct because enabling JSON mode or structured output mode in the model API constrains generation so the response is syntactically valid JSON, directly preventing malformed output. Option D is correct because defining the expected JSON schema in the system prompt gives the model explicit field names, types, and required structure to follow. Option B is not among the marked correct answers; while low temperature can improve determinism, it does not by itself guarantee valid or correctly structured JSON. Option E is not marked correct because chain-of-thought reasoning improves problem-solving but does not enforce JSON syntax or schema compliance.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Include few-shot examples of correct JSON outputs

    Why this is correct

    Few-shot examples demonstrate the exact JSON structure, key names and nesting the model must reproduce, anchoring its output distribution to valid syntax. This satisfies the downstream parsing constraint by showing rather than merely describing the required format.

  • ✓

    Enable JSON mode or structured output mode in the model API

    Why this is correct

    JSON mode constrains decoding so the model can only emit tokens forming syntactically valid JSON, eliminating malformed braces and stray prose. This directly satisfies the requirement that responses always parse for downstream processing, rather than relying on prompt wording alone.

  • ✓

    Define the expected JSON schema in the system prompt

    Why this is correct

    Declaring the schema in the system prompt specifies required keys, types and nesting, giving the model an explicit contract to follow. This satisfies the structured-output constraint by grounding generation in the exact fields downstream processing expects.

About these practice questions

One of 962 original AI0-001 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AI0-001 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI0-001 exam.