All Google Cloud exams
Free Professional Data Engineer practice test: 30 questions with answers
30 original questions for Professional Data Engineer, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.
- Free questions
- 30
- Full bank
- 112 questions
- Real exam
- 120 min
Professional Data Engineer exam guide: topics, cost and format
All 30 Professional Data Engineer questions with answers
The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.
Design data processing systems (6 questions)
Question 1
A bank must process card transactions in near real time. Its requirement is that a duplicate publish from the upstream system never creates two ledger entries. Dataflow will write to BigQuery. Which approach best meets this?
- AWrite every event to Cloud Storage first and run a nightly batch job that overwrites the ledger table
- BRely on Pub/Sub's at-least-once delivery and deduplicate with a unique transaction ID in the Dataflow pipeline before writing
- CSet the Dataflow sink to streaming inserts with insertId derived from the Pub/Sub message ID and assume that eliminates all duplicates forever
- DUse Pub/Sub exactly-once delivery alone and skip any deduplication step in the pipeline
Show answer and explanationHide answer
Correct answer: BPub/Sub delivers at least once, so the pipeline must tolerate repeats, and deduplicating on a business key such as the transaction ID is the reliable pattern. Exactly-once delivery is a per-subscription option with conditions and does not cover every upstream retry. BigQuery insertId deduplication is best effort within a short window, so it cannot be relied on as a permanent guarantee.
Question 2
A healthcare company stores personal data in BigQuery. Analysts may query the tables, but only a small compliance group may see patient identifiers, and the company must be able to revoke a field's visibility without rewriting tables. Which design meets this with the least operational effort?
- AColumn-level security with policy tags from Data Catalog, bound to the identifier columns
- BAuthorized views that exclude identifier columns, plus a daily export of the full table to a restricted bucket
- CSeparate copies of each table with identifiers removed, granted to analysts by project-level IAM
- DCloud KMS encryption of the identifier columns with the key shared only with the compliance group
Show answer and explanationHide answer
Correct answer: APolicy tags attach fine-grained access control to specific columns, so revoking access is a policy change rather than a data copy. Maintaining redacted copies duplicates data and drifts over time. Encryption does not stop users who can read the column from reading the ciphertext through BigQuery, and KMS keys are not a column access control on their own.
Question 3
A global company needs a relational database for order processing with strong consistency across regions and automatic failover, and it expects a few thousand transactions per second. Which service fits best?
- ACloud SQL for MySQL with a cross-region read replica
- BBigtable with replication enabled across two clusters
- CCloud Spanner in a multi-region configuration
- DBigQuery with materialized views refreshed hourly
Show answer and explanationHide answer
Correct answer: CSpanner provides relational semantics, strong consistency and synchronous replication across regions with automatic failover. A cross-region replica in Cloud SQL is asynchronous and requires manual promotion. Bigtable has no SQL transactions across rows, and BigQuery is not an OLTP store.
Question 4
A company wants to move 2 PB of historical Hadoop data to Google Cloud. The Hadoop jobs use Hive and Spark and the team wants minimal code changes at first. Which approach should the data engineer recommend for the first phase?
- ALift and shift the workloads to Dataproc and move the data to Cloud Storage, keeping the existing Spark and Hive jobs
- BMove the data to Bigtable so Hive queries can run against it unchanged
- CRewrite every job as a Dataflow pipeline before moving any data
- DKeep the data on premises and expose it to BigQuery only through a streaming API
Show answer and explanationHide answer
Correct answer: ADataproc runs Hadoop and Spark with few code changes, and Cloud Storage replaces HDFS as the data store, which fits a first phase. Rewriting everything before moving data delays value. Bigtable does not run Hive SQL, and a streaming API is a poor route for 2 PB of historical data.
Question 5
A company runs a Dataflow pipeline in one region and the source Pub/Sub topic and the downstream BigQuery dataset are in another region. Data transfer costs and latency are rising. What is the best correction?
- AAdd more Dataflow workers in the original region to shorten processing time
- BCo-locate the Dataflow workers, Pub/Sub topic and BigQuery dataset in the same region
- CCompress every message before publishing so that less data crosses the region boundary
- DReplicate the Pub/Sub topic to every region the company uses
Show answer and explanationHide answer
Correct answer: BKeeping the pipeline components in the same region removes the cross-region egress charges and most of the added latency. More workers do not reduce network distance, and compression helps only partly. Replicating the topic adds copies without fixing the placement of the consumer and sink.
Question 6
A solution architect proposes Pub/Sub, Dataflow and BigQuery for an event pipeline. The company asks which design choice most reduces the risk of losing events during a Dataflow worker failure. Which answer is correct?
- AWriting events to local disk on each worker before processing so that a restarted worker can read them
- BDataflow's checkpointing and the Pub/Sub acknowledgment only after the pipeline commits results lets the job resume without losing acknowledged events
- CSetting the Pub/Sub ack deadline to the maximum so that messages are never redelivered
- DRunning a single worker so that failures are easy to notice and repair
Show answer and explanationHide answer
Correct answer: BDataflow tracks progress and Pub/Sub messages are acknowledged only after the pipeline has taken responsibility for them, so a failed worker's work is retried rather than lost. Local disk on a worker is lost with the worker. A maximum ack deadline delays redelivery rather than preventing loss, and one worker is a throughput risk, not a loss control.
Store the data (6 questions)
Question 7
A smart-meter platform writes several hundred thousand readings per second. Engineers need single-digit millisecond lookups of the latest readings for one meter ID and range scans over time for that meter. Which storage choice and key design best fit?
- ACloud Spanner with a primary key that starts with a monotonically increasing timestamp
- BBigQuery streaming inserts into a table partitioned by ingestion time and clustered by meter ID
- CCloud Bigtable with a row key that starts with a reversed meter ID followed by a timestamp
- DCloud SQL for PostgreSQL with read replicas and a B-tree index on meter ID and timestamp
Show answer and explanationHide answer
Correct answer: CBigtable handles very high write throughput with low-latency key-based reads and range scans, and a reversed or hashed prefix spreads writes so they do not hotspot. BigQuery is an analytical store and is not built for millisecond point reads. A timestamp-first key in Spanner would concentrate writes on one split.
Question 8
A BigQuery table holds five years of order events. Most queries filter on order_date and then on customer_id. Storage cost must stay reasonable and the team wants to avoid scanning old partitions. Which table design should the data engineer use?
- APartition by order_date and cluster by customer_id
- BPartition by customer_id and cluster by order_date
- CCreate one table per year with date-suffixed names and cluster each table by customer_id
- DPartition by ingestion time and cluster by order_date
Show answer and explanationHide answer
Correct answer: APartitioning on the date column the queries filter on prunes old partitions, and clustering by customer_id sorts blocks within each partition for the second filter. Partitioning by ingestion time does not match the business date, so filters on order_date still scan extra data. Date-suffixed sharded tables are the legacy pattern that partitioned tables replace.
Question 9
A team stores large Parquet files in Cloud Storage for a data lake. Users need to query them with BigQuery and also keep fine-grained access rules consistent with the warehouse. Which approach best meets this requirement?
- ABigLake tables over the Cloud Storage bucket, governed with BigQuery access controls
- BExternal tables over the bucket with bucket-level IAM only and no connection resource
- CCopy the Parquet files into a new bucket per team and grant each team bucket access
- DLoad every file into a native BigQuery table and delete the Cloud Storage copies
Show answer and explanationHide answer
Correct answer: ABigLake tables expose files in Cloud Storage to BigQuery with a connection and support fine-grained controls such as row and column security, so governance stays consistent with the warehouse. Plain external tables without a connection cannot apply those controls the same way. Per-team buckets multiply copies, and deleting the lake loses the open-format storage the team wants to keep.
Question 10
A BigQuery dataset must keep data in the EU only, including backups and query results written to tables. The company also wants to use a customer-managed encryption key. Which configuration meets these requirements?
- ACreate the dataset in the EU multi-region location and set a Cloud KMS key as the default encryption key for the dataset
- BCreate the dataset in the US multi-region and restrict queries to users located in Europe through IAM conditions
- CCreate the dataset in us-central1 and enable global replication to europe-west1 for backups
- DStore the data in a Cloud Storage bucket in Europe and query it with an external table that uses the default Google-managed key
Show answer and explanationHide answer
Correct answer: AA dataset location fixes where the data resides, and a dataset default KMS key covers new tables and gives customer-managed encryption. Replicating from us-central1 moves data out of the EU. IAM conditions control who queries, not where data sits, and external tables do not use the customer's key by default.
Question 11
A team designs a Cloud Bigtable table for user activity events. Reads are mostly by user ID and time range, and the team has seen hot spots. Which TWO design choices help? (Choose two.)
- AUse a row key that begins with a hashed or reversed user ID, followed by a reversed timestamp or a timestamp
- BUse sequential numeric IDs as the row key prefix so that rows are stored in insertion order
- CUse one column family per user so that each user's data is isolated in its own family
- DKeep the number of column families small and put related columns in the same family
- EUse a single row for every user and append all events as new cells in that row without limit
Show answer and explanationHide answer
Correct answer: A, DA prefix that spreads writes across the key space avoids hotspots, and a timestamp suffix supports range scans per user. Bigtable column families are a schema-level concept, so creating one per user is not workable, and keeping them few is the recommended practice. Sequential prefixes create hotspots, and unbounded cells in one row degrade performance.
Question 12
A financial application writes time-ordered transactions to BigQuery. Analysts usually query the last 30 days, and a regulator requires seven years of retention. Which table configuration meets both needs?
- APartition the table by transaction date with a partition expiration of seven years
- BPartition the table by transaction date with a partition expiration of 30 days
- CKeep one unpartitioned table and delete rows older than 30 days each month with DML statements
- DStore transactions in Cloud SQL and archive monthly dumps to a Coldline bucket for retention
Show answer and explanationHide answer
Correct answer: ADate partitioning keeps the 30-day queries cheap, and a seven-year partition expiration meets retention while BigQuery's long-term storage pricing applies to partitions not modified for 90 days. A 30-day expiration would delete data the regulator requires. Manual DML deletes are costly and error-prone, and the Cloud SQL archive adds a second system to manage.
Maintain and automate data workloads (6 questions)
Question 13
A Dataflow streaming job that reads from Pub/Sub and writes to BigQuery must be updated to add a new transform without losing its place in the stream. Which action should the engineer take?
- ACreate a second job with the same name and let both write to the table until the old one is deleted
- BUpdate the running job in place, which preserves its pipeline state and keeps the same job identity
- CDrain the job, which stops reading and flushes in-flight work, then start the new version from the Pub/Sub snapshot taken earlier
- DCancel the job, which discards in-flight elements, and start a new job from the latest offset
Show answer and explanationHide answer
Correct answer: BStreaming Dataflow jobs can be updated in place when the change is compatible, which preserves the job and its state. Cancelling loses in-flight work, and draining is for stopping a job cleanly rather than preserving the same job through a compatible update. Running two jobs writing to one table risks duplicates and inconsistent output.
Question 14
A Dataproc Spark job runs once a day against ephemeral clusters. Cluster creation costs are high because each run starts from scratch. The job depends on a Cloud Storage bucket and must finish before a BigQuery load step runs. What should the data engineer use to reduce cost while keeping the dependency?
- ACloud Scheduler triggers that start the Spark job and the BigQuery load at the same time, without ordering
- BA permanent cluster with autoscaling disabled and all jobs submitted manually from an engineer's console
- CA Dataproc Workflow Template that creates a managed ephemeral cluster, runs the job, and deletes the cluster as one unit
- DA Cloud Function that runs the Spark job inside the function's own memory
Show answer and explanationHide answer
Correct answer: CA Dataproc Workflow Template defines the steps, their order and an ephemeral managed cluster that is removed after the job, which cuts idle cost and keeps the dependency. A permanent cluster wastes money between runs. Scheduling both steps at the same time breaks the required order, and Cloud Functions cannot host a Spark job.
Question 15
A data platform team wants alerts when a streaming Dataflow pipeline's system lag exceeds five minutes, and they want the alert to reach the on-call channel. Which Google Cloud services should they combine?
- ACloud Logging export of all job logs to a BigQuery table that an analyst checks each morning
- BCloud Audit Logs with a sink to Cloud Storage and manual review of access events
- CA Cloud Scheduler job that runs gcloud dataflow jobs describe every hour and writes the result to a text file
- DCloud Monitoring alerting policy on the Dataflow system lag metric with a notification channel
Show answer and explanationHide answer
Correct answer: DCloud Monitoring alerting policies evaluate Dataflow metrics such as system lag and notify channels in real time. A morning review of logs is too slow for a lag alert. Polling with a scheduler writes a file that nobody watches, and Audit Logs record access events rather than pipeline health.
Question 16
A nightly BigQuery transformation job occasionally produces wrong totals after an upstream schema change renamed a column. The team wants the pipeline to fail fast and notify the owner before publishing bad data. Which mechanism is most appropriate?
- AManual spot checks by an analyst each morning before the dashboard is refreshed
- BScheduled query with no validation step that overwrites the production table each night
- CA Looker dashboard that shows an alert icon when totals change by more than 20 percent
- DDataform assertions that check row counts and column values after each transformation, with the workflow stopping on failure
Show answer and explanationHide answer
Correct answer: DDataform assertions run as part of the workflow and can stop downstream steps when a check fails, which prevents publishing bad totals. A scheduled query without checks overwrites production with whatever it produces. A dashboard icon and morning spot checks both react after the bad data is already visible.
Question 17
A data engineering team wants to reduce the cost of a BigQuery environment where analysts run many large, unfiltered queries. Which THREE actions are most effective? (Choose three.)
- APartition and cluster the large tables so queries scan fewer bytes
- BSet custom cost controls on projects or users with a maximum bytes-billed limit for queries
- CSwitch to capacity-based pricing with autoscaling slots and reserve baseline capacity for the critical workload
- DReplace SELECT * in dashboard queries with explicit column lists
- EExport all tables to Cloud Storage each night and query only the exports
Show answer and explanationHide answer
Correct answer: A, B, DPartitioning and clustering reduce bytes scanned, column lists avoid scanning unused columns, and bytes-billed limits stop runaway queries from costing more than expected. Capacity pricing changes the billing model and is not a usage-reducing action on its own in this scenario, and exporting nightly does not reduce the cost of the analysis queries.
Question 18
A team runs a Dataflow batch job nightly. It has started failing with worker out-of-memory errors on days when one customer ID receives far more records than the others. Which change most directly addresses the cause?
- ATurn off autoscaling so that each worker keeps a fixed heap size for the whole run, regardless of input volume
- BAdd a combiner or pre-aggregation step and split the hot key into sub-keys before the grouping transform
- CDisable dead-letter handling so that failing records are retried until the job succeeds without manual intervention
- DIncrease the number of Dataflow workers while leaving the pipeline unchanged, since more workers hold more keys
Show answer and explanationHide answer
Correct answer: BA skewed key overloads the single worker that owns it, so pre-aggregating with a combiner and splitting the hot key into sub-keys spreads the work. Adding workers does not divide one key across machines. Turning off autoscaling does not change the skew, and retrying indefinitely wastes resources while hiding the cause.
Ingest and process data (6 questions)
Question 19
A retailer streams clickstream events to Pub/Sub from mobile apps. Events from users on poor connections can arrive up to 10 minutes after they happened. The team needs hourly counts of sessions based on when the user acted, not when the event reached the pipeline. Which Dataflow design fits this requirement?
- AFixed one-hour windows on processing time with zero allowed lateness
- BFixed one-hour event-time windows with a watermark-based trigger and 15 minutes of allowed lateness
- CSession windows built from Pub/Sub publish timestamps with no triggers
- DA global window with a count-based trigger every 1,000 elements
Show answer and explanationHide answer
Correct answer: BEvent-time windows assign each event to the hour the user acted, and allowed lateness keeps late events that arrive within the 10-minute delay. Processing-time windows would put late events into the wrong hour, and publish time is not the user action time. Session windows answer a different question from hourly counts.
Question 20
A company receives nightly files of about 40 TB from an on-premises NFS server into Cloud Storage over a 1 Gbps link that is shared with production traffic. The files must arrive within a fixed transfer window and be validated. Which approach is most appropriate?
- AEmail encrypted disks by courier each night and import them with a batch load job
- BRun gsutil cp in a loop on a single laptop connected over VPN
- CMount the NFS share with a FUSE client and let applications write directly to the bucket during business hours
- DUse Storage Transfer Service with an agent pool on premises, scheduling transfers during the off-peak window
Show answer and explanationHide answer
Correct answer: DStorage Transfer Service runs managed, resumable transfers from POSIX sources through an on-premises agent and can be scheduled inside the off-peak window to protect the shared link. A single laptop over VPN is a bottleneck with no resume logic. Writing through a FUSE mount during business hours competes with production traffic and gives no validation.
Question 21
A logistics company streams GPS pings to Pub/Sub. Each ping must be enriched with a vehicle's current route from a Cloud SQL table that changes a few times a day. The pipeline must keep latency under a few seconds. Which pattern is best?
- APub/Sub topic with a push subscription that calls a Cloud Run service which writes to Cloud SQL for every ping
- BDataflow streaming job that loads the route table as a side input refreshed periodically, then joins each ping in memory
- CWriting all pings to BigQuery and joining with the route table in a nightly batch query
- DDataflow job that issues a new unbatched Cloud SQL query for every ping with no connection pooling
Show answer and explanationHide answer
Correct answer: BA periodically refreshed side input lets the pipeline join small, slowly changing reference data in memory with low latency. Per-ping queries without pooling overload the database under streaming volume. A nightly batch join fails the latency requirement, and per-message writes through Cloud Run create connection pressure on Cloud SQL.
Question 22
A pipeline loads daily CSV files into BigQuery. Some files occasionally contain rows with a wrong number of columns. The team wants valid rows loaded and bad rows captured for review without failing the whole job. Which load setting should they use?
- AUse a federated query against the file bucket every time someone runs a report
- BSet the schema to STRING for every column so that no row can ever fail
- CSet max_bad_records to a reasonable number and write rejects to a separate table through a dead-letter step
- DDisable schema auto-detection and fail the entire load on the first malformed row
Show answer and explanationHide answer
Correct answer: CLoad jobs tolerate a configured number of bad records, and a dead-letter step keeps rejected rows for review, which satisfies both goals. Forcing every column to STRING lets malformed rows through as bad data. Federated queries do not solve ingestion, and failing on the first bad row is the opposite of the requirement.
Question 23
A company must capture changes from an operational MySQL database and replicate them into BigQuery with low delay, without running full table exports every hour. Which Google Cloud service fits best?
- ACloud Composer DAG that runs SELECT * on each table every hour
- BDataproc job that reads the MySQL binary log directly and writes Avro files to HDFS
- CStorage Transfer Service scheduled every hour against the database server
- DDatastream with a BigQuery destination for change data capture
Show answer and explanationHide answer
Correct answer: DDatastream reads change streams from supported databases and writes them to BigQuery or Cloud Storage with low latency. Storage Transfer Service moves files, not database changes. Hourly full selects are the expensive pattern the team wants to avoid, and a custom binary-log reader adds maintenance work that a managed service removes.
Question 24
A streaming Dataflow pipeline reads from Pub/Sub and writes to BigQuery. The team sees duplicate rows after a worker restart and some events arrive out of order. Which TWO actions address these problems? (Choose two.)
- AUse event timestamps for windowing and set an allowed lateness that matches the expected delay
- BSwitch the pipeline to batch mode so that ordering is guaranteed
- CInclude a stable unique event identifier and deduplicate on it inside the pipeline or in a downstream merge
- DIncrease the Pub/Sub acknowledgment deadline to several hours
- EAdd more worker threads so that events are processed in arrival order
Show answer and explanationHide answer
Correct answer: A, CEvent-time windowing with appropriate allowed lateness handles out-of-order arrival correctly, and deduplication on a stable event ID removes repeated deliveries. Batch mode is a different workload, extending the ack deadline does not address duplicates, and more threads do not restore order.
Prepare and use data for analysis (6 questions)
Question 25
An analytics team wants analysts to reuse a set of transformations on raw BigQuery tables, with version control, dependency ordering and tests, all managed from a Git repository. Which Google Cloud capability fits this need?
- ADatastream
- BCloud Data Fusion
- CLooker Studio scheduled extracts
- DDataform
Show answer and explanationHide answer
Correct answer: DDataform compiles SQL transformation workflows for BigQuery with dependency graphs, assertions and Git integration. Cloud Data Fusion is an ETL integration service aimed at pipeline building rather than SQL transformation projects. Looker Studio is a visualization tool, and Datastream replicates change data from databases.
Question 26
A data science team wants to train a logistic regression model on a BigQuery table without exporting data or managing infrastructure. Which approach fits this requirement?
- AVertex AI custom training job on a GPU node that pulls the table to Cloud Storage first
- BDataproc cluster running a Spark MLlib pipeline on a copy of the table
- CBigQuery ML CREATE MODEL statement with the LOGISTIC_REG model type
- DCloud Functions that call a pre-trained image classification API
Show answer and explanationHide answer
Correct answer: CBigQuery ML trains models with SQL inside BigQuery, so the data never leaves the warehouse. Exporting to Cloud Storage for a custom training job adds steps and infrastructure. A Spark cluster also needs data movement and cluster management, and an image API does not fit tabular data.
Question 27
An analyst needs a dashboard in Looker that shows sales by region, refreshed every hour from BigQuery, and must not show individual customer names to users outside the sales group. Which combination best matches these needs?
- AA nightly CSV dump to Cloud Storage that users download from a bucket with public read access
- BLooker Studio report shared as public link with the customer names column hidden in the chart only
- CLooker model with row-level access controls by group, plus an aggregated BigQuery view that omits customer names for other users
- DDirect BigQuery export to a spreadsheet that is shared with the whole company
Show answer and explanationHide answer
Correct answer: CLooker's access controls and governed models can restrict data by group, and an aggregated view keeps names out of the path entirely. Hiding a chart column in Looker Studio does not protect the underlying data, which a viewer can still reach through the report. Public exports and shared spreadsheets expose the full data.
Question 28
A retailer's BigQuery queries repeatedly aggregate the same large fact table by day and product for dashboards. The data changes every few minutes and dashboard latency must stay low without rewriting every query. What should the team use?
- AExporting the table to Cloud Storage as CSV and querying the CSV files with an external table
- BA materialized view over the aggregation, which BigQuery keeps incrementally up to date
- CA scheduled query that drops and recreates a full copy of the fact table every night
- DA logical view with the aggregation, plus a cache warming script that runs queries every five minutes
Show answer and explanationHide answer
Correct answer: BA materialized view stores the precomputed aggregation and BigQuery applies incremental refresh, and the optimizer can rewrite matching queries to use it. A logical view still computes the aggregation each time. Nightly full rebuilds are stale for a few-minute change rate, and CSV exports make queries slower.
Question 29
A company uses BigQuery for reporting and wants data scientists to use the same governed datasets in Vertex AI. Which THREE capabilities or practices support this without copying data unnecessarily? (Choose three.)
- ABigQuery ML for training models directly on governed tables
- BVertex AI Workbench notebooks that query BigQuery through the BigQuery Storage Read API or the client libraries
- CDataform or scheduled SQL to publish curated feature tables that multiple teams read
- DExport every table to a local laptop for offline model experiments
- EStore the models as CSV files in a public bucket so anyone can download them
Show answer and explanationHide answer
Correct answer: A, B, CBigQuery ML trains models inside the warehouse, notebooks can read BigQuery directly through supported APIs, and curated tables published by Dataform or scheduled SQL give teams one governed source. Exporting to laptops and public buckets breaks governance and copies sensitive data.
Question 30
A BigQuery query that joins two large tables costs far more than expected. The join key is a STRING column in one table and an INT64 column in the other, and the join condition wraps one side in a CAST. What is the most effective fix?
- AReplace the join with a UNION ALL of the two tables followed by a GROUP BY on the key column
- BUse the same data type for the join key in both tables and drop the CAST
- CAdd a LIMIT clause to each table in a subquery before the join is evaluated by the query engine
- DMove the query into a Python notebook that loads both tables into memory before the join runs
Show answer and explanationHide answer
Correct answer: BMatching data types on both sides lets the join use the native key without converting every row and lets the optimizer plan it efficiently. UNION ALL does not perform a join at all, and a LIMIT on each side changes the result set. Loading into a notebook moves the work off the warehouse and leaves the mismatch in place.