CoStudy

HomeCertificationsDatabricks Generative AI Engineer › Application Development — RAG and Vector Search

Application Development — RAG and Vector Search — Databricks Generative AI Engineer practice questions

44 multiple-choice questions and 15 flashcards on Application Development — RAG and Vector Search, about 15% of the Databricks Generative AI Engineer bank. Every one carries a written rationale.

Written and maintained by Nick Burton · last updated 2026-08-22 · how we write and review questions

What this chapter covers

Application Development — RAG and Vector Search is one of 8 chapters in CoStudy's Databricks Generative AI Engineer bank, and it holds 44 of the bank's 300 multiple-choice questions — roughly 15% of the total. That proportion is not arbitrary: chapters follow the certifying body's published exam outline, and the number of questions in each is set by that domain's published weight, so the share of your practice time this chapter takes matches the share of the real exam it accounts for.

Studying by chapter is worth doing once you have a diagnostic score. A single overall percentage tells you whether you are close; it does not tell you which domain is dragging. Working a weak chapter in isolation, and re-testing it in isolation, is the fastest way to move a score that has stalled — and it is why the mock exams in CoStudy report by domain rather than as one number.

Free Application Development — RAG and Vector Search practice questions

10 questions drawn from this chapter, with the full rationale shown — the controlling principle behind the right answer, and why each wrong option tempts and fails.

A team already computes embeddings in an external system with a proprietary model and simply needs a serving-grade index to query them. Which Vector Search index type is MOST appropriate?

  1. Delta Sync index with a Databricks-managed embedding endpoint
  2. Delta Sync index with self-managed embeddings in a source column
  3. Direct Vector Access index, with the client writing vectors and metadata
  4. A standard Delta table with an approximate nearest neighbour SQL function

Answer: C — Direct Vector Access index, with the client writing vectors and metadata

C) Correct — Direct Vector Access is the mode for full client control of index contents, which suits vectors produced entirely outside Databricks. A) Managed embeddings would require Databricks to compute the vectors, discarding the proprietary model. B) Self-managed embeddings in a Delta Sync index are a reasonable alternative, but they require landing the vectors in a governed source table and accepting sync semantics, which is more coupling than the requirement implies. D) There is no substitute here for a purpose-built vector index; this option invents a workflow rather than using the service.

A team wants one interface through which the application can call an internally served open model today and a third-party model next quarter, without application code changes. Which is the BEST design?

  1. Call each provider's SDK directly and branch in application code on a config flag
  2. Route all calls through Model Serving endpoints so the provider swap is a serving-side change
  3. Wrap each provider in its own Databricks App and switch the app URL when needed
  4. Store the provider choice in a Delta table read by the chain at every request

Answer: B — Route all calls through Model Serving endpoints so the provider swap is a serving-side change

B) Correct — Model Serving presents a consistent endpoint interface for both hosted and external models, so changing providers becomes an endpoint configuration change rather than a code change. A) Branching on SDKs pushes provider differences into the application, which is exactly what the requirement forbids. C) Wrapping providers in separate apps duplicates the serving layer and still requires clients to change targets. D) Reading a provider flag from a table still leaves the application holding provider-specific call code.

Why split prompts into system + user + assistant roles?

  1. Spark requires these role fields when calling any serving endpoint
  2. Roles encrypt the message content in transit to the model provider
  3. Roles compress the conversation into fewer billable prompt tokens
  4. Chat-tuned models follow roles, separating policy from user input

Answer: D — Chat-tuned models follow roles, separating policy from user input

D) Correct - chat models are trained on the role convention, so system instructions, user input, and prior assistant turns stay distinguishable. A) Spark has nothing to do with the chat message format. B) Roles are plain metadata, not a security control. C) Roles add structure and a few tokens; they do not compress anything.

A downstream service requires the assistant's output as JSON with four required keys. Which approach is MOST reliable?

  1. Request a structured output schema and validate the response
  2. Ask the model in the prompt to "respond in JSON" and parse whatever comes back
  3. Post-process the free-text answer with a regular expression to build the JSON
  4. Lower temperature to zero so the format never varies between calls

Answer: A — Request a structured output schema and validate the response

A) Correct — constraining generation to a declared schema and then validating gives both a strong prior and a definitive check before the payload leaves your code. B) A prompt request alone is unenforced; the model will eventually emit prose or wrap the object in commentary. C) Regular expressions over free text are brittle and fail silently on the cases you did not anticipate. D) Zero temperature reduces variation but does not guarantee schema conformance, and it is a common misconception that it does.

A team notices that a provisioned throughput endpoint frequently sits far below its reserved capacity, yet occasional bursts are throttled. The MOST reasonable adjustment is:

  1. Reduce reserved capacity and route overflow traffic to a pay-per-token endpoint
  2. Increase reserved capacity to the peak burst level and accept the idle time
  3. Convert the workload to batch inference so bursts are queued
  4. Add a second identical provisioned endpoint and split traffic evenly

Answer: A — Reduce reserved capacity and route overflow traffic to a pay-per-token endpoint

A) Correct — sizing reservation to the sustained band and letting rare peaks spill to pay-per-token matches spend to the actual traffic shape. B) Provisioning for the peak pays continuously for capacity that is used only occasionally, which is the cost problem stated. C) Batch inference cannot serve interactive traffic; queueing bursts would break the user experience. D) Two endpoints split evenly leaves both underutilized most of the time and still cap out together during a burst.

Chain-of-thought prompting:

  1. It makes responses shorter by skipping the intermediate explanation
  2. It elicits step-by-step reasoning, aiding multi-step tasks at some cost
  3. It lowers token usage by compressing the reasoning into fewer steps
  4. It is unsafe because the visible reasoning can leak the system prompt

Answer: B — It elicits step-by-step reasoning, aiding multi-step tasks at some cost

B) Correct - asking for intermediate steps improves accuracy on arithmetic and multi-hop questions, at the price of longer, costlier outputs. A) It lengthens responses rather than shortening them. C) Token usage rises for the same reason. D) It is not inherently unsafe; exposing reasoning to users is a separate design choice.

An app needs to retrieve relevant document chunks for an LLM. Which Databricks service should you use?

  1. Delta Lake for ACID storage of source tables
  2. Databricks Vector Search similarity index
  3. Unity Catalog for permissions and lineage
  4. Auto Loader for incremental file ingestion

Answer: B — Databricks Vector Search similarity index

B) Correct — Vector Search is the managed vector index that serves semantic similarity retrieval. A) Delta Lake stores the source data but does not perform similarity retrieval. C) Unity Catalog governs access and lineage over those assets. D) Auto Loader ingests files incrementally into tables.

An application must call a third-party proprietary model that Databricks does not host, while keeping a single governed interface for the app. The MOST appropriate mechanism is:

  1. An external model endpoint in Model Serving, with credentials stored as a secret
  2. A Unity Catalog function that issues an HTTP request to the provider from SQL
  3. Embedding the provider SDK inside the chain and reading the key from an environment variable
  4. A provisioned throughput endpoint configured with the provider's model name

Answer: A — An external model endpoint in Model Serving, with credentials stored as a secret

A) Correct — external model endpoints expose a third-party provider through the same Model Serving interface, so governance, rate limiting, and logging apply uniformly. B) Hand-rolling HTTP calls from a SQL function bypasses the serving layer's routing, credential handling, and usage tracking. C) Embedding the SDK and reading keys from the environment scatters credentials and loses centralized control. D) Provisioned throughput applies to models Databricks hosts; you cannot reserve capacity on a provider Databricks does not serve.

To call an External Model (e.g., Anthropic Claude) from Databricks, you should:

  1. Paste the provider's API key directly into the notebook making the call
  2. Call the provider with curl and the key inlined in the request source
  3. Route calls through a third-party gateway hosted outside the workspace
  4. Register it as an External Model in Mosaic AI Serving, with secrets

Answer: D — Register it as an External Model in Mosaic AI Serving, with secrets

D) Correct - registering the provider gives one governed endpoint with Databricks-managed secrets, unified logging, and permissions. A) A key in notebook source leaks through history and sharing. B) Inline curl credentials have the same exposure plus no logging. C) An external gateway moves auth and audit outside your governance boundary.

If a Delta Sync vector index supports embedding via an endpoint, which is true?

  1. You must compute embeddings externally and write vectors into the index
  2. Only English source text can be embedded through this managed endpoint
  3. Only the text column is stored; metadata columns cannot be synced along
  4. Databricks embeds source rows with the specified endpoint as data syncs

Answer: D — Databricks embeds source rows with the specified endpoint as data syncs

D) Correct - in this configuration the index is wired to an embedding model endpoint and vectors are produced automatically as the Delta source syncs. A) That describes a direct-access index, where you supply the vectors. B) The language supported depends on the chosen embedding model, not the index type. C) Additional columns can be synced and returned as metadata alongside the text.

Application Development — RAG and Vector Search flashcards

4 cards from the 15 in this chapter.

Foundation Model APIs (pay-per-token)?

Databricks-hosted LLMs via simple API: DBRX, Llama 3.1, Mixtral, Claude (via Anthropic). No infrastructure to manage.

Contrast pay-per-token and provisioned throughput modes of the Foundation Model APIs.

Pay-per-token bills per token with no capacity reservation — ideal for prototyping and spiky low-volume traffic. Provisioned throughput reserves dedicated capacity for predictable latency and higher sustained rates, which suits production workloads.

What does a self-managed embeddings configuration mean for a Vector Search index?

You compute embeddings yourself and store them in a column of the source table, and the index uses that column directly. With managed embeddings you instead point the index at a text column plus an embedding model endpoint and Databricks computes vectors for you.

Databricks Vector Search?

Managed vector index built on Delta tables. Sync mode keeps vectors fresh with source data. Direct access for low-latency queries.

Practise the full chapter

These are a sample. The full Application Development — RAG and Vector Search chapter runs 59 items with per-chapter progress tracking, on the web and in the iOS app.

Open Databricks Generative AI Engineer in CoStudy →

Other Databricks Generative AI Engineer chapters

All Databricks Generative AI Engineer practice questions →