Skip to content

Professional Data Engineer · Domain 4: Preparing and using data for analysis · 15% of the exam

Task 4.2: Preparing data for AI and ML.

Feature engineering, training and serving with BigQuery ML and Agent Platform, and preparing unstructured data for embeddings and retrieval-augmented generation.

Study it

Sample questions

Try each one before opening the answer. Every option is explained, with the Google Cloud documentation page that proves it.

Question 1 · choose 1

A data scientist trains a BigQuery ML logistic regression model on features built in the training SELECT with ML.QUANTILE_BUCKETIZE and ML.FEATURE_CROSS. An application team later calls ML.PREDICT on raw rows and gets poor results, because they did not repeat the same feature logic. How should the model be rebuilt so that this cannot happen again?

  1. ARegister the model in Agent Platform and serve it from an online endpoint
  2. BSave the feature SELECT as a view and ask callers to predict from it
  3. CStore the engineered features in a table that callers must join to
  4. DMove the feature logic into the TRANSFORM clause of CREATE MODEL
Show the answer and why
  • ARegister the model in Agent Platform and serve it from an online endpoint

    Incorrect

    Serving from an endpoint changes where predictions run, but callers would still have to send already engineered features.

  • BSave the feature SELECT as a view and ask callers to predict from it

    Incorrect

    A view helps only if every caller remembers to use it; the logic is still outside the model.

  • CStore the engineered features in a table that callers must join to

    Incorrect

    A feature table covers rows that already exist, not new raw rows, and still depends on callers doing the right join.

  • DMove the feature logic into the TRANSFORM clause of CREATE MODEL

    Correct

    Preprocessing in TRANSFORM is stored with the model and applied automatically by ML.EVALUATE and ML.PREDICT, so callers pass raw columns.

The TRANSFORM clause makes feature preprocessing part of the model. The same transformations then run automatically at evaluation and prediction time, which removes the gap between how features were built for training and how they are built when the model is used.

Question 2 · choose 1

A support team wants a retrieval-augmented generation assistant over 30,000 product manuals in PDF, full of nested headings and tables. In tests, plain OCR text split every 500 tokens produced chunks that lost the section they belonged to and cut tables in half. What should the data engineer use to prepare the documents?

  1. AOne text embedding for each whole PDF, without splitting the text
  2. BThe Document AI layout parser with its layout-aware chunking
  3. CSensitive Data Protection to inspect and redact each PDF first
  4. DAn object table with AI.GENERATE_TEXT to summarize each PDF
Show the answer and why
  • AOne text embedding for each whole PDF, without splitting the text

    Incorrect

    Embedding models have input token limits, and one vector per manual cannot point retrieval at the relevant passage.

  • BThe Document AI layout parser with its layout-aware chunking

    Correct

    The layout parser recognizes headings, tables and lists and produces chunks that carry their ancestor headings, which is what search and RAG pipelines need.

  • CSensitive Data Protection to inspect and redact each PDF first

    Incorrect

    Redaction protects sensitive data but does nothing for the chunk structure that is failing here.

  • DAn object table with AI.GENERATE_TEXT to summarize each PDF

    Incorrect

    Summaries throw away the detail that answers need, and do not fix how the content is chunked.

Retrieval quality depends on chunks that make sense on their own. The Document AI layout parser, built on OCR and Gemini, extracts document structure and produces semantically coherent chunks augmented with their headings, so a retrieved chunk still says which section and table it came from.

Question 3 · choose 2

A retailer keeps 30 million product descriptions in BigQuery and wants a "similar products" search driven by meaning, not keywords, built entirely in SQL by its analytics team, with fast queries at that size. Which TWO steps should the data engineer take? (Choose TWO.)

  1. ACreate a search index on the description column for SEARCH queries
  2. BGenerate embeddings for the descriptions with AI.GENERATE_EMBEDDING
  3. CCluster the table on the product category column
  4. DCreate a vector index and query it with VECTOR_SEARCH
  5. EUse APPROX_TOP_COUNT over the description words for each product
Show the answer and why
  • ACreate a search index on the description column for SEARCH queries

    Incorrect

    Search indexes speed up token matching with SEARCH, which is keyword lookup rather than similarity of meaning.

  • BGenerate embeddings for the descriptions with AI.GENERATE_EMBEDDING

    Correct

    AI.GENERATE_EMBEDDING calls an embedding model from SQL and stores a vector per description that captures its meaning.

  • CCluster the table on the product category column

    Incorrect

    Clustering prunes by category value; it does not find descriptions with similar meaning.

  • DCreate a vector index and query it with VECTOR_SEARCH

    Correct

    A vector index lets VECTOR_SEARCH find nearest neighbours approximately and quickly over millions of embeddings.

  • EUse APPROX_TOP_COUNT over the description words for each product

    Incorrect

    Counting frequent words is still keyword statistics, not semantic similarity.

Semantic search in BigQuery has two parts: embeddings, generated in SQL with AI.GENERATE_EMBEDDING from a text embedding model, and vector search, where VECTOR_SEARCH finds the closest vectors and a vector index makes that fast at large scale.

Question 4 · choose 1

An insurer stores scanned claim forms as PDFs in Cloud Storage. Its analysts, who work only in SQL, need the claim number, date and amount from each form in a BigQuery table that they can join to policy data. What should the data engineer set up?

  1. AA load job of the PDF files into a BYTES column of a native table
  2. BA BigLake table over the bucket with a PDF file format option
  3. CAn object table over the PDFs and ML.PROCESS_DOCUMENT with a Document AI processor
  4. DSensitive Data Protection inspection jobs that list the forms' fields
Show the answer and why
  • AA load job of the PDF files into a BYTES column of a native table

    Incorrect

    Loading the files as bytes stores them but extracts nothing from them.

  • BA BigLake table over the bucket with a PDF file format option

    Incorrect

    BigLake tables read structured formats such as Parquet or CSV; scanned PDFs are unstructured data.

  • CAn object table over the PDFs and ML.PROCESS_DOCUMENT with a Document AI processor

    Correct

    An object table exposes the files to SQL, and ML.PROCESS_DOCUMENT sends them through a Document AI processor via a remote model, returning the parsed fields.

  • DSensitive Data Protection inspection jobs that list the forms' fields

    Incorrect

    Inspection finds sensitive information types; it does not extract a form's business fields into a table.

BigQuery can work on unstructured data: object tables describe the files in a bucket, and ML.PROCESS_DOCUMENT runs a Document AI processor over them through a remote model, returning structured results that SQL can use like any other column.

Question 5 · choose 1

A BigQuery ML boosted tree model scores loan applications well in batch with ML.PREDICT. The lending app now needs a score for each application within about 100 ms while the applicant waits, without the team building a serving container. What should the data engineer do?

  1. ARegister the model in Model Registry and deploy it to an endpoint
  2. BCall ML.PREDICT through the BigQuery API for each application
  3. CPrecompute scores for each possible applicant in a nightly batch
  4. DRetrain the model each hour so that it stays close to new data
Show the answer and why
  • ARegister the model in Model Registry and deploy it to an endpoint

    Correct

    Registered BigQuery ML models can be deployed from Model Registry to an Agent Platform endpoint for online prediction, with no serving container to build.

  • BCall ML.PREDICT through the BigQuery API for each application

    Incorrect

    A BigQuery query per request carries job overhead and is not meant as a low-latency online serving path.

  • CPrecompute scores for each possible applicant in a nightly batch

    Incorrect

    New applications are not known in advance, so their scores cannot be precomputed.

  • DRetrain the model each hour so that it stays close to new data

    Incorrect

    Retraining frequency affects freshness, not how quickly a single prediction is returned.

BigQuery ML is strong for training and batch scoring next to the data. For online serving, a model registered in Model Registry, either at creation with the MODEL_REGISTRY option or later, can be deployed to an endpoint in Agent Platform and called with low latency.

Question 6 · choose 1

A team wants a question-answering assistant grounded in 5,000 policy documents stored in Cloud Storage and Google Drive. It does not want to build and run its own parsing, chunking, embedding and retrieval pipeline, and it wants to choose a managed vector store. What should it use?

  1. AA BigQuery table of documents queried with the SEARCH function
  2. BA fine-tuned Gemini model trained on the policy documents
  3. CA Dataflow pipeline that embeds the files into Bigtable
  4. DRAG Engine on Agent Platform with a corpus built from both sources
Show the answer and why
  • AA BigQuery table of documents queried with the SEARCH function

    Incorrect

    Keyword search returns matching rows but provides none of the RAG steps the team wants managed.

  • BA fine-tuned Gemini model trained on the policy documents

    Incorrect

    Fine-tuning changes model behaviour; it does not ground answers in the current documents or cite them, and needs retraining as they change.

  • CA Dataflow pipeline that embeds the files into Bigtable

    Incorrect

    This is the custom pipeline the team wants to avoid, and Bigtable would still need a retrieval layer on top.

  • DRAG Engine on Agent Platform with a corpus built from both sources

    Correct

    RAG Engine ingests from Cloud Storage and Google Drive, parses, chunks, embeds and indexes the content into a corpus, and retrieves it to ground the model's answers.

RAG Engine is the managed path for retrieval-augmented generation: it handles ingestion, parsing, chunking, embedding, indexing into a corpus with a choice of vector stores, and retrieval for grounded generation.

Practise domain 4 →Practise all domains →