Application Development
Drill 20 practice questions focused entirely on Application Development for the Databricks Databricks GenAI Engineer Associate exam. Tap an answer for instant feedback and a full explanation — no sign-up, always free.
You are building a multi-step agent that answers customer questions about their orders. The workflow requires the agent to (1) look up a customer's order ID from their email, (2) retrieve the shipment status using that order ID, and (3) generate a natural-language summary. During testing, the agent frequently fails at step 2 because it invokes the shipment-status tool with the customer's email instead of the order ID returned by step 1. What is the most effective way to fix this behavior?
You are building a Mosaic AI agent on Databricks that answers customer questions by calling multiple tools (a product catalog lookup, an inventory checker, and a shipping estimator). During testing, some queries cause the agent to enter long reasoning loops, repeatedly invoking tools without converging on a final answer. This drives up latency and token costs. Which configuration change most directly prevents these runaway loops while still allowing legitimate multi-step reasoning?
You are building a Mosaic AI agent for a retail customer-support app. The agent has access to a tool `issue_refund(order_id, amount)` that calls an internal API to process a monetary refund. During testing, you notice that when the LLM's reasoning loop occasionally re-invokes the same tool call after a transient response parsing error, customers are sometimes refunded twice for the same order. Which design change most directly prevents duplicate side effects from repeated tool invocations?
You are building a Mosaic AI agent that has access to three registered Unity Catalog functions: `get_order_status`, `lookup_product_inventory`, and `search_return_policy`. During testing, you notice the LLM frequently calls `search_return_policy` even when users ask about where their package is. The tool bindings and endpoint work correctly, and each function executes without error when called directly. What is the most effective change to improve the agent's tool selection accuracy?
You are building a Mosaic AI agent that calls an external inventory API tool to answer customer stock-availability questions. During testing, the API intermittently returns timeouts and malformed responses, causing the agent to either crash or return the raw error text to the user. You need to make the agent robust while keeping responses helpful. Which approach best addresses this within the agent's tool-execution logic?
You are building a Mosaic AI agent that calls a Unity Catalog function to look up a customer's order by an order ID. During testing, the LLM occasionally passes malformed arguments — sometimes an empty string, sometimes a full sentence like 'the order from yesterday' — causing the tool to fail. You want to reduce these failures by making the tool's expected input explicit to the LLM so it produces correctly formatted arguments more reliably. Which approach most directly addresses this?
You are building a Mosaic AI agent that answers customer queries like 'Compare the shipping cost and estimated delivery date for my order to the standard rate.' The agent has three tools: get_order_details (returns order ID metadata), get_shipping_cost (requires the order's weight and destination from get_order_details), and get_standard_rate (returns a fixed published rate with no inputs). You want to minimize end-to-end latency without producing incorrect tool inputs. How should you structure the agent's tool execution?
You are building a customer-facing shopping assistant on Databricks. Customers ask two kinds of questions: (1) explanations of the store's return and warranty policies, which are documented in a static PDF knowledge base, and (2) current stock levels and prices for specific SKUs, which change minute-to-minute and live in a transactional database exposed through a REST API. You want a single Mosaic AI agent that answers both accurately. Which design correctly handles both question types?
You are building a multi-turn customer support agent on Databricks that uses a foundation model with an 8,192-token context window. Each turn appends the full conversation history plus a system prompt plus retrieved documents. After roughly 15 exchanges, users start receiving errors that the context length has been exceeded. The business requires that the agent still remember key facts from earlier in the conversation (like the customer's account ID and reported issue). What is the most appropriate way to manage context so the agent keeps working across long conversations?
A Generative AI Engineer at a healthcare startup needs to integrate OpenAI's GPT-4 into a Databricks-based application. Company policy requires that the OpenAI API key never be hard-coded in notebooks or application code, and that all model calls flow through a governed, centrally-managed interface that supports rate limiting and usage tracking on Databricks. What is the recommended approach to configure this integration?
A Generative AI Engineer is building a RAG application on Databricks. They need to generate embeddings for both the initial batch indexing of 500,000 documents and for real-time query embeddings at inference time. They want to minimize operational overhead by using a Databricks-hosted embedding model rather than deploying a custom model. Which approach correctly uses the Databricks Foundation Model APIs for this task?
A Generative AI Engineer is building an internal prototype chat assistant on Databricks. The traffic is sporadic and unpredictable during the exploration phase, and the team wants to experiment quickly with a state-of-the-art open model (Llama) without committing to reserved capacity or managing infrastructure. They want the lowest operational overhead and to pay only for what they actually use. Which Foundation Model API option should they choose?
A Generative AI Engineer is deploying a customer-facing chatbot on Databricks that must serve a large open-source LLM (Llama 3 70B) with predictable, low latency during business hours when traffic is consistently high. The team has strict SLAs on response time and needs guaranteed capacity rather than best-effort serving. Which Databricks Foundation Model API serving option best meets these requirements?
A Generative AI Engineer has built a customer-support summarization chain that calls a Databricks Foundation Model API pay-per-token endpoint using the OpenAI-compatible client. Leadership now wants the ability to switch the underlying LLM (e.g., from Llama to a Claude external model) without rewriting the application code that makes the completion calls. Which Databricks capability lets the engineer change the served model behind a stable interface so the application code stays unchanged?
A Generative AI Engineer is building an invoice-processing application that calls a Databricks Foundation Model API endpoint (a chat model that supports structured outputs). The application must receive strictly valid JSON matching a fixed schema (vendor, invoice_number, total_amount) so it can be inserted directly into a Delta table without post-parsing failures. The team has already tried adding 'respond only in JSON' to the prompt but occasionally gets responses wrapped in markdown code fences or with explanatory prose. Which approach most reliably guarantees schema-conformant output from the endpoint?
You are building a customer-support agent on Databricks using LangChain. The agent must answer product-availability questions by querying a live inventory system exposed as a Python function, and it must also handle general product FAQs from a knowledge base. You want the LLM to decide autonomously when to call the inventory function versus when to answer directly. Which approach correctly enables the agent to invoke the inventory function only when needed?
You are building a customer-support assistant on Databricks using LangChain. The assistant must handle long, multi-turn troubleshooting sessions that can exceed 30 exchanges. Early in the session, users describe their environment (OS version, product edition, error codes), and this detail must remain available for the model throughout the whole conversation. However, you are hitting the context window limit of your foundation model after about 20 turns because the full raw history is being passed each time. Which conversation memory approach best preserves the critical early context while staying within the token budget?
You are building a RAG chain with LangChain Expression Language (LCEL) on Databricks. Your chain must call two independent retrievers — one against a product-documentation vector index and another against a support-ticket vector index — then merge their results before passing everything to the prompt. Profiling shows the two retrieval calls currently run one after the other, adding significant latency. Which LCEL construct should you use to invoke both retrievers concurrently and combine their outputs into a single dictionary for the downstream prompt?
You are building a LangChain (LCEL) chain that classifies incoming customer emails using a Databricks Foundation Model API endpoint. During a nightly job, you must process roughly 50,000 emails that are already loaded into a Python list. Your current code loops over the list and calls chain.invoke() once per email, but the job is too slow to finish within its window. Without changing the model or endpoint, what is the most appropriate way to improve throughput while keeping the same LCEL chain?
You are building a customer support assistant on Databricks. The application must handle two very different request types: (1) factual questions that should be answered from a Vector Search-backed knowledge base, and (2) requests to calculate refund amounts that require a deterministic Python function. Both request types arrive at the same chat endpoint. You want a single LangChain LCEL pipeline that inspects each incoming query and dispatches it to the appropriate sub-chain. Which LCEL construct is the most appropriate way to implement this dispatch logic?
More Databricks GenAI Engineer Associate practice
Keep going with the other Databricks Certified Generative AI Engineer Associate domains, or take a full timed mock exam.
← Back to Databricks GenAI Engineer Associate overview