Free Databricks Generative AI Engineer Associate practice test

20 questions for the Databricks Generative AI Engineer Associate exam, taken from our 250-question bank and spread across its 6domains by their weighting. No sign-up needed: pick an answer to check it, or open “Show answer & explanation” under any question.

What this test covers

Question 1 · Design applications

A team is designing a multi-stage reasoning pipeline for a scientific research assistant. The pipeline must: synthesize findings from 20 retrieved papers, identify contradictions between studies, and produce a structured literature review with confidence scores. Which combination of chain components is MOST appropriate? (Select THREE)

Select 3 answers.

Show answer & explanation

Correct answers: A, B, D

  • A. A retrieval step that fetches the 20 most relevant paper abstracts and stores them as structured context
  • B. A map step that applies a per-paper extraction prompt to identify key claims and methodology from each abstract individually
  • D. A reduce/synthesis step that consolidates the extracted claims, identifies contradictions, and drafts the structured review

The three correct components are (A), (B), and (D). (A) A structured retrieval step grounds the pipeline in real source material and formats it for downstream processing. (B) A map step processes each paper individually, extracting claims reliably without overwhelming the context window with all 20 papers at once. (D) A reduce/synthesis step consolidates the per-paper extractions, identifies contradictions across studies, and generates the structured review — the core reasoning step. (C) Passing all 20 abstracts in a single zero-shot call risks exceeding context limits, dilutes attention, and is less reliable than the map-reduce approach for contradiction detection. (E) A topic classification step is a useful organizational tool but is not required for the synthesis and contradiction-identification goals stated in the requirement. (F) A separate confidence scoring step is a plausible enhancement but the question asks for the MOST appropriate combination; confidence scoring is best handled as part of the reduce step (D) rather than as an additional stage, and selecting it over the three core architectural components would misrepresent the essential pipeline structure.

Question 2 · Design applications

A generative AI engineer is comparing two approaches for a medical coding task where clinical notes must be mapped to ICD-10 codes. Approach X uses a general-purpose LLM with 20 few-shot examples of note-to-code mappings in the prompt. Approach Y fine-tunes the same base model on 50,000 labeled clinical note-to-ICD-10 pairs. Which statement BEST describes when Approach X would be PREFERRED over Approach Y?

Show answer & explanation

Correct answer: C

  • C. When the ICD-10 code set is updated annually and the task must immediately reflect new codes without model redeployment

(C) is the strongest argument for preferring few-shot prompting (Approach X). When the ICD-10 code set changes annually, a fine-tuned model (Approach Y) would need to be retrained and redeployed to handle new codes, while a few-shot prompt can simply include new examples with updated codes immediately. (A) HIPAA compliance applies to both approaches since both involve the model processing PHI; the compliance concern is about where inference runs, not whether the model is fine-tuned. (B) Stable distribution and abundant labeled data describe the ideal conditions for fine-tuning (Approach Y), not for preferring few-shot prompting. (D) A fine-tuned model generally has lower inference latency and cost than a general-purpose model augmented with a long few-shot prompt; throughput would favor Approach Y, not X.

Question 3 · Design applications

A healthcare technology company is building an LLM application to help clinicians quickly understand a patient's history by processing long clinical notes. The output must be a concise paragraph covering diagnosis, current medications, and recent procedures. Which model task type BEST fits this requirement?

Show answer & explanation

Correct answer: D

  • D. Abstractive summarization

Abstractive summarization (D) is the best fit because the goal is to condense lengthy clinical notes into a coherent, fluent paragraph that captures key themes — a hallmark of abstractive summarization. (B) Text classification assigns a label to input text; it does not produce a narrative paragraph. (A) Named entity extraction would identify individual entities like drug names or procedure codes but would not produce a readable paragraph summary. (C) Instruction-following chat could technically handle this task but is not the canonical task type for batch document summarization, and framing it as a chat interaction introduces unnecessary session-management complexity.

Question 4 · Data preparation

A team is configuring a Databricks Vector Search index to stay synchronized with a Delta table that is updated nightly with new customer support tickets. They want new tickets to become searchable as quickly as possible after each nightly load without manual intervention. Which index configuration BEST meets this requirement?

Show answer & explanation

Correct answer: D

  • D. A Delta Sync index with triggered sync scheduled to run nightly

A Delta Sync index with triggered sync scheduled nightly aligns precisely with the nightly batch update pattern—it will automatically re-sync after each nightly Delta table load without requiring manual intervention, while also being efficient for a batch workload that doesn't need real-time streaming updates. A snapshot index that is manually triggered (option A) requires human intervention and doesn't satisfy the 'no manual intervention' requirement. A snapshot index on a fixed 24-hour schedule (option B) may miss the timing of the nightly load and is less flexible. A Delta Sync index with continuous sync (option C) would also work but is unnecessary and more expensive for a nightly batch pattern—triggered sync is the better fit.

Question 5 · Data preparation

A data scientist is preparing a RAG pipeline for a financial services company. The source documents are quarterly earnings reports in PDF format. After extraction and chunking, the engineer notices that many chunks consist entirely of repeated legal disclaimers that appear verbatim at the end of every report. What is the BEST way to handle these repeated disclaimer chunks before building the vector index?

Show answer & explanation

Correct answer: D

  • D. Filter out or deduplicate chunks whose text matches known boilerplate patterns before embedding and indexing

Repeated boilerplate disclaimers, once embedded, produce nearly identical vectors. Indexing them wastes storage, inflates index size, and—critically—they will frequently be returned as top-k results for queries that happen to use similar legal or financial language, pushing genuinely relevant content out of the retrieved set. Filtering or deduplicating these chunks before embedding prevents this problem at its root. Option C is incorrect—the retrieval model has no built-in mechanism to deprioritize repetitive content; it retrieves based on embedding similarity only. Option A is incorrect—increasing overlap makes chunks larger but does not remove the disclaimer; the disclaimer chunk would still exist. Option B is incorrect—a higher-dimensional model would encode the repeated text with high-dimensional vectors that are still nearly identical to each other, providing no benefit.

Question 6 · Data preparation

A team is evaluating two embedding models for a domain-specific RAG system over medical literature. Model A achieves a recall@10 of 0.78 on a medical question-answering benchmark. Model B achieves a recall@10 of 0.71 on the same benchmark but produces 256-dimensional vectors compared to Model A's 768-dimensional vectors. The team's deployment environment has strict memory constraints. Which THREE factors should the team weigh when making the final model selection decision?

Select 3 answers.

Show answer & explanation

Correct answers: A, B, C

  • A. The memory and storage savings from Model B's lower dimensionality and their impact on deployment feasibility
  • B. Whether the 7-percentage-point recall gap between Model A and Model B is significant enough to affect end-to-end answer quality
  • C. The inference latency of each model during both the chunking/indexing pipeline and at query time

The three relevant factors are: (A) Memory/storage trade-offs—256-dimensional vectors require significantly less RAM for the vector index and less disk storage, which is directly relevant under memory constraints. (B) The retrieval quality gap—a 7-point recall difference must be assessed in the context of downstream answer quality; if the gap translates to meaningfully worse answers, Model A may be worth the memory cost. (C) Inference latency—lower-dimensional embeddings are faster to compute and search, affecting both batch indexing pipeline throughput and real-time query latency. Option D is incorrect—tokenizer parameter count is not a meaningful proxy for embedding quality; the tokenizer and the embedding model are evaluated separately. Option E, while practically relevant in some contexts, is a one-time operational cost and not a fundamental technical trade-off for model selection under the given constraints. Option F is clearly irrelevant.

Question 7 · Application development

A Generative AI engineer is setting up a Mosaic AI Vector Search index on a Delta table containing product catalog data. The table is relatively static — it is updated in a nightly batch job. The engineer wants the simplest operational setup with minimal infrastructure to manage. Which index type and sync mode combination is most appropriate?

Show answer & explanation

Correct answer: B

  • B. Delta Sync index with triggered sync, scheduled nightly after the batch update

A Delta Sync index with triggered sync is ideal for tables updated on a predictable schedule. The engineer can trigger the sync after the nightly batch job completes, keeping the index current without the overhead of continuous sync infrastructure. Continuous sync (A, D) is unnecessary for a nightly-update pattern and adds operational complexity and cost. A Direct Vector Access index (C) requires the pipeline itself to manage upserts/deletes via API calls, which is more complex than simply triggering a managed sync.

Question 8 · Application development

A Generative AI engineer is comparing three candidate LLMs for a Databricks-hosted RAG application using MLflow's LLM-as-judge evaluation. The judge scores each model on correctness (1–5). Results are: Model A averages 4.2, Model B averages 3.8, Model C averages 4.1. However, the team also has a strict SLA requiring median end-to-end latency under 800 ms, and cost must stay below $0.002 per query. After profiling: Model A has p50 latency of 1,100 ms and costs $0.0015/query; Model B has p50 latency of 600 ms and costs $0.0018/query; Model C has p50 latency of 720 ms and costs $0.0019/query. Which model should the team select?

Show answer & explanation

Correct answer: B

  • B. Model B, because it meets both the latency SLA (600 ms < 800 ms) and the cost constraint ($0.0018 < $0.002) while having an acceptable correctness score.

Model B is the only model that satisfies all hard constraints: its p50 latency (600 ms) is below the 800 ms SLA, and its cost ($0.0018) is below the $0.002 limit. Its correctness score (3.8) is lower than Models A and C but remains within an acceptable range. Option A is incorrect: Model A violates the latency SLA (1,100 ms > 800 ms). Caching can help but does not guarantee SLA compliance for novel queries. Option C is incorrect: Model C costs $0.0019/query, which is under $0.002, so actually it does meet the cost constraint—but its latency (720 ms) also meets the SLA. However, Model B has a lower cost ($0.0018 vs $0.0019) and lower latency (600 ms vs 720 ms) than Model C, while Model C's correctness advantage (4.1 vs 3.8) is marginal. Model B remains the better balanced choice. Option D is incorrect: treating hard SLA and cost constraints as soft guidelines is an inappropriate engineering decision for a production deployment.

Question 9 · Application development

A developer is packaging a custom RAG chain as an MLflow ChatModel by subclassing mlflow.pyfunc.ChatModel. They want the model to be deployable as a Databricks Model Serving endpoint that accepts the OpenAI-compatible /invocations payload format. Which method MUST be implemented in the subclass?

Show answer & explanation

Correct answer: C

  • C. predict(context, messages, params)

mlflow.pyfunc.ChatModel requires the predict(context, messages, params) method to be implemented. This method receives a list of ChatMessage objects and returns a ChatResponse, enabling the OpenAI-compatible chat interface for Databricks Model Serving. predict_stream (D) is optional for streaming support. load_context (B) is optional — used for one-time initialization — but not required. generate (A) is not a method on ChatModel. fit (E) belongs to sklearn-style models, not ChatModel.

Question 10 · Application development

A Databricks AI engineer is building a multi-step agent that uses Unity Catalog (UC) functions as tools. During testing they observe that on certain complex queries the agent enters an infinite tool-calling loop, repeatedly calling the same tool with slightly varying arguments and never producing a final answer. Which TWO strategies are MOST effective at preventing this failure mode in a production Databricks agent?

Select 2 answers.

Show answer & explanation

Correct answers: C, E

  • C. Set a maximum iteration limit (max_iterations) on the agent executor so it halts and returns a best-effort answer after a fixed number of steps
  • E. Add explicit stopping criteria in the agent's system prompt instructing the model to synthesize a final answer if the same tool has been called more than once with similar arguments

Setting a max_iterations limit (option C) is a standard, reliable hard stop that prevents infinite loops by capping the total number of reasoning/tool-call steps the agent executor will perform. Adding explicit prompt-based stopping criteria (option E) leverages the model's instruction-following to detect and self-terminate repetitive behavior before hitting hard limits, providing a softer and more graceful exit. Hardcoding logic into the system prompt (option A) destroys the flexibility that makes agents valuable and does not scale. Increasing the context window (option B) allows more tool results to accumulate but does not prevent the loop — it may even make it worse by deferring the point at which the loop is noticed. An output guardrail detecting repeated calls (option D) could work but it sits outside the agent executor loop and would require complex state tracking; it is not a standard Databricks-recommended pattern for this issue, making it less reliable than the two correct options.

Question 11 · Application development

A Generative AI engineer is designing a Mosaic AI Vector Search index over a Delta table that uses Unity Catalog. The source table contains product descriptions and the engineer wants embeddings generated automatically by Databricks. Which combination of conditions must ALL be true for Databricks-managed embedding generation to work? (Select THREE)

Select 3 answers.

Show answer & explanation

Correct answers: A, B, C

  • A. The source Delta table must be Change Data Feed (CDF) enabled
  • B. The engineer must specify an embedding model endpoint (e.g., a Foundation Model API embedding endpoint) when creating the index
  • C. The source table must contain a designated text column whose content will be embedded

For Databricks-managed embedding generation on a Delta Sync index: (A) CDF must be enabled on the source table so the sync process can detect incremental changes; (B) an embedding model endpoint must be specified so Databricks knows which model to use for generating embeddings; (C) a text column must be designated as the source for embedding. Pre-computing embeddings (D) is what the Direct Vector Access index requires — managed embedding generation means Databricks does this automatically. A Direct Vector Access index (E) is the opposite of what is needed; managed embedding works with Delta Sync indexes. The Vector Search endpoint (F) must exist, but this is a prerequisite step, not a condition of the managed embedding feature itself — and it is not among the three core conditions specific to this feature.

Question 12 · Application development

A Generative AI engineer is building a multi-turn customer support chatbot on Databricks. They choose ConversationBufferWindowMemory with k=5. After the conversation reaches 20 turns, what is the behavior of this memory type?

Show answer & explanation

Correct answer: C

  • C. The memory retains only the most recent 5 turns and discards earlier turns entirely

ConversationBufferWindowMemory with k=5 maintains a sliding window of the last k conversation turns. At turn 20, only turns 16–20 are retained in the buffer — earlier turns are discarded. It does not summarize (A) — that is ConversationSummaryBufferMemory. It does not raise an error (D). It does not retain all turns internally while filtering at inference time (B) — the older turns are actually dropped from the buffer object.

Question 13 · Assembling and deploying applications

A team has deployed a RAG chain to a Model Serving endpoint. They enable an inference table so that all requests and responses are logged. After sending several queries, they check the Delta table but find it is empty. Which of the following is the MOST likely cause?

Show answer & explanation

Correct answer: D

  • D. Inference table data is written with a delay; the table may not be populated immediately after requests are sent

Option D is correct: inference table writes are asynchronous and batched, so there is an inherent delay (often several minutes) between when requests are served and when data appears in the Delta table. Engineers should wait before concluding the table is empty. Option C is wrong: inference tables work for all workload types including CPU. Option B is wrong: there is no manual flush API required; data is written automatically in the background. Option A is wrong: inference table logging is automatic at the serving infrastructure level and does not require any changes to the model's predict() code.

Question 14 · Assembling and deploying applications

A Generative AI engineer logs a chain with the following code:

with mlflow.start_run() as run:
    mlflow.langchain.log_model(
        lc_model=chain,
        artifact_path="rag_chain",
        input_example={"messages": [{"role": "user", "content": "What is RAG?"}]}
    )

Later, they load the model for local testing using mlflow.pyfunc.load_model(). Which URI format should they use to load this specific run's model artifact?

Show answer & explanation

Correct answer: A

  • A. runs:/<run_id>/rag_chain

Option A is correct: the runs:/<run_id>/<artifact_path> URI scheme is the standard MLflow format for referencing an artifact logged within a specific run, and it works with mlflow.pyfunc.load_model(). Option B is wrong: models:/ URIs reference registered model versions, not raw run artifacts, and latest is not a valid stage/version designator in Unity Catalog. Option C is wrong: the raw DBFS path can technically work in some configurations but is not the idiomatic or recommended MLflow URI scheme and is fragile across workspaces. Option D is wrong: there is no mlflow:/ URI scheme in the MLflow Python client.

Question 15 · Assembling and deploying applications

A data scientist deploys a registered LLM chain to a Databricks Model Serving endpoint and needs the endpoint to automatically scale down to zero compute units when there is no traffic for an extended period, in order to reduce costs. Which served-entity configuration setting enables this behavior?

Show answer & explanation

Correct answer: C

  • C. Set scale_to_zero_enabled to true in the served entity configuration

Option C is correct: scale_to_zero_enabled: true is the explicit configuration flag that allows a served entity to scale down to zero replicas when idle, eliminating compute costs during periods of no traffic. Option A is wrong: min_provisioned_throughput applies to external/foundation model endpoints with provisioned throughput, not to custom model serving scale-to-zero behavior. Option B is wrong: setting workload size and type controls resource shape but does not by itself enable scale-to-zero. Option D is wrong: auto_capture_config controls inference table logging, not compute scaling.

Question 16 · Assembling and deploying applications

A company's production RAG endpoint is currently running Version 2 of their chain with 100% of traffic. They register Version 3 and configure the endpoint to send 5% of traffic to Version 3 and 95% to Version 2 for a canary evaluation. After 48 hours of positive metrics, they want to promote Version 3 to full production. Which TWO actions complete this promotion while following best practices in Databricks?

Select 2 answers.

Show answer & explanation

Correct answers: C, D

  • C. Assign the champion alias to Version 3 in Unity Catalog so other downstream jobs referencing the alias automatically use the new version
  • D. Update the endpoint's traffic_config to route 100% of traffic to the Version 3 served entity

Options C and D are correct: updating traffic_config to 100% for Version 3 shifts all live traffic to the new version within the same endpoint without downtime, which is the standard promotion step. Assigning the champion (or production) alias to Version 3 in Unity Catalog ensures any downstream code or pipelines that resolve the model by alias automatically use the newly promoted version, completing the lifecycle update. Option A is wrong: deleting Version 2 before traffic is fully migrated is risky and can cause errors if done out of order; best practice is to update traffic first, then remove the old served entity. Option E is wrong: mlflow.transition_model_version_stage() is the legacy Workspace Model Registry API and does not work with Unity Catalog models, which use aliases instead of stages. Option B is wrong: creating a new endpoint and updating DNS is an unnecessarily complex and error-prone approach when the current endpoint already supports multi-version traffic splitting natively.

Question 17 · Governance

Which TWO of the following are valid methods for implementing guardrails against harmful or off-topic content in a Databricks-hosted LLM application? (Select TWO)

Select 2 answers.

Show answer & explanation

Correct answers: B, D

  • B. Using Llama Guard or a similar classifier model as a pre- and post-processing layer to evaluate whether inputs and outputs violate safety policies.
  • D. Defining a structured system prompt that instructs the model on topic scope and refusal behavior, combined with output parsing to enforce response format constraints.

Option B is correct because a safety classifier (like Llama Guard) acting as a guardrail layer is a well-established pattern for detecting policy-violating inputs and outputs before they are surfaced to users. Option D is correct because a carefully designed system prompt establishes behavioral boundaries and out-of-scope refusal instructions, which, combined with output parsing, provides a practical content governance layer. Option C is wrong because a low similarity threshold would filter out relevant on-topic queries, not harmful ones; similarity score alone is not a reliable proxy for content safety. Option E is wrong because temperature=0 only makes the model deterministic; a deterministic model can still produce harmful content if the underlying model weights and prompts lead to it. Option A is wrong because IP restriction is a network access control, not a content guardrail; it does not evaluate the substance of prompts submitted by authorized internal users.

Question 18 · Governance

In Unity Catalog, a team wants to ensure that only users in the ml_engineers group can query a Vector Search index used in a RAG pipeline, while a broader data_analysts group can discover the index exists but cannot retrieve its contents. Which combination of Unity Catalog actions achieves this?

Show answer & explanation

Correct answer: B

  • B. Grant EXECUTE on the index to ml_engineers and grant USAGE on the parent schema to both groups.

Option B is correct because USAGE on the schema allows both groups to discover objects within it (satisfying discoverability for analysts), while EXECUTE on the Vector Search index grants query access exclusively to ml_engineers. Option A is wrong because BROWSE is not a standard Unity Catalog privilege for vector indexes, and SELECT applies to tables/views rather than indexes. Option C is wrong because READ PRIVATE FILES is a privilege for external storage locations, not for Vector Search index query access. Option D is wrong because revoking USAGE at the catalog level from data_analysts would prevent them from discovering any objects in the catalog, which violates the discoverability requirement.

Question 19 · Evaluation and monitoring

A data science team has deployed a RAG-based customer support chatbot on Databricks. They want to systematically evaluate whether the chatbot's answers are grounded in the retrieved documents and not fabricated. Which Mosaic AI Agent Evaluation metric is MOST directly designed to detect this issue?

Show answer & explanation

Correct answer: A

  • A. groundedness

groundedness is the LLM-as-judge metric specifically designed to assess whether the generated answer is supported by the retrieved context, directly targeting hallucination or fabrication. answer_correctness measures whether the answer matches a ground-truth reference, which requires labeled data and doesn't focus on retrieval grounding. chunk_relevance evaluates whether the retrieved chunks are relevant to the question, not whether the answer stays within those chunks. answer_similarity is a semantic similarity score against a reference answer, not a grounding check.

Question 20 · Evaluation and monitoring

An ML engineer wants to monitor a production LLM endpoint for data drift over time using Databricks-native tooling. Which combination of features should they use?

Show answer & explanation

Correct answer: B

  • B. Inference tables and Lakehouse Monitoring

Inference tables automatically log every request and response for a Model Serving endpoint into a Delta table, and Lakehouse Monitoring can then analyze those tables over time to detect statistical drift in inputs, outputs, or quality metrics. Delta Live Tables and MLflow Model Registry are for data pipeline orchestration and model versioning, not endpoint drift monitoring. Feature Store and Model Serving logs is a partial answer—Feature Store tracks feature drift but isn't the native pairing for LLM endpoint monitoring. Unity Catalog lineage and MLflow Tracking handle data/model lineage and experiment tracking, not production drift detection.

Pick an answer on each question to check it. 20 questions in this test.

230 more Databricks Generative AI Engineer Associate questions

Sign up free to start practising, or subscribe (from $4.97/mo) for the full 250-question bank, flashcards and timed mock exams.

Databricks Generative AI Engineer Associate course overview and study guides →