Home / GenAI Engineer practice test / Assembling and Deploying Applications

Free · 8 questions with explanations

Assembling and Deploying Applications: Databricks Generative AI Engineer Associate Practice Questions

Exam-style questions on Assembling and Deploying Applications. Pick your answer, then open the explanation to see why it's right — and why the other options are wrong.

1 Assembling and Deploying Applications

A RAG application retrieves product documentation by part number (SKU). Pure vector similarity search returns poor results for exact SKU lookups (e.g., 'XR-4892-B') because SKUs are not semantically composable words. Which Mosaic AI Vector Search feature BEST addresses this limitation?

  1. AIncrease the embedding dimension to 4096 to better capture SKU character patterns
  2. BSwitch to a Direct Vector Access Index so the developer can manually control which documents are returned for each SKU
  3. CEnable hybrid keyword-similarity search, which combines vector similarity (semantic) with keyword search (Okapi BM25) via Reciprocal Rank Fusion, capturing both exact SKU keyword matches and semantically related content
  4. DStore SKU values as vector metadata and apply a metadata filter to pre-filter by SKU before running vector similarity
Show answer & explanation

Correct answer: C

WHY C is correct: Hybrid keyword-similarity search combines vector-based embedding search with traditional keyword-based BM25 search. The Databricks documentation explicitly calls out that this is 'particularly useful in RAG applications where source data has unique keywords such as SKUs or identifiers that are not well suited to pure similarity search.' Results from both methods are fused using Reciprocal Rank Fusion (RRF). WHY NOT A: Increasing embedding dimension improves the model's ability to represent semantic concepts in dense vector space, but SKUs are arbitrary alphanumeric sequences that don't carry distributional semantic signal — higher dimensions don't help with exact-match retrieval of opaque identifiers. WHY NOT B: Direct Vector Access Index changes how embeddings are updated (manual vs. auto-sync) but does not add keyword search capability. It does not improve exact-match retrieval of SKU queries. WHY NOT D: Metadata filtering pre-filters documents before similarity scoring — it can work for exact SKU lookups if the SKU is stored as a metadata column. However, the question implies mixed queries that include SKU keywords alongside semantic content. Hybrid search handles both simultaneously without requiring a pre-known exact SKU filter value.

2 Assembling and Deploying Applications

A developer needs to build a minimal chain that: (1) takes a user question, (2) formats it into a prompt, (3) calls an LLM, and (4) returns the text response. Using LangChain Expression Language (LCEL) with the pipe operator, which implementation is correct?

  1. Achain = PromptTemplate.from_template('{question}') + ChatOpenAI() + StrOutputParser()
  2. Bchain = PromptTemplate.from_template('Answer this: {question}') | ChatOpenAI() | StrOutputParser()
  3. Cchain = LLMChain(prompt=PromptTemplate.from_template('{question}'), llm=ChatOpenAI())
  4. Dchain = StrOutputParser(PromptTemplate.from_template('{question}'), ChatOpenAI())
Show answer & explanation

Correct answer: B

WHY B is correct: This is the canonical LCEL minimal chain. The pipe operator (|) chains Runnable objects left-to-right: the PromptTemplate formats the input dict into a prompt message, ChatOpenAI() calls the LLM and returns an AIMessage, and StrOutputParser() extracts the text string. The chain is invoked with chain.invoke({'question': '...'}). WHY NOT A: The + operator is not a valid chain composition operator in LCEL. Runnable objects are composed with | (pipe), not +. WHY NOT C: LLMChain is the legacy pre-LCEL API. While it works, it is not LCEL and does not support .stream(), .batch(), or async operations natively. The question specifies LCEL and the pipe-operator approach. WHY NOT D: StrOutputParser() is not a wrapper constructor that accepts other objects as positional arguments. It is an instantiated Runnable that receives LLM output via | — it cannot be constructed with the prompt and LLM as parameters.

3 Assembling and Deploying Applications

A team is iterating on the system prompt for a customer service agent. They need to: track all prompt versions, compare performance metrics across versions, and roll back to a previous version if quality degrades in production. Which Databricks feature is designed for this workflow?

  1. AStore prompts as Delta table rows and use Delta time travel to retrieve previous versions
  2. BUse the Databricks Prompt Registry (MLflow Prompt Engineering UI / AI Gateway prompt management) to version, compare, and manage prompt lifecycle with alias-based promotion across environments
  3. CStore each prompt version as a separate MLflow experiment and compare quality metrics across experiment runs
  4. DUse a Git repository for prompt text files with manual branch management for dev/staging/prod promotion
Show answer & explanation

Correct answer: B

WHY B is correct: The Databricks Prompt Registry (integrated via MLflow's prompt engineering and AI Gateway) provides native versioning for prompts, tracks performance metrics per version, supports alias-based promotion (e.g., 'production' alias pointing to a specific version), and enables rollback by reassigning aliases. This is the purpose-built solution for the described prompt lifecycle management workflow. WHY NOT A: Delta time travel tracks table data history but is not optimized for prompt version management with associated evaluation metrics, aliases, or promotion workflows. It lacks the metadata structure needed to compare prompt versions by performance. WHY NOT C: Using separate MLflow experiments per prompt version creates a proliferation of experiments not linked to a shared prompt lineage. MLflow experiments are designed for model training runs, not for managing a versioned prompt entity with aliases. WHY NOT D: Git-based prompt management provides version history but requires manual processes for metric tracking, rollback, and promotion. It lacks the integrated evaluation metric association and alias-based deployment control provided by the Prompt Registry.

4 Assembling and Deploying Applications

A data science team has built a LangChain agent deployed on a Databricks Model Serving endpoint. They want internal business analysts (who are not engineers) to interact with the agent through a web chat interface with conversation history, without requiring them to use notebooks or APIs directly. Which Databricks-native deployment option is MOST appropriate?

  1. AShare the agent's REST API URL and authentication token with analysts and instruct them to use curl or Postman
  2. BDeploy the agent as a Databricks App (using Databricks Apps with a Gradio or Streamlit front-end) to provide a custom, accessible web chat UI served within the Databricks workspace with built-in authentication
  3. CDeploy the agent as a batch Delta Live Tables pipeline that analysts trigger manually from the Workflows UI
  4. DInstruct analysts to open the MLflow model UI in the Unity Catalog and use the 'Test endpoint' button for all production interactions
Show answer & explanation

Correct answer: B

WHY B is correct: Databricks Apps allows teams to build and host interactive web applications (Gradio, Streamlit, React, etc.) directly within the Databricks workspace. A Gradio or Streamlit chat interface wrapping the Model Serving endpoint provides a browser-accessible UI with conversation history display, user-friendly input, and Databricks workspace authentication — exactly what non-engineer business analysts need. WHY NOT A: Providing raw REST API credentials and instructing analysts to use curl/Postman requires technical expertise that business analysts typically lack. It provides no persistent conversation history UI and is entirely inappropriate for non-engineer users. WHY NOT C: A Delta Live Tables batch pipeline is a data transformation workflow, not an interactive conversational interface. Analysts cannot engage in real-time conversation with an agent through a DLT pipeline. WHY NOT D: The 'Test endpoint' button in the MLflow / Unity Catalog model UI is a developer tool for testing input/output formats during development and debugging. It is not designed for ongoing production user interaction, does not maintain conversation history, and requires Unity Catalog access privileges that business analysts may not have.

5 Assembling and Deploying Applications

A company is building a product catalog search system with 50 million product embeddings at 768 dimensions. The catalog is updated continuously as products are added and removed. Query latency must be under 100 ms. Which Vector Search configuration is MOST appropriate?

  1. AStorage-optimized endpoint with a Direct Vector Access Index — because storage-optimized offers the best cost for large indexes
  2. BStandard endpoint with a Delta Sync Index (Databricks-managed embeddings) with continuous sync mode — because standard endpoints support up to 320M vectors at 768 dimensions, Delta Sync auto-syncs changes, and continuous sync handles real-time catalog updates at standard endpoint latency
  3. CStandard endpoint with a Direct Vector Access Index — because Direct Access gives the lowest latency by bypassing the sync pipeline
  4. DStorage-optimized endpoint with a Delta Sync Index — because storage-optimized endpoints provide lower query latency for all workload sizes
Show answer & explanation

Correct answer: B

WHY B is correct: 50M vectors at 768 dimensions is well within the standard endpoint's ~320M capacity. Delta Sync with Databricks-managed embeddings handles automatic embedding computation. Continuous sync mode keeps the index current as the source Delta table changes — ideal for a live product catalog. Standard endpoint query latency is lower than storage-optimized (storage-optimized adds ~250ms overhead). WHY NOT A: Storage-optimized endpoints have ~250ms additional query latency overhead, making sub-100ms queries difficult. They also don't support continuous sync mode per the documentation. They are designed for very large datasets (1B+) where standard endpoints are insufficient — unnecessary for 50M vectors. WHY NOT C: Direct Vector Access Indexes require manual REST API calls to update the index when products are added/removed. For a continuously updated catalog, this adds significant operational complexity and risks index staleness. Delta Sync auto-handles catalog changes. WHY NOT D: As noted, storage-optimized endpoints add ~250ms query latency and don't support continuous sync. Both properties disqualify this option for a real-time, sub-100ms catalog search system.

6 Assembling and Deploying Applications

A developer needs a chain that first summarizes a document, then classifies the summary into one of three categories. Both steps call different LLMs. Which LCEL pattern correctly implements this sequential two-step chain?

  1. Achain = (summarize_prompt | summarize_llm | StrOutputParser()) | (classify_prompt | classify_llm | StrOutputParser())
  2. Bchain = RunnableParallel({'summary': summarize_prompt | summarize_llm, 'classification': classify_prompt | classify_llm})
  3. Cchain = summarize_prompt | summarize_llm | StrOutputParser() + classify_prompt | classify_llm | StrOutputParser()
  4. Dchain = RunnableSequence([summarize_prompt, summarize_llm, classify_prompt, classify_llm])
Show answer & explanation

Correct answer: A

WHY A is correct: LCEL supports nesting: each parenthesized sub-pipeline (summarize_prompt | summarize_llm | StrOutputParser()) produces a Runnable that outputs a text string. That text string is then passed as input to the second stage's prompt formatter (classify_prompt), and the full chain is chained together with |. This correctly implements the sequential summarize-then-classify pattern. WHY NOT B: RunnableParallel runs its branches concurrently on the SAME input — it does not chain the summary output into the classification input. It would attempt to classify the original document rather than the generated summary. WHY NOT C: The + operator is not a valid LCEL operator for chaining Runnables. This mixing of | and + will raise a TypeError. WHY NOT D: RunnableSequence is a valid internal LCEL class, but it expects each step to output the correct type for the next step. Passing the raw LLM object (summarize_llm, classify_llm) at the same level as prompt objects without parsers between them will fail to correctly thread texts between the steps.

7 Assembling and Deploying Applications

A team needs to index 1.2 billion embeddings at 768 dimensions from a static, annually refreshed document archive. Cost optimization is the primary concern and query latency up to 500 ms is acceptable. Which Vector Search configuration fits BEST?

  1. AStandard endpoint — because standard endpoints are cheapest and support up to 1.2B vectors
  2. BStandard endpoint with multiple indexes split across 4 endpoints — because each endpoint supports 320M vectors
  3. CStorage-optimized endpoint with a Delta Sync Index with triggered (non-continuous) sync — because storage-optimized endpoints support ~1B vectors at 768D, have pricing optimized for large vector counts, and non-continuous sync is appropriate for annual updates
  4. DDirect Vector Access Index on a storage-optimized endpoint with continuous sync — because the archive needs real-time updates
Show answer & explanation

Correct answer: C

WHY C is correct: 1.2 billion vectors exceeds the standard endpoint's ~320M capacity — a single storage-optimized endpoint supports ~1B at 768 dimensions. Storage-optimized pricing is optimized for large vector counts. Since the archive is only updated annually, non-continuous (triggered) sync is sufficient and avoids unnecessary continuous sync overhead. The 500ms latency tolerance accommodates the storage-optimized endpoint's ~250ms additional latency. WHY NOT A: Standard endpoints support only ~320M vectors at 768 dimensions. 1.2B vectors cannot fit in a single standard endpoint. WHY NOT B: Splitting across 4 standard endpoints is technically feasible but creates significant operational complexity — the application must fan out queries across 4 endpoints and merge results. It is more expensive than a single storage-optimized endpoint at scale and architecturally fragile. WHY NOT D: Storage-optimized endpoints do not support continuous sync mode per Databricks documentation. Additionally, 'real-time updates' contradicts the annual refresh requirement — continuous sync would be wasteful and architecturally misaligned.

8 Assembling and Deploying Applications

A developer uses the Databricks Vector Search Python SDK to query an index. The application must return at most 5 documents but must ONLY return documents where the 'status' column equals 'approved'. Which SDK call correctly implements this?

  1. Aindex.similarity_search(query_text='user question', num_results=5)
  2. Bindex.similarity_search(query_text='user question', num_results=5, filters={'status': 'approved'})
  3. Cindex.similarity_search(query_text='user question', num_results=5, where_clause="status = 'approved'")
  4. Dindex.similarity_search(query_text='user question', top_k=5, metadata_filter='status==approved')
Show answer & explanation

Correct answer: B

WHY B is correct: The Databricks Vector Search Python SDK's similarity_search() method accepts num_results for the result count limit and a filters parameter that takes a dictionary of column-value pairs for metadata filtering. {'status': 'approved'} restricts results to documents whose 'status' column equals 'approved'. WHY NOT A: This call is missing the status filter. It will return the top-5 most similar documents regardless of their status column value, potentially returning non-approved documents. WHY NOT C: where_clause is not a parameter in the Databricks Vector Search SDK's similarity_search() method. Vector Search filtering uses the filters dictionary parameter, not SQL WHERE clause strings. WHY NOT D: top_k and metadata_filter are not the correct parameter names in the Databricks Vector Search SDK. The correct parameters are num_results and filters respectively. Using incorrect parameter names will either cause errors or be silently ignored.

Take the full GenAI Engineer practice test →