Courseiva
mediumMultiple Choice

Generative AI Leader Practice Question: A developer is using Vertex AI Studio to design a…

A developer is using Vertex AI Studio to design a prompt for a content moderation system. They need the model to return a structured JSON with fields 'category' and 'confidence_score'. Which prompt engineering technique should they use?

⚠ Common exam trap

Generative AI Leader often tests the confusion between prompt engineering hints (role prompts, few-shot) and deterministic output controls (response schemas) — candidates pick few-shot because it 'shows' JSON, but only a response schema enforces it.

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

✓

Use a response schema (structured output) in Vertex AI Studio

Vertex AI Studio supports response schemas (structured output) that constrain the model to return JSON matching a defined schema, guaranteeing fields like 'category' and 'confidence_score' with correct types. This is the purpose-built technique for enforcing structured JSON output rather than hoping the model infers the format.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Set a role prompt instructing the model to act as a content moderator

    Why it's wrong here

    A role prompt shapes the model's persona and tone but does not constrain the output to a JSON schema with 'category' and 'confidence_score'. The scenario requires structured, parseable output. Role prompting would be correct when the task needs a consistent perspective or expertise, not a fixed data format.

  • ✓

    Use a response schema (structured output) in Vertex AI Studio

    Why this is correct

    A response schema constrains Vertex AI Studio output to defined fields and types, guaranteeing valid JSON containing category and confidence_score. This structured output technique satisfies the stem's requirement for reliable machine-parseable JSON, unlike free-form prompting or few-shot examples alone.

  • ✗

    Use zero-shot prompting and rely on the model's ability to infer JSON

    Why it's wrong here

    Zero-shot prompting leaves the output format unspecified, so the model may return prose instead of parseable JSON with the required fields. The scenario demands a reliable structured schema. Zero-shot would be correct for open-ended tasks where format flexibility is acceptable and no downstream parsing is needed.

  • ✗

    Include a few-shot example of the desired JSON output in the prompt

    Why it's wrong here

    A few-shot example demonstrates the desired output shape, but it does not enforce the schema; the model may still emit prose or omit fields. The scenario requires guaranteed structured JSON with named fields. Few-shot prompting would be correct when the goal is guiding tone or style rather than constraining output format.

About these practice questions

One of 1,008 original Generative AI Leader 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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Google Cloud exam blueprint

This Generative AI Leader practice question is part of Courseiva's free Google Cloud 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 Generative AI Leader exam.