Databricks Certified Generative AI Engineer Associate Practice Test – 127 Free Exam Questions with Answers

Databricks Certified Generative AI Engineer Associate

127 questions · instant answer feedback · concise explanations · free

  1. Question 1 of 127A Generative AI Engineer is developing a system that retrieves news articles from 1918 based on a user's query and generates summaries. While the summaries are accurate, they often include unnecessary details about how the summary was generated, which is not desired. What change can the engineer make to resolve this issue?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. Provide few-shot examples to the model or adjust the user prompt to guide the system toward the desired output format.

    Providing few-shot examples or adjusting the user prompt directly shapes the output format and removes unwanted meta-text. Modifying chunk sizes or ingestion pipelines serves retrieval relevance, which fails to address the generation behavior itself.

  2. Question 2 of 127A Generative AI Engineer has developed an LLM-based application to provide answers about internal company policies. The engineer needs to ensure the application avoids hallucinating information or leaking confidential data. Which method is NOT suitable for preventing hallucination or data leakage?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Fine-tune the model on your data, hoping it will automatically learn to avoid inappropriate outputs.

    Simply fine-tuning a model on internal data does not guarantee it will prevent hallucinations or automatically enforce data access restrictions. Guardrails, strict system prompts, and explicit permission-based data retrieval are required for security.

  3. Question 3 of 127A Generative AI Engineer is working with a language model that responds to customer inquiries about product availability, using the phrases "In Stock" if the product is available and "Out of Stock" if it's not. The engineer wants to classify call responses accurately based on customer inquiries. Which prompt will allow the engineer to correctly label call classifications?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. You will be given a transcript of a customer call where the customer asks about product availability. Respond with "In Stock" if the product is available or "Out of Stock" if it's unavailable.

    The correct prompt clearly defines the decision rule based on availability and constrains the output to the required labels. The strongest distractor adds unnecessary JSON formatting and fields, which introduces complexity and potential hallucination errors.

  4. Question 4 of 127A Generative AI Engineer is tasked with building an LLM-based question-answering system that needs to handle newly published documents on a regular basis. The engineer wants to minimize both development effort and operational costs. Which combination of components and configuration will best meet these requirements?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. A. The system should include a prompt, a retriever, and an LLM. The retriever's output is inserted into the prompt, which is then passed to the LLM to generate answers.

    A Retrieval-Augmented Generation pipeline dynamically accesses newly published documents, avoiding the high costs of continuous model retraining. Relying solely on prompt engineering introduces stale knowledge, while utilizing agents introduces unnecessary architectural complexity.

  5. Question 5 of 127A Generative AI Engineer is designing an agent-based LLM system for their favorite monster truck team. The system should be able to answer text-based questions about the team, look up event dates via an API, and query tables for the team's latest standings. What is the best approach for the engineer to integrate these capabilities into the system?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Create a system prompt for the agent listing the available tools, and implement an agent system that runs different calls to handle the queries.

    Defining available tools within the system prompt enables the agent to dynamically interact with external APIs and structured tables. Static architectures like basic Retrieval-Augmented Generation lack the operational flexibility required to trigger real-time external lookups.

  6. Question 6 of 127A Generative AI Engineer is developing a RAG application that will extract context from source documents in PDF format, which contain both text and images. They aim to implement a solution that requires minimal lines of code. Which Python package should be utilized to extract text from these source documents?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. Unstructured

    The Unstructured library is purpose-built to extract and clean text from complex file formats like PDFs using minimal code. Standard libraries like BeautifulSoup only parse HTML or XML, making them unsuitable for raw document extraction. Rely on Unstructured for efficient data preparation.

  7. Question 7 of 127A Generative AI Engineer has received business requirements for an external chatbot. The chatbot needs to understand the types of questions users ask and route them to the appropriate models for answers. For instance, one user might inquire about details for upcoming events, while another might ask about purchasing tickets for a specific event. What is the most suitable workflow for this chatbot?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. The chatbot should be designed as a multi-step LLM workflow. First, it should identify the type of question being asked, then route the query to the appropriate model. For questions about upcoming events, the query should be directed to a text-to-SQL model, while ticket purchasing inquiries should redirect the user to a payment platform.

    Building a multi-step workflow with an initial intent classification step allows the system to route queries to specialized tools or models. Handling everything in one prompt or splitting into multiple chatbots creates unnecessary complexity. Look for options that describe query routing or agentic workflows.

  8. Question 8 of 127A Generative AI Engineer is building a support assistant that answers customer complaints by generating a structured JSON output. The JSON must contain the following fields: {"issue_summary": …, "suggested_action": …, "urgency_level": …}. The LLM used has previously generated verbose and unstructured answers. Which prompt design will most likely yield the required response format reliably?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. "Given the complaint, respond in the following JSON format: { "issue_summary": …, "suggested_action": …, "urgency_level": … }."

    Providing an explicit JSON schema directly in the prompt forces the model to adhere to the required structure and field names. Simple conversational prompts fail to enforce machine-readable formats reliably. Always use clear formatting instructions when structured outputs are needed.

  9. Question 9 of 127A product team wants to create an internal AI assistant to help software engineers identify root causes of production failures by analyzing logs. The assistant must accept logs and return a diagnosis and suggested fix. How should the Generative AI Engineer define the inputs and outputs of this AI pipeline?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. Input: production logs; Output: failure reason and recommended fix

    Defining inputs as production logs and outputs as generated diagnoses directly aligns with the stated application requirements. Using historical tickets or database tables reverses the data flow. For exam questions mapping pipelines, strictly match the data sources and desired business outcomes.

  10. Question 10 of 127A Generative AI Engineer is developing a RAG application to help clinicians answer complex queries based on clinical research PDFs. These documents include footers, disclaimers, and non-content metadata such as watermarks and legal notices. The model's response accuracy has been inconsistent, especially when irrelevant content appears in the retrieved chunks. What should the engineer do to improve the relevance and quality of the RAG outputs?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. Pre-process documents to remove disclaimers, footers, and legal sections before chunking.

    Pre-processing documents to remove irrelevant noise before chunking ensures the vector database contains only meaningful context. Increasing chunk overlap or expanding context windows simply adds more noise to the prompt. Cleaning raw data is always the first step for reliable retrieval.

  11. Question 11 of 127A Generative AI Engineer has created a pipeline that chunks legal documents into structured sections with metadata like clause_id, title, and content_text. The engineer now needs to store this processed data for efficient retrieval using Databricks' native features while ensuring secure access via Unity Catalog. Which sequence of operations should the engineer perform to write this chunked data into Unity Catalog-compliant Delta tables?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. Use Spark DataFrame API to write as Delta → Save to managed Unity Catalog volume → Register table in appropriate schema

    Using Spark to write chunked data into a managed Unity Catalog Delta table provides ACID compliance and centralized security. Saving files as CSV or Parquet bypasses governance features and lacks time travel. Rely on managed Delta tables for secure RAG infrastructure.

  12. Question 12 of 127A Generative AI Engineer has developed a document retrieval system for a pharmaceutical assistant chatbot using scientific articles. They experimented with multiple chunk sizes and retrieval methods but are unsure which configuration yields the best real-world performance. The team demands a measurable way to compare these alternatives before deployment. Which TWO actions should the engineer take to quantitatively evaluate the retrieval system's effectiveness? (Choose two.)

    Select 2 answers.

    Show answer & explanation

    Correct answer: A. A. Use evaluation metrics like Mean Reciprocal Rank (MRR) or NDCG to assess ranking quality · E. E. Build a test set of query-answer pairs and compute precision/recall across retrieval strategies

    Building a labeled test set and calculating standard metrics like precision provides an objective baseline for comparing retrieval strategies. Rank-aware metrics like Mean Reciprocal Rank measure how well the system orders relevant results. Avoid subjective or isolated component metrics for holistic evaluation.

  13. Question 13 of 127A financial advisory firm is deploying a virtual assistant to help users ask questions about their portfolios. The assistant should personalize responses based on the user's risk tolerance, portfolio type, and investment goals. These details are available as metadata. How should the Generative AI Engineer augment the prompt to achieve this?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Inject the metadata fields into the prompt as system context before the user's input

    Injecting metadata directly into the system context grounds the model in the specific user profile before it generates a response. Appending metadata as a footnote happens after generation, meaning it cannot influence the highly personalized output you need.

  14. Question 14 of 127The business team reports that the LLM responses generated by the customer assistant are overly verbose and repetitive. They want the output to be concise and action-oriented without changing the base model. How should the Generative AI Engineer modify the prompt to meet this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Modify the prompt to instruct: "Respond in one sentence. Be direct and actionable."

    Explicit prompt instructions directly steer the style and length of the output without requiring any changes to the underlying model. Raising temperature increases randomness and often makes responses longer, while hard token limits risk truncating important information mid-sentence.

  15. Question 15 of 127A Generative AI Engineer is tasked with building an application that converts customer service call transcripts into concise, structured summaries that include issue type, sentiment, and required follow-up. Which type of LLM should the engineer choose for this task?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. A summarization-capable model with support for structured output

    A summarization-capable model with structured output support reliably extracts fields like issue type directly from text transcripts. A speech-to-text model is the wrong choice because the audio transcription step is already completed.

  16. Question 16 of 127A Generative AI Engineer has successfully trained a custom LLM fine-tuned for customer support scenarios. They now need to deploy this model in Databricks with secure access, full lineage tracking, and versioning support. Which steps must the engineer follow to register and serve the model securely?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. Register the model to Unity Catalog using MLflow → Apply access controls → Deploy to Model Serving

    Registering models in Unity Catalog using MLflow provides the necessary governance, versioning, and lineage tracking before deployment. Saving artifacts directly to DBFS circumvents these centralized security controls and lacks robust audibility.

  17. Question 17 of 127A Generative AI Engineer is building a chain to take user input, format it to match a legacy system, pass it to an LLM, and then post-process the result before returning it to the application front end. The engineer wants to package this logic into a single deployable model. Which approach best supports this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. A. Write a custom pyfunc model with pre- and post-processing logic and deploy via Model Serving

    A custom pyfunc model packages the entire workflow, including pre-processing and post-processing, into a single, deployable artifact. Splitting logic into multiple scripts hosted externally removes the built-in dependency capture, versioning, and governance essential for production.

  18. Question 18 of 127A Generative AI Engineer is working with a government contractor to build a RAG-based assistant that references classified policy documents. The system must prevent sensitive fields like citizen_id and medical_history from being exposed in model outputs. Additionally, the model is expected to return useful responses even when masking is applied. Which approach best balances privacy and output usefulness?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Replace sensitive fields with consistent pseudo-identifiers before chunking to maintain referential meaning.

    Replacing sensitive fields with consistent pseudo-identifiers preserves referential integrity while hiding raw values. Pure deletion breaks context and forces hallucinations, whereas metadata filters cannot redact exposed PII within retrieved text.

  19. Question 19 of 127A Generative AI Engineer has deployed a RAG application to help internal sales teams generate product recommendation summaries for clients. Over time, users report that response quality has declined, and some outputs contain irrelevant product data. The engineer suspects a drop in retrieval or model accuracy but needs to investigate without disrupting the live system. Which combination of techniques should the engineer use to evaluate and monitor the system performance effectively?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Use MLflow to compare prompt variants and log evaluation scores; monitor inference tables for drift and retrieval accuracy.

    Using MLflow to compare prompt variants and monitoring inference tables effectively tracks evaluation metrics and data drift. Token counts lack relevance context, and blind fine-tuning without logging hides pipeline failures.

  20. Question 20 of 127A Generative AI Engineer is comparing two LLMs (Model A and Model B) to power a chatbot that assists in regulatory compliance Q&A. The team has created a dataset of prompts and expected responses with ground truth labels. The final model must balance accuracy and cost for production deployment. Which evaluation setup is MOST appropriate to select the right model?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. Use quantitative evaluation metrics such as BLEU, ROUGE, and exact match against ground truth; combine this with latency and cost metrics.

    Combining quantitative metrics against ground truth with latency and cost provides the necessary accuracy and budget balance. Subjective ratings or grammar checks ignore regulatory correctness, while choosing the cheapest model sacrifices quality.

  21. Question 21 of 127Which library is the most appropriate for creating a multi-step workflow involving large language models (LLMs)?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. LangChain

    LangChain is specifically designed to orchestrate multi-step workflows and chain interactions with large language models. Pandas, TensorFlow, and PySpark handle data processing or model training rather than runtime LLM application orchestration.

  22. Question 22 of 127When developing an LLM application, it is essential to ensure that the data used for training adheres to licensing rules to prevent legal issues. Which action is NOT a proper approach for avoiding legal risks?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. Contact the data curators directly after you've already started using the trained model to inform them.

    Informing data curators after already deploying a model violates proactive compliance and intellectual property guidelines. The strongest distractor, contacting them beforehand, fails because it correctly describes a necessary preventative measure.

  23. Question 23 of 127A Generative AI Engineer is creating a chatbot for a gaming company, with the goal of enhancing user engagement on its platform while users play online video games. Which metric would be most beneficial in increasing user engagement and retention on their platform?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Diversity of responses

    Response diversity ensures chatbot interactions remain dynamic and engaging, which is critical for retaining users in gaming environments. Randomness lacks contextual control, while repetition creates a stale and predictable conversational experience.

  24. Question 24 of 127A team intends to deploy a code generation model to assist their software developers, ensuring support for multiple programming languages. The primary focus is on maintaining high quality in the generated code. Which of the Databricks Foundation Model APIs or models available in the Marketplace would be the most suitable choice?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. CodeLlama-34B

    CodeLlama is explicitly fine-tuned for code generation and understanding across multiple programming languages. General models like Llama or MPT lack this specialized training. Expect to choose domain-specific foundation models when the use case demands high accuracy for targeted tasks like coding.

  25. Question 25 of 127A Generative AI Engineer is responsible for developing an application that utilizes an open-source large language model (LLM). They require a foundational LLM that offers a large context window. Which model would best meet this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. DBRX

    DBRX was designed with a massive context window to handle extensive prompts and long-form retrieval inputs. Older open-source models like Llama 2 have strictly limited context windows. Memorize the context limits of core Databricks models like DBRX to answer these requirements correctly.

  26. Question 26 of 127A Generative AI Engineer is tasked with creating a solution where the user uploads resumes and receives job-fit summaries. The engineer wants the pipeline to extract job-relevant experience, match it with the job description, and then summarize suitability. Which sequence of chain components best satisfies this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Resume Embedder → Retriever → LLM Summarizer

    The standard Retrieval-Augmented Generation pattern requires embedding documents, retrieving relevant context via vector search, and summarizing with an LLM. Skipping the embedding step prevents accurate semantic matching. Memorize the core embedding, retrieval, and generation sequence for exam scenarios.

  27. Question 27 of 127A Generative AI Engineer is developing a medical assistant chatbot to help doctors understand drug interactions. The model occasionally provides speculative or non-FDA-approved guidance in its responses. The engineer wants to minimize this behavior while still enabling accurate answers when evidence exists. Which strategy should the engineer implement to introduce effective guardrails?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. Add post-processing logic to exclude any response containing unsupported phrases

    Post-processing logic acts as an enforceable guardrail by inspecting the generated draft before it reaches the user. While metaprompts help guide behavior, they are advisory and lack the strict, auditable control needed to filter non-compliant medical advice.

  28. Question 28 of 127A Generative AI Engineer is working on a news summarization RAG pipeline. The source documents are long, and users tend to ask high-detail queries. However, inference costs are a major concern. What should the engineer prioritize when selecting the embedding model?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Choose a model with a balance between longer context window and smaller embedding dimension

    Balancing an adequate context window with a smaller embedding dimension controls both storage and inference costs in a RAG pipeline. Always picking the largest available context wastes money, as accuracy can actually drop past certain sequence lengths.

  29. Question 29 of 127A Generative AI Engineer is tasked with building a RAG-based chatbot to help field agents query policy manuals. The application must be reproducible, support experimentation, and integrate well with Databricks-native infrastructure. The team needs to track model lineage and metadata across environments. Which combination of components should the engineer include in their solution?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Model flavor, embedding model, retriever, dependencies, model signature, and input examples

    Packaging elements like the retriever and model signature inside an MLflow model ensures reproducibility and tracks lineage across Databricks environments. Basic pipeline components alone do not provide the governance and experiment tracking required for enterprise deployment.

  30. Question 30 of 127A Generative AI Engineer is designing a GenAI application for a retail company using third-party datasets scraped from the web. Some documents contain licensing terms restricting commercial redistribution. The legal team has raised concerns about potential intellectual property violations. What should the engineer do to reduce the risk of legal exposure while maintaining application functionality?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. Exclude all datasets with restrictive licensing and replace them with internally generated content or data with clear commercial use rights.

    Excluding restrictively licensed datasets and using content with clear commercial rights eliminates infringement risk. Paraphrasing with an LLM or merely adding disclosures does not cure upstream licensing violations.

  31. Question 31 of 127A Generative AI Engineer is processing thousands of industry research papers and needs to store the chunked outputs in a format that supports scalable retrieval, governance, and secure sharing across teams. The solution must support lineage tracking, access control, and integration with downstream LLM pipelines on Databricks. Which storage and governance setup should the engineer implement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Store chunked text in a Delta table within a Unity Catalog volume, applying appropriate schema and permissions

    Storing chunked text in a Delta table within Unity Catalog directly enables centralized governance, column-level lineage tracking, and fine-grained access control. Databricks-specific exam cues favor Delta and Unity Catalog over unmanaged file systems because they integrate seamlessly with downstream vector search.

  32. Question 32 of 127A Generative AI Engineer is developing a GenAI assistant for HR departments that extracts key insights from employee satisfaction surveys. The surveys include open-ended comments and structured ratings. The engineer wants to generate actionable summaries per department and flag potentially harmful or discriminatory language automatically. Which combination of components is MOST appropriate for this solution?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Create a chain with: text cleaner → sentiment classifier → toxicity detector → summarizer

    Building a sequential chain with dedicated text cleaning, sentiment, toxicity, and summarization components provides the necessary modularity and auditability. Exam cues often favor modular pipelines over single prompts because they allow independent logging and transparent safety guardrails.

  33. Question 33 of 127A Generative AI Engineer is assigned to rapidly prototype a question-answering application using RAG. The engineer wants reusable components for document loading, chunking, embedding, retrieval, and integration with OpenAI APIs. Which tool should the engineer choose to streamline this process?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. LangChain

    LangChain provides the necessary abstractions for building a RAG pipeline, including document loaders, text splitters, and wrappers for external APIs. The other tools focus on distributed training, traditional machine learning, or basic NLP preprocessing rather than end-to-end retrieval chaining.

  34. Question 34 of 127A financial analyst team is building an internal GenAI application to surface insights from company reports. These reports have been embedded and stored in Mosaic AI Vector Search. During integration, the retrieval results are suboptimal, and engineers suspect the index query pipeline needs tuning. Which of the following should the engineer do to improve the retrieval performance?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. Reconfigure the retriever using cosine similarity and ensure metadata filtering is enabled

    Reconfiguring the retriever and applying metadata filtering directly improves search precision without requiring a costly system rebuild. However, modifying chunk size is also a standard Databricks tuning step, making the options slightly ambiguous for practical RAG optimization.

  35. Question 35 of 127A Generative AI Engineer is building a multi-stage GenAI workflow to help legal analysts assess regulatory compliance across multiple jurisdictions. The process involves: 1. Extracting region-specific legal entities 2. Comparing them against jurisdictional rules 3. Generating a compliance summaryThe engineer wants to define the reasoning pipeline in a way that enables modular and reusable components.Which of the following is the best initial approach to designing the tool sequence for this task?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: H. C. Prompt the LLM with multiple documents at once and let it infer jurisdictional compliance from scratch.

    Using a sequential chain of discrete tools provides modularity, testability, and reusable components for each pipeline stage. Summarizing before extracting entities destroys intermediate reasoning steps, and single prompts lack traceability.

  36. Question 36 of 127A Generative AI Engineer is designing a GenAI application to support contract reviewers in identifying key clauses from legal documents and suggesting missing terms based on business standards. The system should: – Extract clause types and content – Identify missing critical clauses – Recommend standardized wording for complianceThe engineer must translate these requirements into a structured AI pipeline with clearly defined inputs and outputs.Which input/output mapping best supports the construction of this pipeline?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: G. B. Input: Raw document text; Output: Structured JSON with extracted clauses, missing clause types, and recommended additions

    Mapping raw text to a structured JSON object cleanly supports extraction, gap analysis, and recommendations. Plain English summaries lose structured clause data, and starting from metadata skips necessary extraction steps.

  37. Question 37 of 127A Generative AI Engineer is building a knowledge assistant for a financial services firm using thousands of quarterly earnings reports. These reports are highly structured, with repeated sections such as "Executive Summary," "Risk Factors," and "Cash Flow Analysis." Each document exceeds 50 pages. The engineer needs to optimize chunking to ensure both semantic relevance and minimal retrieval latency when answering investor questions.Which strategy should the engineer adopt?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. B. Chunk based on document headings and sections to preserve semantic boundaries, then apply re-ranking after retrieval

    Chunking by headings preserves semantic boundaries, and adding a re-ranking step optimizes relevance. Fixed-length windows add latency, and discarding short sections risks losing critical risk factor data.

  38. Question 38 of 127A Generative AI Engineer is building an internal code assistant to help developers write and debug Python functions. During early testing, the LLM often hallucinates code, including non-existent libraries and APIs. The team wants to reduce such errors while preserving the assistant's usefulness and creativity. Which approach should the engineer take to reduce hallucinations without overly restricting model behavior?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Add a metaprompt instructing the model: "Only generate code that uses standard Python libraries and has been tested"

    Adding explicit metaprompt instructions constrains the model to standard libraries, directly mitigating package hallucinations while preserving overall flexibility. Avoid extreme temperature limits or rigid deterministic rules because they destroy the creative problem-solving utility expected from large language models.

  39. Question 39 of 127A Generative AI Engineer is building a GenAI application for a customer service use case. The model needs to return responses with clearly separated sections: a brief summary of the user's issue, a recommended next action, and a confidence score. The LLM being used has a tendency to respond with natural language paragraphs that lack structure. The engineer wants to ensure that the model output strictly conforms to a structured, machine-readable format that downstream systems can parse without ambiguity.Which of the following approaches will MOST reliably help the engineer achieve this?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. C. Format the prompt to say: "Respond with a JSON object using fields: summary, action, confidence_score. Do not use natural language outside the JSON."

    Formatting the prompt to explicitly request a JSON object with specific fields reliably enforces machine-readable outputs. Temperature zero reduces randomness but does not guarantee structure, whereas few-shot examples merely nudge style.

  40. Question 40 of 127A Generative AI Engineer is tasked with creating a GenAI system to assist analysts in reviewing and escalating cybersecurity incidents. The input is a stream of event logs, and the output must include a structured incident summary and a recommended escalation level. The business team emphasizes that the AI should clearly differentiate between routine events and critical anomalies using multiple evaluation criteria across the pipeline.Which of the following pipeline designs best aligns with the business need for structured, multi-stage reasoning and traceability?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: E. D. Prompt the LLM with raw logs and ask it to identify and escalate the most severe events in one response

    Using modular tools provides structured, traceable multi-stage reasoning with clear evaluation hooks. Single prompts lack traceability, and manual escalation fails to meet the need for automated, multi-criteria evaluation.

  41. Question 41 of 127A Generative AI Engineer is building a RAG application that consumes scanned legal documents in .tiff and .png formats. These documents contain multiple fonts, handwritten signatures, and watermarks. The goal is to extract clean, usable text from these files to feed into an embedding pipeline. The engineer wants a solution that minimizes development time and integrates well with Python-based downstream processing.Which approach should the engineer choose?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. A. Use pytesseract to extract text, followed by post-processing to clean noise

    Using an established OCR library minimizes development time and integrates easily with Python pipelines. HTML parsers cannot read image pixels, and training a custom model introduces unnecessary complexity and cost.

  42. Question 42 of 127A Generative AI Engineer is reviewing the performance of a RAG pipeline used in a technical support assistant. Users report that the system often retrieves irrelevant context when asked product-specific configuration questions. The engineer suspects that the chunking strategy is too coarse-grained for the level of specificity required. To improve retrieval precision without excessively increasing storage or latency, the engineer wants to experiment with advanced retrieval evaluation. Which TWO actions should the engineer take to optimize chunking and validate improvements?

    Select 2 answers.

    Show answer & explanation

    Correct answer: B. A. Apply dense passage retrieval (DPR) with shorter chunk lengths and compare Recall@k · D. C. Use a test set of known queries and expected chunks to compute NDCG and precision

    The correct actions use dense passage retrieval with shorter chunks and validate improvements using labeled test sets. For the exam, pair structural changes like chunk size with objective offline metrics like NDCG rather than subjective checks.

  43. Question 43 of 127A small startup focused on cancer research wants to create a Retrieval-Augmented Generation (RAG) application using Foundation Model APIs. Since the startup is mindful of costs but still wants to deliver a high-quality product for their customers, what would be the best approach to achieve this balance?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Choose a smaller language model that is specifically trained for the cancer research domain.

    Choosing a smaller, domain-specific language model optimizes the balance of inference cost and task-specific accuracy. For the exam, remember that restricting document access or user queries harms the application's utility and does not scale appropriately.

  44. Question 44 of 127A Generative AI Engineer has developed a Retrieval-Augmented Generation (RAG) application to find answers for questions about a series of fantasy novels posted on the author's online forum. The text from the novels is divided into chunks, embedded into a vector store with metadata (e.g., page number, chapter number, and book title), retrieved in response to user queries, and passed to a language model for generating answers. Initially, the engineer relied on intuition to select the chunking strategy and related configurations, but now wants to optimize these choices using a more systematic approach. Which TWO strategies should the Generative AI Engineer adopt to refine their chunking strategy and parameters? (Choose two.)

    Select 2 answers.

    Show answer & explanation

    Correct answer: C. C. Select an appropriate evaluation metric (e.g., recall or NDCG) and experiment with variations in the chunking strategy, such as splitting by paragraphs or chapters, to identify the best-performing approach. · E. E. Develop a metric where the LLM acts as a judge, scoring how well previous questions are answered by the retrieved chunks. Adjust the chunking parameters based on the results of this metric.

    Options C and E are correct because systematically optimizing chunking requires defining measurable retrieval metrics or using an LLM-as-a-judge to evaluate ground truth. Simply asking the model to guess token counts or changing unrelated pipeline components does not measure actual retrieval performance. Expect questions on evaluating chunking variations.

  45. Question 45 of 127A Generative AI Engineer is building a RAG application on Databricks to help users ask questions about the official rules and technical regulations of a sport they are learning. Which sequence of steps most accurately describes how the engineer should build, evaluate, and deploy the RAG application?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Ingest documents from a source → Index the documents and store them in Vector Search → Develop and test the RAG chain with representative queries → Retrieve relevant documents and generate responses using the LLM → Evaluate the RAG application → Deploy the application using Model Serving

    Option B is correct because building a RAG application on Databricks follows a specific workflow of ingesting data, indexing it, testing the chain, evaluating performance, and finally deploying. You must always evaluate the retrieval and generation quality before pushing the application to production. Look for the standard sequence.

  46. Question 46 of 127A Generative AI Engineer is developing a live sports commentary platform powered by a language model. This platform delivers real-time updates and AI-generated analyses for users who prefer live summaries over reading outdated news articles. Which tool would enable the platform to access real-time game data for generating up-to-date analyses based on the most recent scores?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. Feature Serving

    Option C is correct because Databricks Feature Serving provides low-latency, real-time access to structured features like live sports scores. Foundation Model APIs generate text, but they cannot fetch live external data independently. Rely on Feature Serving to bridge real-time data streams with deployed models.

  47. Question 47 of 127A Generative AI Engineer is working with a provisioned throughput model serving endpoint within a RAG application. They want to track both incoming requests and outgoing responses for the endpoint. Currently, they are using a micro-service between the endpoint and the user interface to log the information to a remote server. Which Databricks feature can they use to handle this logging task more efficiently?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. Inference Tables

    Option D is correct because Databricks Inference Tables automatically capture incoming requests and outgoing responses for Model Serving endpoints. This native feature eliminates the operational overhead of building custom logging microservices. Rely on Inference Tables for built-in production monitoring and auditing.

  48. Question 48 of 127A Generative AI Engineer is tasked with designing an LLM-based application that fulfills a business requirement: answering employee HR-related questions by referencing HR PDF documentation. Which set of high-level tasks should the engineer's system perform?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. Break the HR documentation into chunks and store them in a vector database. Use the employee's question to retrieve the most relevant chunks, and use the LLM to generate a response based on the retrieved documentation.

    Option D is correct because breaking documentation into chunks and storing them in a vector database enables targeted, cost-effective retrieval before generation. Averaging embeddings or summarizing entire documents loses the granular context required for accurate answers. Stick to standard retrieval-augmented generation patterns for document tasks.

  49. Question 49 of 127A Generative AI Engineer has developed a Retrieval-Augmented Generation (RAG) application that helps employees retrieve answers from an internal knowledge base, such as Confluence pages or Google Drive. After receiving positive feedback from internal testers, the engineer now wants to formally assess the system's performance and identify areas for improvement. What is the best approach for the engineer to evaluate the system?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Create a dataset to separately test the retrieval and generation components of the system. Utilize MLflow's built-in evaluation metrics for this assessment.

    Evaluating retrieval and generation components separately using MLflow metrics pinpoints specific failure areas in a RAG pipeline. Option A fails because cosine similarity alone cannot assess generation fluency or correctness, making a holistic, component-level approach necessary for optimization.

  50. Question 50 of 127A Generative AI Engineer has successfully trained a large language model (LLM) on Databricks, and it is now ready for deployment. Which of the following steps outlines the easiest process for deploying a model on Databricks?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Log the model using MLflow during the training phase, register the model directly in Unity Catalog via the MLflow API, and start a serving endpoint.

    Logging the model with MLflow, registering it in Unity Catalog, and starting a serving endpoint is the most seamless deployment path on Databricks. Option A fails because pickling models introduces security risks and bypasses the native governance provided by MLflow model tracking.

  51. Question 51 of 127A Generative AI Engineer has developed an LLM application utilizing the provisioned throughput Foundation Model API. As the application is ready for deployment, the engineer realizes that the volume of requests is not high enough to justify creating a dedicated provisioned throughput endpoint. They are looking for a strategy that offers the best cost-effectiveness for their application. What strategy should the Generative AI Engineer adopt?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Deploy the model using pay-per-token throughput, as it provides cost guarantees.

    Pay-per-token throughput provides cost effectiveness for applications with unpredictable or low traffic volumes by aligning expenses directly with usage. Provisioned throughput guarantees capacity but wastes resources for low-volume applications, making it an inefficient strategy here.

  52. Question 52 of 127A Generative AI Engineer is developing an LLM to create article summaries in the form of poems, specifically haikus, based on the article content. However, the initial outputs from the LLM do not align with the desired tone or style. Which approach will NOT help improve the LLM's responses to achieve the desired outcome?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Utilize a neutralizer to standardize the tone and style of the source documents.

    Utilizing a neutralizer strips stylistic variations from source documents, directly reducing the linguistic richness needed to generate haikus. The other options actively steer the model through direct instructions, few-shot examples, or fine-tuning.

  53. Question 53 of 127A Generative AI Engineer is developing an LLM-powered application that requires access to current news articles and stock prices. The design specifies using stock prices stored in Delta tables and finding the latest relevant news articles through internet searches. How should the Generative AI Engineer architect their LLM system?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. Create an agent equipped with tools for SQL querying of Delta tables and web searching, and provide the retrieved data to an LLM for response generation.

    Creating an agent with SQL and web search tools enables the dynamic retrieval of real-time stock prices and current news. Option C fails because pre-storing news in a vector database leads to stale information, whereas agents fetch live data during execution.

  54. Question 54 of 127A Generative AI Engineer is designing a multi-agent workflow for a financial portfolio analysis assistant. One agent should extract key metrics from reports, another should interpret performance trends, and a final agent should recommend allocation adjustments. The system must support asynchronous execution and function exposure for each agent stage. Which design approach should the engineer use to enable this multi-stage reasoning system?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Use LangChain's Agent Framework with distinct tools exposed to agents for parsing, interpreting, and suggesting

    Using an agent framework with distinct tools supports asynchronous execution and multi-stage reasoning for complex workflows. Option A fails because chaining tasks in a single prompt hides intermediate steps and prevents dynamic function exposure.

  55. Question 55 of 127A Generative AI Engineer is reviewing outputs from an LLM-based legal assistant. While the assistant performs well on document summaries, it occasionally misrepresents clause intent or misses implicit legal language. The engineer wants to implement a method to proactively detect such issues before deployment. Which approach is MOST appropriate for identifying and addressing these quality issues?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Evaluate responses using an LLM-as-a-judge setup that scores correctness, completeness, and alignment with legal standards

    Using an LLM-as-a-judge setup to score responses provides an automated, repeatable way to catch misrepresentations before production. Option D fails because temperature only controls variation; deterministic settings do not inherently fix hallucinations.

  56. Question 56 of 127A Generative AI Engineer is deploying a domain-specific summarization model to process lengthy scientific reports. The base model often omits crucial terminology or dilutes technical meaning in the summaries. The team wants to influence the style and structure of the summaries without fine-tuning the model. Which strategy will MOST effectively help the engineer guide the LLM toward desired outputs?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Rewrite the prompt as a metaprompt that instructs the LLM to retain all technical terms and produce a structured summary with sections like "Background", "Methods", and "Findings"

    Rewriting the prompt as a detailed metaprompt directly forces the model to preserve terminology and adhere to a specific structure. Option D fails because relying on zero-shot prompting with appended examples lacks the strict constraints needed for formatting.

  57. Question 57 of 127A Generative AI Engineer is developing an application that needs to shorten a paragraph-length memo field into a concise, single-sentence summary that captures the intent of the original memo and fits within the UI constraints. Which category of Natural Language Processing (NLP) tasks should the engineer consider when evaluating suitable LLMs for this use case?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. Summarization

    Summarization is the correct NLP task because it specifically condenses longer text into a shorter form while preserving core information. The other options are incorrect because text classification assigns labels, and a sentencizer merely splits text without summarizing.

  58. Question 58 of 127A Generative AI Engineer is building an LLM-powered application where documents used by the retriever are chunked into segments of up to 512 tokens. Since the application prioritizes low latency and cost over response quality, the engineer is evaluating available models based on context length, size, and embedding dimensions. Which context length option best aligns with these performance and cost priorities?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. A. Context length 512: smallest model size is 0.13 GB with embedding dimension 384

    Choosing the 512 context length model with the smallest footprint keeps latency and compute costs minimized for chunked retrieval. The other options waste memory and compute by providing unnecessary context limits and larger embedding dimensions for the given chunk size.

  59. Question 59 of 127A Generative AI Engineer is designing a system to recommend the most suitable employee for newly defined projects. The employee is selected from a large pool of team members. The selection needs to consider the employee's availability during the project timeline and how closely their profile aligns with the project's requirements. Both the employee profiles and project scopes are composed of unstructured text. What approach should the engineer take to design this system?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. Create a tool that finds available team members for the given project dates. Embed team member profiles in a vector store and use the project description to search and filter for the best-matched team members who are available.

    Option D is correct because embedding employee profiles into a vector store and filtering by availability combines structured metadata filtering with unstructured semantic search. This approach efficiently scales compared to keyword matching or brute-force similarity scoring. Remember that Vector Search natively handles hybrid queries.

  60. Question 60 of 127A Generative AI Engineer is responsible for enhancing the quality of a RAG system by reducing offensive or inappropriate outputs. What would be the most effective method to minimize the risk of generating harmful or inflammatory text?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. Carefully curate the upstream data, including performing manual reviews before incorporating it into the RAG system.

    Option D is correct because carefully curating upstream data prevents offensive or inflammatory content from ever entering the retrieval pipeline. Simply refreshing data or notifying users does not actively reduce harmful outputs at the source. Remember that strong guardrails rely heavily on data quality and curation.

  61. Question 61 of 127A Generative AI Engineer is developing an application that uses a language model. The documents for the retrieval system have been divided into chunks, each with a maximum of 512 tokens. Since the focus for this application is on reducing cost and latency rather than maximizing quality, the engineer needs to select an appropriate context length from several available options. Which option best meets these requirements?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. Context length of 512; the smallest model size is 0.13GB, with an embedding dimension of 384.

    Option D is correct because choosing the smallest model size and matching context length directly minimizes compute cost and latency. Since the application prioritizes speed over quality, larger models and context windows introduce unnecessary computational overhead. Always align resource selection with strict application constraints.

  62. Question 62 of 127A Generative AI Engineer at an electronics company has deployed a RAG (Retrieval-Augmented Generation) application that allows customers to ask questions about the company's products. However, users have reported that the responses sometimes provide information about irrelevant products. What should the engineer do to improve the relevance of the responses?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. A. Evaluate the quality of the context being retrieved.

    Option A is correct because evaluating retrieved context isolates the root cause of irrelevant responses before modifying the language model. If the system retrieves the wrong documents, even the best model will fail to answer correctly. Always debug the retrieval step first when facing relevance issues.

  63. Question 63 of 127What is an effective way to preprocess prompts using custom code before sending them to a large language model (LLM)?A. Directly alter the internal architecture of the LLM to incorporate preprocessing steps. B. Avoid using custom code for preprocessing prompts, as the LLM has not been trained on preprocessed examples. C. Instead of preprocessing prompts, focus on postprocessing the LLM outputs to ensure they meet desired outcomes. D. Create an MLflow PyFunc model that includes a separate function for processing the prompts.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. Create an MLflow PyFunc model that includes a separate function for processing the prompts.

    Creating an MLflow PyFunc model is the correct choice because it modularizes and wraps your custom preprocessing logic seamlessly for model serving. For the exam, avoid options suggesting internal model architecture changes, as large language models are treated as fixed inference endpoints.

  64. Question 64 of 127A Generative AI Engineer is developing a system that will provide answers based on the latest stock news articles. Which of the following will NOT contribute to ensuring that the outputs are relevant to financial news?A. Establish a comprehensive guardrail framework that includes content filtering policies specifically designed for the finance sector. B. Enhance the computing resources to boost the processing speed of questions, allowing for better relevance analysis. C. Implement a profanity filter to eliminate offensive language. D. Include manual reviews to rectify any problematic outputs before they are delivered to users.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Enhance the computing resources to boost the processing speed of questions, allowing for better relevance analysis.

    Enhancing computing resources is the correct answer because increasing processing speed or throughput does not inherently improve the topical relevance of the generated outputs. Relevance is achieved through domain guardrails and manual reviews, whereas compute simply makes existing pipelines run faster.

  65. Question 65 of 127A Generative AI Engineer has successfully ingested unstructured documents and divided them into chunks based on document sections. They want to store these chunks in a Vector Search index. The current dataframe has two columns: (i) the original document file name and (ii) an array of text chunks for each document. What is the most efficient way to store this dataframe?A. Split the data into training and testing sets, create a unique identifier for each document, and then save it to a Delta table. B. Flatten the dataframe so that each chunk is in its own row, create a unique identifier for each row, and save it to a Delta table. C. First, create a unique identifier for each document, and then save it to a Delta table. D. Store each chunk as an independent JSON file in a Unity Catalog Volume, using the document section name as the key and the array of text chunks for that section as the value.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Flatten the dataframe so that each chunk is in its own row, create a unique identifier for each row, and save it to a Delta table.

    Flattening the dataframe so each chunk is an independent row is correct because vector search indexes require granular text segments to perform accurate similarity searches. Avoid storing data as independent JSON files, as Delta tables provide the necessary querying, indexing, and scalability foundation.

  66. Question 66 of 127A Generative AI Engineer is building a multilingual chatbot to assist global customers. The system needs to dynamically identify the user's language, retrieve the correct localized context from the vector store, and respond fluently in the same language. The retrieval content is stored with metadata tags like language_code, region, and version. Which implementation approach best meets the requirements for dynamic language-aware behavior?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Use a universal multilingual embedding model and apply metadata-based filtering during retrieval to select language-matched chunks

    A universal multilingual embedding model maps different languages into a shared space, while metadata filters restrict retrieval to the correct language. For the exam, remember that engine-level metadata filtering in Vector Search prevents irrelevant chunks from polluting the context window.

  67. Question 67 of 127A Generative AI Engineer is creating a batch inference workflow that processes legal documents nightly. Each document is passed to a chain that extracts key clauses and summarizes them. The goal is to scale the pipeline, track usage, and support asynchronous processing across thousands of records using Databricks. Which approach should the engineer use to design this batch inference system efficiently?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Use Databricks ai_query() within a PySpark job to apply the LLM across rows in parallel and log inference results

    Using the ai_query function within a PySpark job applies the LLM across rows in parallel, scaling effortlessly for batch workloads. Synchronous REST calls via Model Serving are meant for real-time requests and lack inherent distributed batch parallelism.

  68. Question 68 of 127A Generative AI Engineer is developing a GenAI assistant to help internal legal teams navigate regulatory guidelines. Some of the documents include personally identifiable information (PII), and others are under restrictive licenses. The company mandates that models must not expose sensitive fields or use restricted content in generation. Which combination of strategies BEST ensures legal and ethical compliance across data ingestion and model output?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Use masking techniques during chunking to redact PII and enforce license-aware filtering during retrieval

    Masking PII during chunking and enforcing license-aware filtering during retrieval guarantees sensitive data never reaches the model. Relying on prompt instructions is a soft guardrail, whereas engine-level metadata filters provide a hard, reliable boundary.

  69. Question 69 of 127A Generative AI Engineer is developing a RAG application for customer support. The application uses product manuals, chat logs, and user-generated content as part of the knowledge base. During a security audit, concerns are raised about the possibility of the model reproducing abusive or harmful language from chat logs during inference. Which approach is MOST appropriate to mitigate this risk without significantly degrading model performance or coverage?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. B. Apply content filtering during retrieval to exclude toxic language before passing chunks to the model

    Applying content filtering during retrieval excludes toxic language before the model receives the context, preserving safe, useful data. Removing all chat logs sacrifices valuable coverage, while relying on the foundation model risks quoting toxic text verbatim.

  70. Question 70 of 127A Generative AI Engineer deployed a multilingual RAG application in production. After two weeks, the product team notices inconsistent performance across languages and slower response times during peak hours. Additionally, the LLM API usage cost has nearly doubled compared to initial estimates. Which combination of monitoring strategies should the engineer implement to address both performance and cost concerns?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. A. Track latency by language using inference tables and set hard limits on total token count per request

    Tracking latency by language using inference tables and setting hard limits on total token count per request addresses both issues. For the exam, remember that Databricks inference tables provide granular telemetry for performance debugging, while max_tokens limits directly control generative costs.

  71. Question 71 of 127A Generative AI Engineer is attempting to store 150 million embeddings in a vector database that supports a maximum of 100 million. Which TWO strategies could the engineer use to reduce the total number of embeddings stored?

    Select 2 answers.

    Show answer & explanation

    Correct answer: A. A. Increase the document chunk size · B. B. Reduce the overlap between chunks

    Increasing the document chunk size and reducing the overlap between chunks both directly reduce the total number of generated vectors. Remember that switching to a smaller embedding model only reduces vector dimensionality and memory footprint, not the actual embedding count.

  72. Question 72 of 127A Generative AI Engineer is developing a Retrieval-Augmented Generation (RAG) application that retrieves context from source documents stored as image files (e.g., .jpeg, .png). To minimize coding effort, they want a Python package that can efficiently extract text from these image-based documents using the fewest lines of code. Which Python library is best suited for this task?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. pytesseract

    The pytesseract library provides a simple Python wrapper for optical character recognition to extract text from image files. The other options handle HTML parsing or web scraping, making them completely ineffective for reading text embedded inside image formats.

  73. Question 73 of 127A Generative AI Engineer is responsible for deploying an application that utilizes a custom MLflow Pyfunc model to return interim results. How should they set up the endpoint to securely pass secrets and credentials?A. Use spark.conf.set() to configure the credentials. B. Pass variables using the Databricks Feature Store API. C. Add credentials through environment variables. D. Pass the secrets as plain text.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. Add credentials through environment variables.

    Adding credentials through environment variables is correct because it securely externalizes secrets from the model code during endpoint deployment. As a practical exam cue, remember that hardcoding secrets or using Spark configurations exposes sensitive data, whereas environment variables safely integrate with Databricks secret management.

  74. Question 74 of 127A Generative AI Engineer is creating an LLM application that allows users to generate personalized birthday poems based on their names. What technique would be most effective in protecting the application against potentially harmful user inputs?A. Implement a safety filter that identifies harmful inputs and instruct the LLM to inform the user that it cannot assist. B. Limit the duration of user interactions with the LLM. C. Have the LLM notify the user that their input is malicious but continue the conversation regardless. D. Increase the computational resources allocated to the LLM to process inputs more quickly.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. A. Implement a safety filter that identifies harmful inputs and instruct the LLM to inform the user that it cannot assist.

    Implementing a safety filter is correct because it actively intercepts and blocks harmful or inappropriate user inputs before the model processes them. As an exam cue, remember that allocating more compute or limiting interaction time does not provide content moderation or protect against malicious prompts.

  75. Question 75 of 127A Generative AI Engineer is developing a chatbot to help users with insurance-related questions. The chatbot is conversational and powered by a large language model (LLM). However, to ensure the chatbot stays on topic and adheres to company policy, it should not answer any political questions. Instead, when faced with political inquiries, the chatbot should respond with the standard message: "Sorry, I cannot answer that. I am a chatbot that can only answer questions around insurance."What type of framework should be implemented to achieve this?A. Safety Guardrail B. Security Guardrail C. Contextual Guardrail D. Compliance Guardrail

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: E. C. Contextual Guardrail

    A contextual guardrail is the correct choice because it restricts the large language model to approved business topics, such as insurance, preventing off-topic drift. For the exam, remember that safety guardrails block harmful or toxic content, whereas contextual guardrails enforce business scope and relevance.

  76. Question 76 of 127A Generative AI Engineer is developing a RAG (Retrieval-Augmented Generation) application to answer questions related to internal documents for the company SnoPen AI. However, the source documents may contain a considerable amount of irrelevant content, such as advertisements, sports news, entertainment news, or information about other companies. What approach should be taken to effectively filter out this irrelevant information when building the RAG application?A. Retain all articles, as the RAG application needs to understand non-company content to avoid addressing those topics. B. Specify in the system prompt that any information processed will pertain to SnoPen AI, even if no data filtering is applied. C. State in the system prompt that the application is not intended to answer questions unrelated to SnoPen AI. D. Combine all documents related to SnoPen AI into a single chunk within the vector database.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. C. State in the system prompt that the application is not intended to answer questions unrelated to SnoPen AI.

    Stating in the system prompt that the application is not intended to answer unrelated topics is correct because it explicitly sets the operational boundaries for the model. As a practical exam cue, remember that combining all documents into a single chunk severely degrades retrieval accuracy and increases token costs.

  77. Question 77 of 127A Generative AI Engineer is deploying a RAG application that answers user questions about product warranty policies. The model is deployed using Databricks Model Serving and uses a pyfunc model with pre- and post-processing logic. Users report that the model sometimes returns raw text with inconsistent formatting. Upon inspection, the engineer finds that only the core generation logic is executing — the input validation and output formatting are being skipped. What is the MOST likely cause of this behavior?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. B. The pyfunc model was registered with only the base LLM and not the wrapped chain logic

    Registering only the base LLM instead of the wrapped pyfunc object bypasses any custom predict methods. Remember that Databricks Model Serving executes the specific artifact registered, so unserialized preprocessing logic will be completely ignored at runtime.

  78. Question 78 of 127A Generative AI Engineer is building a product recommendation assistant using a RAG pattern. The application is expected to retrieve embeddings from a large vector store of product specifications. To ensure scalability and low-latency inference, the engineer chooses to deploy the application on Databricks using Mosaic AI Vector Search. During deployment, retrieval accuracy is low and latency spikes when users filter by product type and price range. Which step should the engineer take to resolve this performance issue while maintaining filtering capability?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. C. Apply metadata filtering during query execution to narrow vector search scope before similarity ranking

    Applying metadata filters during the query narrows the vector search scope before similarity ranking, reducing latency. Do not rely on the LLM to filter text, as it requires retrieving irrelevant vectors first, which degrades performance and increases token costs.

  79. Question 79 of 127A Generative AI Engineer is tasked with enabling enterprise-wide access to a newly trained foundation model via Databricks Model Serving. The organization requires version control and lineage, fine-grained access control for teams (marketing, legal, R&D), auditable usage and model governance, and direct use of the model in notebooks and pipelines. What is the most appropriate deployment approach to meet all of these requirements?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: H. C. Register the model to Unity Catalog under a shared catalog and enable model serving with access rules for each team

    Registering the model in Unity Catalog provides native version control, lineage tracking, and auditable governance. Serving directly from DBFS or an external VM fails to provide the fine-grained access controls required across enterprise teams.

  80. Question 80 of 127A Generative AI Engineer has completed development of a RAG-based assistant to support IT helpdesk agents. The assistant relies on a foundation model from a model hub, a domain-specific embedding model, a retriever connected to Mosaic AI Vector Search, and a custom chain written using LangChain. The team now wants to deploy this assistant as an endpoint and track traffic, latency, and user interactions. The endpoint must support real-time requests from both a web UI and internal APIs. Which deployment and observability approach should the engineer choose?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: G. A. Deploy the chain using Databricks Model Serving with MLflow; enable inference logging and configure observability with Databricks metrics

    Deploying the chain with Databricks Model Serving and MLflow enables scalable real-time REST endpoints for APIs. Enabling inference tables is your key exam cue for automatically tracking traffic, latency, and full user interactions in a governed Delta table.

  81. Question 81 of 127A Generative AI Engineer is configuring a RAG-based chatbot to help employees understand internal security policies. The application uses a Vector Search index populated with policy documents, a foundation model accessed via Databricks Model Serving, and a retriever and response generator implemented using LangChain. After deployment, users report that the chatbot responds with outdated policy information. Investigation reveals that newly updated documents are not reflected in the answers, even though they exist in the document source. What is the MOST effective step the engineer should take to fix this issue?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: G. B. Recreate the vector index regularly with updated chunks from source documents

    Recreating or syncing the vector index ensures the latest document chunks are embedded and available for retrieval. Prompting the model to ignore old policies fails because the retriever never surfaces the new chunks for the model to see.

  82. Question 82 of 127A Generative AI Engineer is comparing two different RAG configurations for a legal assistant: Config A uses sentence-level chunking and cosine similarity, while Config B uses paragraph-level chunking with semantic re-ranking. The team has curated a test set of 100 legal queries with expected ideal responses. They want to select the best configuration for deployment based on objective evaluation. Which evaluation approach should the engineer use to determine the better configuration?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: E. A. Use NDCG and Recall@k to assess retrieval accuracy across both configs, and complement with human judgment for output quality

    Using retrieval metrics like NDCG and Recall provides an objective measure of how well each config surfaces the right context. Relying solely on token usage or chunk quantity ignores accuracy, which is critical for safe legal applications.

  83. Question 83 of 127A Generative AI Engineer is building a healthcare-focused chatbot for patients. If a patient's inquiry is not an emergency, the chatbot should gather more information to relay to the doctor's office and recommend relevant pre-approved medical articles. In the case of urgent inquiries, the chatbot should instruct the patient to contact their local emergency services.Given the following user input: "I have been experiencing severe headaches and dizziness for the past two days."Which response should the chatbot provide?A. Here are some relevant articles for you to browse. Feel free to ask questions after reading them. B. Please call your local emergency services. C. Headaches can be challenging. I hope you feel better soon! D. Please provide your age, recent activities, and any other symptoms you've experienced along with your headaches and dizziness. Please contact your local emergency services.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. B. Please call your local emergency services.

    Directing the user to call emergency services is correct because severe headaches and dizziness represent an urgent medical triage scenario requiring immediate human care. For the exam, always prioritize safety and escalation over standard information gathering when a user describes potentially severe medical symptoms.

  84. Question 84 of 127What indicator should be taken into account when qualitatively assessing the safety of LLM outputs for a translation use case?A. The capability to produce responses in code. B. The degree of similarity to the original language. C. The response latency and the length of the generated text. D. The accuracy and relevance of the generated responses.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. D. The accuracy and relevance of the generated responses.. The degree of similarity to the original language.

    Assessing the accuracy and relevance of the generated responses is correct because safe translation requires preserving the original meaning without introducing harmful, biased, or misleading context. The distractor focusing on similarity to the original language fails because direct literal translation often misses cultural nuances.

  85. Question 85 of 127A Generative AI Engineer is optimizing a customer support chatbot that uses a RAG architecture. Users frequently ask ambiguous questions like "Why was my order late?" or "How do I reset it?" which lack sufficient context. The engineer wants the chatbot to automatically enrich these queries with relevant user-specific information (e.g., order ID, product type) stored in a structured database. What is the BEST strategy to implement this enrichment while preserving model accuracy and performance?A. Inject structured user metadata into the prompt before the user query to provide grounding context B. Append the entire user profile and order history to every prompt, regardless of query type C. Pretrain a new embedding model that understands ambiguous queries D. Increase the vector store chunk overlap to ensure broader retrieval context

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. What is the BEST strategy to implement this enrichment while preserving model accuracy and performance?

    Injecting targeted structured metadata into the prompt supplies the grounding context needed to disambiguate vague queries. Option B fails because appending the entire user history inflates token costs and risks exposing irrelevant data.

  86. Question 86 of 127A Generative AI Engineer wants to make fine-tuned LLMs from their production Databricks workspace available for evaluation inside their development workspace. All workspaces use Unity Catalog, and the models are currently logged to the MLflow Model Registry. What is the most secure and cost-efficient way to achieve this?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Register the model directly in Unity Catalog using MLflow, then grant the development workspace READ permissions on that model.

    Registering the model in Unity Catalog enables secure, cross-workspace sharing with fine-grained access controls without duplicating data. This approach avoids the storage and compute costs of manual exports or redundant training pipelines, aligning with standard Databricks governance practices.

  87. Question 87 of 127A Generative AI Engineer has deployed an LLM-powered assistant at a manufacturing company to help address customer service questions. As part of operating the system in production, they must determine which enterprise-level metrics should be tracked to evaluate the system's performance. Which of the following is not an appropriate metric to monitor for this customer service LLM application?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Massive Multi-task Language Understanding (MMLU) benchmark score

    Massive Multi-task Language Understanding, or MMLU, is an academic benchmark meant for testing broad foundation model capabilities rather than measuring live application success. For the exam, remember that production systems require operational metrics like accuracy, latency, and throughput, not generic research scores.

  88. Question 88 of 127A Generative AI Engineer is developing a RAG-based system designed to answer queries specifically about technology news. The input corpus, however, contains large portions of unrelated material such as ads, sports updates, and entertainment pieces. Which strategy should not be used when constructing a RAG pipeline intended to focus exclusively on technology-related queries?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Retain all articles—including non-technical ones—because the system needs exposure to unrelated content in order to discourage off-topic answers

    Retaining irrelevant documents pollutes the vector store and defeats the core purpose of retrieval-augmented generation by increasing noise and hallucination risk. A key exam cue is that curating and filtering the corpus before indexing is a fundamental best practice for domain-specific systems.

  89. Question 89 of 127A Generative AI Engineer has developed a RAG system that assists employees in understanding HR-related documents. The initial prototype has been tested internally, receiving encouraging feedback. The engineer now wants to formally measure how well the system performs and identify areas that need refinement. What is the best way for the engineer to evaluate the system?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Build a dedicated evaluation dataset that independently tests retrieval effectiveness and generation quality, and use MLflow's evaluation features to assess each component separately.

    Building a dedicated evaluation dataset and using MLflow allows engineers to assess retrieval and generation independently, isolating bottlenecks accurately. Using ROUGE or an LLM-as-a-judge only grades final text, hiding whether failures stem from poor context fetching or weak generation.

  90. Question 90 of 127A Generative AI Engineer is analyzing performance issues in their company's LLM-powered Q&A assistant and believes that introducing prompt chaining could help address the shortcomings. Before recommending it, they need to clearly articulate to the broader team what prompt chaining does and why it might improve the system. Which explanation should they provide?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. It enables complex tasks to be divided into a sequence of smaller, dependent steps, allowing the assistant to produce more thorough and accurate answers.

    Prompt chaining divides complex tasks into smaller sequential steps, passing outputs from one stage as inputs to the next for improved accuracy. Chaining actually increases latency and token costs, making options claiming speed or cost reduction clearly incorrect.

  91. Question 91 of 127A Generative AI Engineer is running a provisioned-throughput model serving endpoint that powers a RAG workflow. They need visibility into both the requests sent to the endpoint and the responses it generates in order to track usage and behavior over time. Which Databricks capability should they rely on?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Inference Tables

    Inference Tables automatically log requests and responses for provisioned-throughput endpoints, providing the exact observability needed. Be careful not to confuse this with Vector Search, which handles embedding retrieval for RAG rather than tracking endpoint payloads.

  92. Question 92 of 127A Generative AI Engineer has developed scalable PySpark logic that processes unstructured PDF files, splits them into text chunks, and outputs a dataframe with two fields: the source filename (string) and an array containing the extracted chunks. The next step is to prepare this data so it can be ingested directly into a Databricks Vector Search index. What sequence of actions should the engineer take to make the chunks index-ready?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Explode the chunk array so each row contains a single chunk, generate a unique ID for every row, and enable change data feed on the resulting Delta table.

    Exploding the array ensures each chunk is an independent row, generating unique IDs creates a required primary key, and enabling change data feed allows efficient synchronization. Writing unchanged data fails because Vector Search requires a unique primary key for every indexable record.

  93. Question 93 of 127A Generative AI Engineer is tasked with creating an LLM workflow capable of multi-step reasoning that also incorporates external tools during execution. To achieve this, the model must be able to plan, take actions, and revise its approach while solving complex tasks. Which method supports this capability?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Use a framework such as ReAct, enabling the LLM to create reasoning traces and invoke external tools through structured actions whenever required.

    The ReAct framework enables an LLM to interleave reasoning traces with autonomous external tool actions, supporting dynamic planning and revision. Standard Chain-of-Thought prompting improves reasoning but requires manual intervention to supply tool outputs, preventing true autonomous execution.

  94. Question 94 of 127A Generative AI Engineer is preparing to move an LLM-based application built with Foundation Model APIs into a production environment. To align with recommended security practices, they need to choose the correct authentication approach for the deployed system. Which authentication mechanism is most appropriate?

    Select 2 answers.

    Show answer & explanation

    Correct answer: A. Authenticate using an OAuth flow designed for machine-to-machine communication · B. Use an access token issued to a service principal

    Using an access token issued to a service principal provides the non-interactive, machine-to-machine authentication required for secure production deployments. While machine-to-machine OAuth is conceptually similar, explicitly using a service principal ensures independent lifecycle management and strict least privilege.

  95. Question 95 of 127A Generative AI Engineer is developing a RAG system for their company to perform internal document Q&A for structured HR policies, but the answers returned are frequently incomplete and unstructured. It seems that the retriever is not returning all relevant context. The Generative AI Engineer has experimented with different embedding and response generating LLMs but that did not improve results. Which TWO options could be used to improve the response quality? (Choose two.)

    Select 2 answers.

    Show answer & explanation

    Correct answer: A. Add the section header as a prefix to chunks · D. Increase the document chunk size

    Adding section headers and increasing chunk size directly resolve incomplete retrieval by preserving semantic context within structured documents. Sentence splitting destroys context, and upgrading models cannot fix missing information reaching the response generator.

  96. Question 96 of 127A Generative AI Engineer is deploying a customer-facing LLM application in production using the Foundation Model API with provisioned throughput. They want to minimize the risk of the model generating toxic or unsafe content, and they prefer the solution that requires the least engineering overhead. Which option best satisfies these goals?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Deploy Llama Guard through the Foundation Model API and use it to screen outputs for safety issues

    Deploying Llama Guard through the Foundation Model API provides a purpose-built moderation layer with minimal engineering overhead. Regex rules are too brittle for semantic safety, while custom LLM calls introduce unnecessary cost, latency, and complexity into the application flow.

  97. Question 97 of 127A Generative AI Engineer has developed an LLM-powered translation system that converts text between two languages. They now want to compare several different LLMs to determine which model performs best. They already have a curated evaluation dataset containing high-quality reference translations and need a strong, well-established metric to measure translation performance. Which metric should they use?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. BLEU

    BLEU is the industry standard metric for evaluating machine translation quality by measuring n-gram overlap against high-quality reference translations. ROUGE is used for summarization, while NDCG and Recall apply to ranking and retrieval tasks rather than translation fidelity.

  98. Question 98 of 127A Generative AI Engineer is building a RAG-based system and wants to test multiple embedding models to see which one delivers the strongest overall performance. They need a principled approach for selecting an appropriate embedding model. Which strategy should they follow?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Use an embedding model that was trained on data similar to the application's domain

    Selecting an embedding model trained on similar domain data ensures it accurately captures the specific semantics and vocabulary of your corpus. General leaderboard rankings or multilingual capabilities do not guarantee strong performance on your highly specialized internal documents.

  99. Question 99 of 127A Generative AI Engineer is creating a RAG system that depends on contextual information pulled from source documents stored in HTML format. To minimize development effort, they want to extract text using a Python package that requires very little code. Which library should they choose for parsing and extracting text from HTML documents?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. beautifulsoup

    BeautifulSoup is a Python library built specifically for parsing HTML and XML, extracting text with minimal code. Exam tip: pytesseract is for OCR on images, PyPDF2 is for PDF files, and NumPy handles numerical computing.

  100. Question 100 of 127A Generative AI Engineer is designing a RAG-based solution that will help employees get answers to questions about internal company policies. Which sequence of steps correctly represents the workflow for building and deploying this RAG application?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Collect the policy documents → Create embeddings and store them in Vector Search → User sends a query to the LLM → LLM retrieves relevant documents → LLM generates an answer → Evaluate performance → Deploy using Model Serving

    The correct workflow begins with collecting documents, creating embeddings, and storing them in Vector Search before users submit queries. Evaluation must occur before deployment to ensure the pipeline retrieves context accurately and generates grounded responses in production.

  101. Question 101 of 127A Generative AI Engineer discovers that, during a weekend experiment, their prototype inadvertently sent thousands of inference calls to a Foundation Model endpoint. They want to implement a safeguard to ensure such accidental overuse does not occur again. What is the most appropriate step they should take?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Apply rate-limiting controls directly on the Foundation Model endpoints.

    Applying rate-limiting controls directly to the endpoint enforces hard infrastructure quotas, effectively preventing accidental traffic spikes. Distractors relying on prompt instructions or manual code reviews fail because they lack real-time, automated enforcement at the serving layer.

  102. Question 102 of 127A Generative AI Engineer needs to configure a Databricks Vector Search index that can surface news articles on a specific topic published within a 10-day window of a user-provided date. For example, a user might ask, "Show me monster truck news from around January 5th, 1992." They want to achieve this with minimal implementation effort. How should they design their Vector Search index to support this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Add metadata fields for publication date and topic so the system can apply metadata filters during retrieval.

    Adding structured metadata fields like publication date and topic allows the system to apply hard filters during vector retrieval. This is the most efficient approach because relying on semantic similarity alone cannot guarantee precise constraints like specific date ranges.

  103. Question 103 of 127A Generative AI Engineer has built an LLM-powered application using the pay-as-you-go Foundation Model API. As they prepare for production rollout, they want to ensure that the model endpoint can reliably handle a large volume of incoming traffic. What should they take into account?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Deploy the endpoint with provisioned throughput to obtain predictable, guaranteed performance.

    Provisioned throughput reserves dedicated compute capacity for a foundation model endpoint, guaranteeing predictable performance and avoiding noisy neighbor issues. For the exam, associate provisioned throughput with reliable production scaling rather than simply shrinking the model size.

  104. Question 104 of 127A Generative AI Engineer at a home-appliance manufacturer needs to design an LLM-powered system that can answer customer questions by leveraging the appliances' instruction manuals. Which sequence of high-level steps should the system follow?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Break the manuals into smaller text chunks and generate embeddings stored in a vector database. For each customer query, retrieve the most relevant chunks and have the LLM craft an answer using the retrieved content.

    Breaking manuals into chunks and retrieving the most relevant sections forms the standard retrieval-augmented generation pipeline, ensuring accurate and efficient answers. Avoid options involving collaborative filtering or massive context windows, which are inefficient or lossy.

  105. Question 105 of 127A Generative AI Engineer is building an LLM-driven application that engages users in conversation to offer personalized movie suggestions. Because users may occasionally submit harmful or unsafe prompts, the engineer needs a reliable way to protect the system from malicious inputs. Which approach would best strengthen the application's safety?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Add a safety-filtering layer that flags harmful text and instructs the model to decline those requests.

    A dedicated safety-filtering layer intercepts and blocks harmful prompts before they reach the language model, preventing malicious inputs from generating unsafe outputs. Relying on the model to warn users leaves the system vulnerable, whereas compute scaling or time limits never address input toxicity.

  106. Question 106 of 127A Generative AI Engineer is creating an application that answers questions about breaking news events. The system aggregates information from several sources, including news articles and social media platforms. The engineer is concerned that toxic or harmful social media content might influence the model and lead to toxic responses. Which safeguard would help prevent such toxic outputs?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Allow the system to ingest content only from vetted, trustworthy social media and news accounts so unexpected toxic material is excluded.

    Curating data sources to ingest content only from trusted accounts prevents toxic material from entering the retrieval corpus, which keeps harmful context from influencing model outputs. Limiting retrieval count fails because any selected toxic chunk still poisons the generation phase.

  107. Question 107 of 127A development team plans to fine-tune an open-weight model to achieve high-quality code generation. They want to keep model-hosting costs low and are reviewing models on Hugging Face model cards and Spaces to decide which one to start with. Which two model characteristics or benchmarks should they prioritize when making their choice? (Select two.)

    Select 2 answers.

    Show answer & explanation

    Correct answer: A. The Big Code Models Leaderboard · B. The model's parameter count

    The Big Code Models Leaderboard evaluates task-specific coding capabilities, making it essential for choosing a code generation base model. Parameter count dictates GPU memory requirements and directly impacts hosting costs, whereas MTEB only ranks embedding models.

  108. Question 108 of 127A Generative AI Engineer is building an agent-based system using a well-known agent-authoring framework. The agent uses a mix of sequential and parallel chains, but during execution, one of the steps consistently fails, and the engineer is struggling to pinpoint why. They need to determine the most suitable method to investigate the issue and uncover the underlying cause. Which approach should they choose?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Turn on MLflow tracing to obtain detailed visibility into the agent's execution flow and the behavior of each step.

    MLflow tracing provides granular observability into agent execution flows, automatically capturing inputs, outputs, and tool calls for multi-step workflows. Structured logging lacks this deep automated introspection, while MLflow evaluate is meant for scoring model quality.

  109. Question 109 of 127A team is using Mosaic AI Vector Search to retrieve documents for their RAG pipeline. Each query returns five potentially relevant documents, and the top three are included as context in the prompt. However, during evaluation with Agent Evaluation, the team discovers that some of the lower-ranked retrieved documents actually have stronger contextual relevance than those ranked higher. What should the team consider to improve this workflow?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Introduce a reranker to reorder the retrieved documents based on their true relevance scores.

    Introducing a reranker resolves this by using a cross-encoder to reorder the retrieved documents based on true semantic relevance. Relying on the LLM to reorder context is unreliable, whereas a dedicated reranking stage is the standard approach to fix imperfect embedding similarity.

  110. Question 110 of 127A Generative AI engineer is developing an LLM-powered application that relies heavily on fast and accurate speech-to-text processing. The overall performance of the system depends on the transcription component being as quick as possible. Which open-source generative AI model is the most suitable for this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. whisper-large-v3 (1.6B)

    Whisper-large-v3 is an open-source model specifically designed for fast and accurate automatic speech recognition. For the exam, remember that audio transcription requires specialized acoustic models like Whisper, whereas text-based models like DBRX cannot process audio natively.

  111. Question 111 of 127A Generative AI Engineer needs to ensure that the model and its training data comply with licensing rules to prevent potential legal issues. Which action is the most appropriate to mitigate legal risk?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Use only datasets that are clearly marked with an open license and carefully adhere to all associated licensing terms.

    Using datasets with clear open licenses and strictly adhering to their terms creates a reliable chain of rights, reducing legal exposure. Treating public data as unrestricted is a major trap, as public accessibility does not eliminate copyright or usage constraints.

  112. Question 112 of 127A Generative AI Engineer is working with an instruction-tuned LLM trained on transcripts of customer calls asking about product availability. The model must produce a clear classification label: "Success" when the product is available, and "Fail" when it is not. Which prompt will most reliably produce the correct classification?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. You will receive a customer call transcript involving a question about product availability. Output "Success" if the product is available and "Fail" if the product is unavailable.

    Option B provides direct, deterministic instructions that align perfectly with the strict product availability classification task. Avoid options introducing unnecessary reasoning steps or complex formatting, as these distract the model and degrade classification consistency.

  113. Question 113 of 127A Generative AI Engineer is assembling the core components needed for an LLM-powered chat application that supports natural conversation, retrieves information from a knowledge source, and maintains context across turns. Which two chain elements are essential for this type of system? (Select two.)

    Select 2 answers.

    Show answer & explanation

    Correct answer: A. Vector Stores · B. Conversation Buffer Memory

    Vector stores are essential for retrieving relevant knowledge, while conversation buffer memory maintains context across multiple chat turns. External tools and UI components might enhance an application, but they are not foundational requirements for a standard conversational RAG pipeline.

  114. Question 114 of 127A Generative AI Engineer must develop an LLM-powered system focused on producing high-quality code outputs. To achieve strong performance without additional fine-tuning, they want to choose a model that has undergone specialized pretraining for code generation tasks. Which model is the most suitable choice for this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. CodeLlama-34B-Instruct-hf

    CodeLlama is explicitly pretrained and instruction-tuned for code generation, making it the optimal specialized model. General-purpose models like Llama-2 or Mixtral can write code, but they lack the targeted architecture needed for high-quality out-of-the-box programming tasks.

  115. Question 115 of 127A Generative AI Engineer at an automotive company is developing a customer-facing chatbot that can answer questions about different vehicle models, their components, and routine maintenance. The company stores this information across a collection of internal documents. Which of the following elements would not provide meaningful value in creating this chatbot?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Encouraging customers to ask lengthy, detailed questions instead of short ones

    Encouraging long questions does not improve a RAG chatbot, which relies on semantic embeddings to understand brief queries naturally. The LLM, embedding model, and vector database are foundational components, making the query length a irrelevant design factor.

  116. Question 116 of 127A Generative AI Engineer is developing a system where an LLM generates headlines based on full article content. The early results, however, don't reflect the intended writing style or tone. Which method would be the most effective way to steer the model toward producing the desired type of headline?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Craft prompts that explicitly instruct the LLM to produce output in the required tone and style

    Crafting explicit prompts is the most efficient initial method to steer model behavior because it adjusts output without modifying weights or requiring new pipelines. For the exam, always choose prompt engineering over fine-tuning when the goal is a low-cost, immediate adjustment to tone or style.

  117. Question 117 of 127A Generative AI Engineer is designing a customer support assistant that should tailor its tone and response style based on how the user initially expresses themselves. For instance, if a customer sounds upset or frustrated, the bot should shift to a calming, empathetic approach while still addressing the issue. The engineer wants to follow recommended practices for building such behavior into the system. Which solution best supports this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Build a multi-step chain where one LLM first identifies sentiment and, based on that classification, dynamically adjusts the system prompt used by the response-generation LLM.

    Building a multi-step chain allows a dedicated model to classify sentiment and dynamically adapt the system prompt for the final response. This orchestration pattern is preferred over retrieval or basic regression because LLMs handle nuanced emotional cues and tone shifts much more effectively.

  118. Question 118 of 127A Generative AI Engineer is using an LLM to identify the species of edible mushrooms from textual feature descriptions. Although the model's predictions are accurate and the label set is correct, the LLM often adds extra explanation or reasoning. The engineer wants the model to output only the species label without any additional text. What should they do to guide the model toward producing the required format?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Provide few-shot examples that clearly demonstrate the exact output format expected

    Providing few-shot examples reliably forces the model to mimic a strict output format without generating unwanted explanations. Zero-shot instructions are often ignored for formatting, and chain-of-thought prompting would actually increase the reasoning text you want to eliminate.

  119. Question 119 of 127A Generative AI Engineer is assisting a retail company that wants to streamline how it handles routine customer inquiries. The goal is to use an LLM-based solution that can speed up responses while still delivering a personalized experience. They need to identify the correct type of input data and the corresponding LLM task that would support this goal. Which input/output pairing best fits this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Input: Customer service chat histories; Output: Organize chats by user, summarize each user's prior interactions, and then craft a response

    Organizing and summarizing chat histories by user enables faster responses while maintaining a highly personalized experience based on prior context. Retrieval pipelines lack personalization, and sentiment analysis or clustering reviews does not directly generate a reply to customer inquiries.

  120. Question 120 of 127A Generative AI Engineer is designing an internal chatbot that must recognize what kind of query a user is asking and direct it to the appropriate model. For example, one employee may want to know the historical failure rate of a particular electrical component, while another may need troubleshooting guidance for a piece of equipment. The organization's data sources include a table containing failure events for electrical parts and a collection of PDF equipment manuals. Which approach best supports this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Build the chatbot as a multi-stage LLM pipeline: first classify the user's query type, then route it accordingly. Direct failure-rate questions to a text-to-SQL model that queries the failure table, and send troubleshooting queries to another model that summarizes the relevant manual and produces an answer.

    A multi-stage pipeline classifies user intent and routes the request to the appropriate downstream handler, such as text-to-SQL for structured data or retrieval for manuals. Combining all data into a single format degrades accuracy by stripping away the native structure of relational tables.

  121. Question 121 of 127A Generative AI Engineer at a law firm is creating a RAG system to study historical legal case precedents. The system must process millions of plain-text court opinions and legal documents that are already categorized by time period and legal topic. The goal is to understand how interpretations of particular statutes have changed over the years. The engineer now needs to select a chunking strategy that best maintains narrative flow while also preserving the chronological structure of the material. Which approach should they select?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Use windowed chunking with overlapping segments to maintain continuity across adjacent text.

    Windowed chunking with overlapping segments maintains continuity across adjacent text boundaries, ensuring legal reasoning remains intact. Paragraph chunking lacks overlap causing context gaps, while sentence chunking is too granular, and hierarchical clustering disrupts chronological flow.

  122. Question 122 of 127A Generative AI Engineer is building an agentic workflow in LangGraph that includes several tools within a single application. They want the primary orchestrator LLM to independently choose the most suitable tool to invoke based on the user's input. To accomplish this, they need to identify the correct high-level sequence of steps in the code. Which sequence achieves this?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. 1. Define or import the tools 2. Specify the agent configuration 3. Initialize the agent with ReAct logic, the LLM, and the tools

    In LangGraph, the correct sequence is to define the tools, specify the agent configuration, and then initialize the agent with ReAct logic. Unlike classic LangChain, LangGraph requires defining the graph state and transitions before instantiating the actual agent.

  123. Question 123 of 127All of the options below represent Python-based methods for interacting with Databricks foundation models. When executing code inside an interactive Databricks notebook, which library does not automatically rely on the notebook's active session credentials?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. The OpenAI client library

    The OpenAI client library requires its own explicit API key and does not inherit Databricks notebook session credentials. For the exam, remember that native tools like the Databricks Python SDK and MLflow Deployments automatically authenticate using the active workspace session.

  124. Question 124 of 127A Generative AI Engineer is evaluating whether to index their vector store using Locality Sensitive Hashing (LSH) or Hierarchical Navigable Small World (HNSW). Since the application requires the most semantically accurate retrievals, the engineer wants a reliable way to objectively compare the two indexing strategies. What is the best method to assess their semantic accuracy?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Measure the cosine similarity between the embeddings of retrieved items and those of a representative set of test queries

    Cosine similarity measures the semantic closeness between query and retrieved item embeddings, directly evaluating retrieval accuracy. Avoid text generation metrics like BLEU or ROUGE, which measure n-gram overlap for translation or summarization tasks instead of vector distance.

  125. Question 125 of 127A Generative AI Engineer is releasing a fine-tuned LLM on the company's public website. Because the organization has invested heavily in the fine-tuning process and the underlying training data is proprietary, they are worried about the risk of model inversion attacks exposing sensitive information. Which Databricks AI Security Framework (DASF) mitigation strategy is most applicable in this scenario?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Use Databricks access control lists (ACLs) to tightly manage which identities can interact with the model.

    Applying access control lists directly restricts which identities can query the model endpoint, mitigating inversion risks. While guardrails are useful, they filter unsafe content rather than stopping adversarial probing, making strict endpoint access controls the strongest defense.

  126. Question 126 of 127A Generative AI Engineer must choose an open-source LLM from HuggingFace to analyze and interpret medical documents, including newly released clinical texts. The engineer wants to ensure that the chosen model can handle healthcare-specific terminology and concepts. Which approach should they take when evaluating models?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Review the model card and training data details to verify whether the model was trained on medical or biomedical corporathe model with the highest download count, assuming that popularity reflects broad effectiveness and model quality

    Reviewing the model card and training data details confirms whether the model was exposed to biomedical corpora, which is critical for domain-specific accuracy. For the exam, always rely on documented training data over proxy metrics like popularity or recency when selecting models.

  127. Question 127 of 127A Generative AI Engineer at a car manufacturer wants to build a vehicle-specific question-answering chatbot for customers. Their available data includes: A massive catalog containing hundreds of thousands of vehicles dating back to the 1960s; Historical search logs with user queries and confirmed matches; Multilingual descriptions for their vehicle lineup. They have already chosen an open-source LLM and prepared a test dataset of sample customer questions. Now they need to eliminate approaches that will not meaningfully help in building the chatbot. Which technique should they rule out?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: F. Using extremely large chunk sizes that stretch to the limits of the model's context window in hopes of maximizing text coverage

    Using extremely large chunks degrades retrieval precision by packing unrelated information together, which increases noise and hallucinations. Metadata filtering, few-shot examples, and custom embedding fine-tuning are all effective strategies that meaningfully improve chatbot accuracy.

More free practice tests at certpunch.com and new video rounds on @CertPunch.

Scroll to Top