Databricks-GenAI-Assoc Design Applications Practice Question
A GenAI application uses a Databricks Model Serving endpoint hosting a foundation model, and the team wants structured JSON output that conforms to a fixed schema for downstream parsing. Responses sometimes include prose or markdown fences that break the parser. Which design change is most likely to produce reliably parseable output?
⚠ Common exam trap
The trap here is treating prompt wording such as 'return only JSON' as equivalent to schema enforcement, when only a declared response format constrains decoding.
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
✓
Define the expected structure with a response format or structured-output parameter on the serving request so the endpoint constrains generation to the schema.
Declaring a response format or structured-output schema makes the endpoint constrain decoding so the generated text matches the required structure, removing prose and markdown fences by construction. Lowering temperature, raising the token limit, or stripping fences afterward only reduce or mask the symptom without guaranteeing conformance.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Add a regex-based post-processor that strips markdown fences and extracts the first balanced JSON object from the raw response.
Why it's wrong here
Post-processing mitigates symptoms but leaves the model free to emit invalid or schema-divergent JSON, which regex cannot repair. It also adds fragile parsing logic that breaks whenever the model's phrasing changes. The requirement is reliable, schema-conforming output, which is better enforced during generation than patched afterward, so this is a workaround rather than a design fix.
- ✗
Lower the temperature to zero and add the phrase 'return only JSON' to the end of the user message.
Why it's wrong here
Temperature zero reduces sampling randomness but does not guarantee schema conformance, and models can still emit prose, markdown fences, or extra keys. A trailing instruction is easily overridden by conflicting content earlier in the prompt. This change improves consistency somewhat but does not reliably produce parseable structured output for a fixed schema.
- ✓
Define the expected structure with a response format or structured-output parameter on the serving request so the endpoint constrains generation to the schema.
Why this is correct
Constrained decoding against a declared response schema forces the model's output to match the expected structure, eliminating prose and markdown fences at generation time rather than relying on post-processing. This is the most reliable design change because it enforces conformance at the source and keeps downstream parsing deterministic for the fixed schema.
- ✗
Increase max_tokens so the model has room to finish the JSON object without being truncated mid-structure.
Why it's wrong here
Raising the token ceiling only helps when truncation is the cause of malformed output. The reported failures are prose and markdown fences, which indicate format noncompliance rather than an early cutoff. Increasing max_tokens leaves the model free to wrap JSON in explanatory text and does not enforce the schema, so the parser would still break.
About these practice questions
One of 330 original Databricks-GenAI-Assoc 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 →
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 Databricks exam blueprint
This Databricks-GenAI-Assoc practice question is part of Courseiva's free Databricks 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 Databricks-GenAI-Assoc exam.