Explore / Google Cloud Professional Data Engineer Exam Prep / Practice questions
Google Cloud Professional Data Engineer practice questions
10 questions from the bank behind this course's timed mock. Free to read and to answer, no account needed, and each has its answer and an explanation. They belong to Google Cloud Professional Data Engineer Exam Prep.
Answer them one at a time →Read lesson 1 free
Question 1
A payments company is building a ledger that customers in North America, Europe and Asia write to. The requirements say that every balance read must be strongly consistent across regions, so a customer never sees a stale balance in any region. Which option best meets this requirement?
- A Cloud SQL instance in one region, with every application connecting to it
- Spanner, configured to span the regions the company serves
- JSON files in a Cloud Storage bucket, with one file per customer account
- BigQuery tables that are loaded from the application every night
Show the answer
Answer: B. Spanner, configured to span the regions the company serves
The constraint words "strongly consistent across regions" point to Spanner, which is built for global consistency. A single-region Cloud SQL instance is the closest distractor: it is a sound database, but it is a single-region design, which is exactly what this constraint excludes.
Question 2
A data engineer at a Frankfurt insurer builds a pipeline that reads claim files from a Cloud Storage bucket in europe-west3 and writes the results to a BigQuery dataset in europe-west3. German law requires that claim data never leaves Germany, including while it is being processed. The Dataflow job was launched without a region, and its workers are running in us-central1. What should the engineer do?
- Relaunch the Dataflow job with --region=europe-west3 so the workers process data inside Germany
- Encrypt the bucket and dataset with customer-managed encryption keys stored in europe-west3
- Leave the job as it is, because the data's source and sink are both in europe-west3, so it stays resident
- Put the project in a VPC Service Controls perimeter that protects storage.googleapis.com and bigquery.googleapis.com
Show the answer
Answer: A. Relaunch the Dataflow job with --region=europe-west3 so the workers process data inside Germany
Compliance covers compute as well as storage, so data handled by workers in us-central1 has left Germany even though both ends are in Frankfurt. The fix is to run the workers in europe-west3. Encryption keys protect what the data says, not where it is processed, so CMEK doesn't solve a residency problem.
Question 3
A logistics company runs its order-enrichment pipeline on Google Cloud today. The legal team warns that within two years some workloads may have to move to an on-premises data centre or to another cloud provider. As the data engineer, you want to write the pipeline once and avoid rewriting the business logic if that move happens. What should you do?
- Use BigQuery Omni to run the transformation logic so it can execute in AWS or Azure regions
- Implement the transforms as BigQuery scheduled queries, because SQL can be ported to any database
- Write the transforms in Apache Beam and run them on Dataflow now, keeping the option to switch to a Flink or Spark runner later
- Store the output as Apache Iceberg tables in Cloud Storage so the pipeline code becomes portable
Show the answer
Answer: C. Write the transforms in Apache Beam and run them on Dataflow now, keeping the option to switch to a Flink or Spark runner later
Beam keeps pipeline logic in one portable place that can run on Dataflow, Flink or Spark runners, so moving the pipeline means changing the runner, not rewriting the code. Iceberg makes the stored data portable, but it does nothing for the pipeline code itself.
Question 4
A data engineer at a retailer is building a nightly batch pipeline with the Apache Beam Python SDK. She wants to test it on her laptop against a small sample file, then run the same code on Google Cloud as a serverless, autoscaling job without rewriting it. What should she do?
- Package the pipeline as a Flex Template first, because pipelines can only run on Dataflow from a template
- Write the pipeline once for local testing, then rewrite the transforms as Dataproc Spark jobs for production
- Keep DirectRunner in production and run it on a large Compute Engine VM so it can handle the full data volume
- Run it with --runner=DirectRunner locally, then run the same code with --runner=DataflowRunner plus the project, region and temp_location options
Show the answer
Answer: D. Run it with --runner=DirectRunner locally, then run the same code with --runner=DataflowRunner plus the project, region and temp_location options
Beam describes the pipeline and the runner executes it, so changing the runner option moves the same code from a laptop to fully managed Dataflow. Flex Templates are useful for letting others launch a job, but you don't need one: the lesson launches directly with python orders.py --runner=DataflowRunner.
Question 5
A data engineer must enrich a 2 million-row BigQuery table with Gemini-generated summaries. Before running the job, finance wants a token-based cost estimate, and the estimate itself must not trigger any billable generation calls. What should the engineer do?
- Run the AI.GENERATE_TEXT query as a BigQuery dry run and use the reported bytes processed as the estimate
- Run AI.GENERATE_TEXT on a 10,000-row LIMIT sample and scale the measured cost up to 2 million rows
- Run AI.COUNT_TOKENS over the prompts to count input tokens, add an expected output size per row, and multiply by current per-token prices
- Set max_output_tokens to 64 on the full query, since that caps the total cost of the job
Show the answer
Answer: C. Run AI.COUNT_TOKENS over the prompts to count input tokens, add an expected output size per row, and multiply by current per-token prices
AI.COUNT_TOKENS counts tokens without making a billable generation call, so you can turn the count into a token-based cost estimate. A dry run only reports bytes scanned, not model tokens. The sample run still makes real, billed Gemini calls.
Question 6
An online game shows a player's session state and inventory summary on every screen transition, and those reads must return in well under a millisecond. The authoritative player data must survive restarts and outages. As the data engineer, you need an architecture that meets the latency target without risking data loss. What should you recommend?
- Keep the authoritative player data in a durable database and put Memorystore in front of it as a cache for the hot reads
- Store player data in Cloud Storage as one object per player and read the objects on each screen transition
- Serve the reads directly from BigQuery using a table clustered on player_id
- Store player data only in Memorystore, because it gives sub-millisecond reads and is a fully managed service
Show the answer
Answer: A. Keep the authoritative player data in a durable database and put Memorystore in front of it as a cache for the hot reads
Memorystore gives sub-millisecond in-memory access but is a cache, so the durable copy must live in a database behind it. Using Memorystore as the only copy is the trap: it meets the latency target but breaks the durability requirement.
Question 7
An IoT team loads several terabytes of sensor readings into BigQuery every day. They keep the data for 90 days, and almost every query filters on a narrow window of `reading_ts`, such as the last 3 hours. Analysts complain that queries scan a whole day of data even when they need only a few hours. What should the data engineer do to cut the bytes scanned the most?
- Switch to ingestion-time partitioning and filter on _PARTITIONDATE
- Keep daily partitioning on DATE(reading_ts) and turn on require_partition_filter
- Partition the table by TIMESTAMP_TRUNC(reading_ts, HOUR) so that each hour is its own partition
- Partition by RANGE_BUCKET on reading_ts converted to epoch seconds, with an interval of one day
Show the answer
Answer: C. Partition the table by TIMESTAMP_TRUNC(reading_ts, HOUR) so that each hour is its own partition
Hourly partitioning suits high-volume data kept for less than about six months: 90 days is about 2,160 partitions, well under the 10,000 limit, and a 3-hour filter then prunes down to 3 partitions. Daily partitioning with require_partition_filter only blocks full-table scans; each query still reads a whole day.
Question 8
A data engineering team builds a sales mart in BigQuery from five steps: staging tables cleaned from raw orders, a deduplicated customers table, and finally a daily summary that depends on both. They want the steps to run in dependency order, to fail the build if key columns contain NULLs, and to have every change go through code review in Git. What should they use?
- Dataform SQLX definitions that use ref() between tables, with assertions and a Git-backed repository
- Data Studio calculated fields on one blended data source that joins the raw tables
- Five BigQuery scheduled queries, staggered an hour apart so each runs after the one before it
- Looker persistent derived tables chained together with a shared datagroup trigger
Show the answer
Answer: A. Dataform SQLX definitions that use ref() between tables, with assertions and a Git-backed repository
Dataform tracks dependencies through ref(), runs assertions such as nonNull, and keeps the code in Git with CI/CD, which matches all three requirements. Staggered scheduled queries only guess at the order and have no built-in tests, so a slow upstream step silently feeds stale data downstream.
Question 9
A data engineer uses one BigQuery connection, us.gcs_conn, for two things: an object table over gs://acme-legal/contracts/ and a remote model that wraps a Document AI Layout Parser processor. ML.PROCESS_DOCUMENT fails with permission errors. Which TWO roles should be granted to the connection's service account? (Select TWO.)
More than one answer is right.
- Storage Admin granted to the analysts' user accounts
- Storage Object Viewer on the acme-legal bucket
- Storage Object Creator on the acme-legal bucket
- BigQuery Data Owner granted to the Document AI processor's service agent
- Document AI Viewer
Show the answer
Answers: B. Storage Object Viewer on the acme-legal bucket; E. Document AI Viewer
BigQuery reads the files and calls the processor through the connection's service account, so that account needs read access to the bucket (Storage Object Viewer) and Document AI Viewer. Storage Object Creator gives write access, which this pipeline never uses because object tables are read-only. Granting roles to users or to another service agent doesn't fix the connection's permissions.
Question 10
A retail company has an Enterprise reservation `bi-dashboards` in the US. Project `acme-looker-prod` has a QUERY assignment to it. The project also runs large hourly load jobs from Cloud Storage, and those load jobs now take slots that the dashboards need. You must keep the dashboard queries on `bi-dashboards` and give the load jobs their own capacity. What should you do?
- Create a separate reservation and assign `acme-looker-prod` to it with `--job_type=PIPELINE`, leaving the existing QUERY assignment in place
- Create a separate reservation and assign `acme-looker-prod` to it with `--job_type=BACKGROUND`, leaving the existing QUERY assignment in place
- Submit the load jobs with BATCH priority so they give way to the interactive dashboard queries
- Add a second assignment with `--reservation_id=none` for the load jobs so they fall back to on-demand capacity
Show the answer
Answer: A. Create a separate reservation and assign `acme-looker-prod` to it with `--job_type=PIPELINE`, leaving the existing QUERY assignment in place
Assignments are made per job type, and load and export jobs use the PIPELINE type, so one project can send its queries to one reservation and its loads to another. BACKGROUND is a real job type but does not cover load jobs, BATCH is a priority for query jobs only, and `none` assignments are only supported for QUERY jobs.
The full timed mock
50 questions in 120 minutes, with a pass mark of 70%. Each paper is drawn from a bank of questions written for the mock alone, and these 10 are left out of it. Full access opens it, with every level of the course.
LevelUpWith is independent of the organisation that sets this exam. These questions were written for this course; they are not taken from the exam.