SaveMyCert
Log in
5 of 5 free questions left today·for 30 a day
Databricks GenAI · Domain 2

Data Preparation practice questions

Data Preparation is worth 14% of the Databricks GenAI exam — the 3rd-heaviest of the 6 domains. Preparing knowledge for RAG: choosing source documents, extracting and filtering content, chunking strategies, writing chunks to Delta tables in Unity Catalog, evaluating retrieval and re-ranking. Official weighting 14%. 6 fully worked examples are further down this page, answers included.

Exam weight
14%
the 3rd-heaviest of the 6 domains
Questions
84
across 2 topics
Free, no account
5/day
a free account allows 30 a day
Explanations
Every option
right and wrong

Build a practice session

5 free questions left today.

Domains

How many?

Mode

Ready when you are

10 fresh questions drawn across 1 of 6 domains, in Learn mode.

Focused review

Every question you answer incorrectly, and every question you flag while practising, is saved here automatically. Finish a session and you can come back to re-drill just those.

6 sample Data Preparation questions, fully explained

Questions from the Databricks GenAI bank mapped to domain 2, with the answer key and the reasoning behind every option. None of them repeat the examples on the main Databricks GenAI practice page.

Question 1Data Preparation

A Generative AI Engineer is indexing a help center exported as HTML. Every article uses <h2> and <h3> elements for its sections. The team wants each chunk to stay inside one section and to carry the section titles as metadata so answers can cite them. Which approach should the engineer use to split the pages?

Choose one.

  • a
    BeautifulSoup get_text() followed by a RecursiveCharacterTextSplitter pass

    get_text() flattens the page into plain text, so the header structure is lost before splitting. Chunks follow character counts and carry no section-title metadata.

  • b
    RecursiveCharacterTextSplitter.from_language() with the Language.HTML setting

    The HTML language preset prefers to break at tags, but it does not record which section a chunk belongs to, so the section titles are not attached as metadata.

  • c
    LangChain MarkdownHeaderTextSplitter configured for the ## and ### headers

    MarkdownHeaderTextSplitter looks for Markdown # markers. Raw HTML uses <h2>/<h3> elements, so it would find no headers and return the page unsplit.

  • d
    LangChain HTMLHeaderTextSplitter configured to split on the h2 and h3 tags Correct

    HTMLHeaderTextSplitter splits at the header elements you list and attaches each header's text to the resulting chunks as metadata, which is exactly the section-aligned output required.

The concept

Structure-aware splitters split on a document's own headings and keep those headings as chunk metadata.

Why that’s the answer

The requirement has two parts: chunks bounded by sections, and section titles kept as metadata. HTMLHeaderTextSplitter does both for HTML. Flattening with get_text() loses the structure, the HTML language preset ignores which section a chunk sits in, and the Markdown splitter expects # markers rather than heading elements.

How to reason it out
  1. Identify the source format (HTML with heading elements).
  2. Note both requirements: section-bounded chunks and header metadata.
  3. Pick the splitter that understands that format's headers and records them.

Exam tip: Match the splitter to the format: HTML headings use HTMLHeaderTextSplitter, Markdown headings use MarkdownHeaderTextSplitter.

Databricks GenAI Engineer: Document Extraction, Filtering and Chunking into Delta Tables — the lesson that teaches this.

Question 2Data Preparation

A Generative AI Engineer is preparing product manuals written in Markdown, with # and ## headings for each feature. Users ask about one feature at a time, and retrieved chunks currently mix the end of one feature's section with the start of the next. Each chunk should stay within one feature and record its heading. Which splitter should the engineer use?

Choose one.

  • a
    MarkdownHeaderTextSplitter with headers_to_split_on set for # and ## Correct

    It splits the manual at the listed Markdown headings, so a chunk never crosses into the next feature, and it stores the heading text in each chunk's metadata.

  • b
    CharacterTextSplitter with a fixed 800-character chunk_size and no overlap

    A fixed character count ignores headings, which is exactly why chunks currently run from one feature into the next.

  • c
    SemanticChunker with an embedding model and the percentile threshold

    Semantic chunking splits where embeddings shift, which may or may not match the headings, and it does not record the heading text as metadata.

  • d
    TokenTextSplitter with a chunk_size of 400 tokens and no overlap set

    Counting tokens controls size but not boundaries. Chunks would still cut across feature sections and carry no heading.

The concept

Header-based splitting uses the document's own structure as chunk boundaries.

Why that’s the answer

When a document already marks its topics with headings, splitting on those headings gives coherent chunks and free metadata. Fixed character or token splitters ignore the headings, and semantic chunking guesses at boundaries the author already wrote down.

How to reason it out
  1. Spot that the documents have explicit structure (# and ## headings).
  2. Note the problem: chunks cross section boundaries.
  3. Use the splitter that splits on that structure and keeps the heading as metadata.

Exam tip: Documents with headings: split on the headings, not on a character count.

Databricks GenAI Engineer: Document Extraction, Filtering and Chunking into Delta Tables — the lesson that teaches this.

Question 3Data Preparation

A Generative AI Engineer embeds policy sections with an embedding model that accepts at most 512 tokens per input. The chunking job produces chunks of about 1,500 tokens. Evaluation shows that questions about details near the end of a section never retrieve that section, while questions about its opening lines work well. What should the engineer change?

Choose one.

  • a
    Raise num_results from 5 to 20 so more embedded chunks reach the prompt

    Retrieving more results cannot surface text that was never embedded; the tail of each section is invisible to the vector index whatever the result count.

  • b
    Re-chunk so every chunk stays under 512 tokens of the embedding model Correct

    Input beyond the model's limit is truncated, so the last two-thirds of each chunk was never embedded. Smaller chunks put every part of the section into some vector.

  • c
    Raise chunk_overlap to 300 tokens while keeping the 1,500-token chunks

    Overlap repeats text across neighbouring chunks, but each chunk is still truncated at 512 tokens, so most of the tail content stays unembedded.

  • d
    Move to a generator model that accepts a much larger context window per request

    The generator's context window affects how much retrieved text fits in the prompt, not what the embedding model saw. The missing sections are never retrieved in the first place.

The concept

An embedding model truncates input past its token limit, so oversized chunks are only partly represented in the index.

Why that’s the answer

The pattern (openings retrievable, endings not) is the signature of truncation at embedding time. Keeping chunks under the embedding model's limit fixes it. Raising the result count, overlap or generator context all act after embedding and cannot recover text the vectors never contained.

How to reason it out
  1. Compare chunk length with the embedding model's input limit.
  2. Link the symptom (tail content never matches) to truncation.
  3. Fix chunk size at the source rather than tuning retrieval or generation.

Exam tip: Chunks longer than the embedding model's limit are silently truncated: size chunks to the embedding model.

Databricks GenAI Engineer: Document Extraction, Filtering and Chunking into Delta Tables — the lesson that teaches this.

Question 4Data Preparation

A Generative AI Engineer is sizing chunks for a RAG chain. The embedding model accepts 8,192 tokens. The generator's context window is 8,192 tokens, the prompt template and chat history use up to 1,500 tokens, and 1,000 tokens must be reserved for the answer. The chain must pass at least five retrieved chunks. Which configuration meets every constraint?

Choose one.

  • a
    Chunks of up to 1,000 tokens, with five chunks retrieved per query Correct

    Five chunks of 1,000 tokens use 5,000 tokens. Adding 1,500 for the prompt and 1,000 for the answer gives 7,500, inside the 8,192-token window, and the five-chunk minimum is met.

  • b
    Chunks of up to 1,200 tokens, with five chunks retrieved per query

    Five chunks of 1,200 tokens use 6,000 tokens; with 2,500 for prompt and answer the total is 8,500, which overflows the 8,192-token window.

  • c
    Chunks of up to 2,800 tokens, with just two chunks retrieved for each query

    Two 2,800-token chunks plus prompt and answer total 8,100 tokens and fit, but two chunks break the requirement to pass at least five.

  • d
    Chunks of up to 600 tokens, with ten chunks retrieved per query

    Ten 600-token chunks use 6,000 tokens; with 2,500 for prompt and answer the total is 8,500, which overflows the window.

The concept

Chunk size is bounded by the embedding limit and by the generator's context budget: k x chunk size + prompt + answer must fit the window.

Why that’s the answer

Here the embedding limit (8,192) is not the binding constraint; the generator is. The space left for retrieved text is 8,192 - 1,500 - 1,000 = 5,692 tokens. Five chunks of up to 1,000 tokens fit. The 1,200 x 5 and 600 x 10 options overflow, and 2,800 x 2 fits but passes too few chunks.

How to reason it out
  1. Work out the retrieval budget: context window minus prompt minus reserved answer.
  2. Check each option's k x chunk size against that budget.
  3. Discard options that fit but break the minimum chunk count.

Exam tip: Budget the generator's window: chunks retrieved x chunk size must leave room for the prompt and the answer.

Databricks GenAI Engineer: Document Extraction, Filtering and Chunking into Delta Tables — the lesson that teaches this.

Question 5Data Preparation

A Generative AI Engineer uses the embedding model BAAI/bge-large-en-v1.5, which counts input with its own WordPiece tokenizer and truncates past 512 tokens. Chunks must fill most of that limit without ever exceeding it. The current splitter, RecursiveCharacterTextSplitter(chunk_size=512), produces chunks of only about 120 tokens. Which splitter configuration should the engineer use?

Choose one.

  • a
    RecursiveCharacterTextSplitter.from_tiktoken_encoder(encoding_name="cl100k_base", chunk_size=500)

    This counts tokens, but with an OpenAI tokenizer. Its counts differ from bge's WordPiece counts, so some chunks can still exceed 512 model tokens.

  • b
    RecursiveCharacterTextSplitter(chunk_size=2000) keeping the default len length function

    The default length function counts characters. Four characters per token is only an average, so some 2,000-character chunks will exceed 512 tokens.

  • c
    RecursiveCharacterTextSplitter.from_huggingface_tokenizer with the bge tokenizer, chunk_size=500 Correct

    The length function then counts tokens exactly as the embedding model does, so a 500-token chunk is 500 model tokens: close to the limit and never over it.

  • d
    RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=100) with the default len

    Still measured in characters, so chunks stay far below the token limit; adding overlap does not change how length is counted.

The concept

Splitters measure length with a length function: by default characters, optionally tokens from a specific tokenizer.

Why that’s the answer

Two facts combine. First, chunk_size is in characters unless you change the length function, which is why 512 produced ~120-token chunks. Second, a token limit is only guaranteed if you count with the same tokenizer the model uses; tiktoken's counts differ from bge's WordPiece. from_huggingface_tokenizer with the model's tokenizer satisfies both.

How to reason it out
  1. Recognise that the default length function counts characters, not tokens.
  2. Note the limit is defined by the embedding model's own tokenizer.
  3. Choose the token-based constructor that uses that same tokenizer.

Exam tip: Measure chunks in the embedding model's own tokens; characters and other tokenizers only approximate the limit.

Databricks GenAI Engineer: Document Extraction, Filtering and Chunking into Delta Tables — the lesson that teaches this.

Question 6Data Preparation

A Generative AI Engineer reviews failed answers from a RAG assistant over installation guides. In several cases the retrieved chunk ends with a step such as "before restarting the service, set the following flag:", and the flag itself sits at the start of the next chunk, which was not retrieved. What change to the chunking job addresses this most directly?

Choose one.

  • a
    Add a chunk_overlap of roughly 10-20 percent of the chunk size Correct

    Overlap copies the end of each chunk into the start of the next, so a sentence or step that crosses a boundary appears whole in at least one chunk.

  • b
    Raise the number of retrieved chunks from three to ten per query

    More results might include the next chunk by luck, but it adds unrelated text to every prompt and does not keep the step together.

  • c
    Lower the generator's temperature so that its answers are more exact

    Temperature changes how the model samples tokens. It cannot supply a flag that is missing from the retrieved context.

  • d
    Switch to CharacterTextSplitter with a fixed 1,000-character length

    Fixed-length splitting still cuts wherever the count runs out, so steps would keep breaking across chunk boundaries.

The concept

Chunk overlap preserves context that straddles a chunk boundary.

Why that’s the answer

The failure is a boundary cut: the instruction and its value land in different chunks. A modest overlap repeats the end of each chunk at the start of the next so the pair appears together. More results is a workaround that adds noise, temperature does nothing for missing context, and fixed-length splitting is the cause rather than the cure.

How to reason it out
  1. Diagnose the failure as content split across a chunk boundary.
  2. Pick the chunking setting that repeats boundary text in adjacent chunks.
  3. Keep overlap moderate so the index does not balloon with duplicate text.

Exam tip: Facts cut at chunk boundaries: add modest overlap between adjacent chunks.

Databricks GenAI Engineer: Document Extraction, Filtering and Chunking into Delta Tables — the lesson that teaches this.

What Databricks GenAI domain 2 tests, topic by topic

The official exam guide breaks Data Preparation into 2 topics. The question bank follows the same split, so a weak topic shows up as a cluster of misses you can go back and read.

Published Databricks GenAI practice questions per topic in Data Preparation
TopicWhat it coversQuestions
Document extraction, filtering and chunking into Delta tablesOfficial exam guide (March 18, 2026), Section 2 objectives: Apply a chunking strategy for a given document structure and model constraints; Filter extraneous content in source documents that degrades quality of a RAG application; Choose the appropriate Python package to extract document content from provided source data and format; Define operations and sequence to write given chunked text into Delta Lake tables in Unity Catalog; Identify needed source documents that provide necessary knowledge and quality for a given RAG application.42
Retrieval evaluation, advanced chunking and re-rankingOfficial exam guide (March 18, 2026), Section 2 objectives: Use tools and metrics to evaluate retrieval performance; Design retrieval systems using advanced chunking strategies; Explain the role of re-ranking in the information retrieval process.42
Total84

Revise Data Preparation before you drill it

Other Databricks GenAI domains

Data Preparation: your questions

Data Preparation is domain 2 of the Databricks GenAI exam guide and carries 14% of the scored content — the 3rd-heaviest of the 6 domains. On a 45-question paper that works out to roughly 6 questions, though Databricks does not publish an exact per-domain count and individual exam forms vary.

Source

The domain weight and topic list on this page come from the official Databricks GenAI exam guide.