Professional Data Engineer Free Practice Questions — Page 4
Question 30
You are using BigQuery with a regional dataset that includes a table with the daily sales volumes. This table is updated multiple times per day. You need to protect your sales table in case of regional failures with a recovery point objective (RPO) of less than 24 hours, while keeping costs to a minimum. What should you do?
A. Schedule a daily export of the table to a Cloud Storage dual or multi-region bucket.
B. Schedule a daily copy of the dataset to a backup region.
C. Schedule a daily BigQuery snapshot of the table.
D. Modify ETL job to load the data into both the current and another backup region.
Show Answer
Correct Answer: A
Explanation: A daily export of the table to a Cloud Storage dual- or multi-region bucket provides an off-region backup that survives a regional BigQuery outage and satisfies an RPO of less than 24 hours when scheduled daily. It is also the lowest-cost option because Cloud Storage is typically cheaper than maintaining a duplicate BigQuery copy. Dataset copies cost more, table snapshots remain in the same region and do not protect against regional failure, and dual-writing ETL provides a better RPO but increases ongoing storage and pipeline costs beyond the stated goal of minimizing cost.
Question 31
You are preparing an organization-wide dataset. You need to preprocess customer data stored in a restricted bucket in Cloud Storage. The data will be used to create consumer analyses. You need to follow data privacy requirements, including protecting certain sensitive data elements, while also retaining all of the data for potential future use cases. What should you do?
A. Use the Cloud Data Loss Prevention API and Dataflow to detect and remove sensitive fields from the data in Cloud Storage. Write the filtered data in BigQuery.
B. Use customer-managed encryption keys (CMEK) to directly encrypt the data in Cloud Storage. Use federated queries from BigQuery. Share the encryption key by following the principle of least privilege.
C. Use Dataflow and the Cloud Data Loss Prevention API to mask sensitive data. Write the processed data in BigQuery.
D. Use Dataflow and Cloud KMS to encrypt sensitive fields and write the encrypted data in BigQuery. Share the encryption key by following the principle of least privilege.
Show Answer
Correct Answer: C
Explanation: The requirement is to protect sensitive data while retaining all data for potential future use. Masking or de-identifying sensitive fields with the Cloud Data Loss Prevention (Sensitive Data Protection) API preserves the dataset while protecting PII. Dataflow is the appropriate pipeline tool to process data and write the masked output to BigQuery. Option A removes data, violating the retention requirement. Option B encrypts data at rest but does not preprocess or protect specific sensitive elements for analytics. Option D encrypts fields, but Cloud DLP is the managed service designed for detecting and masking sensitive data for analytics use cases; field-level encryption is less appropriate for consumer analysis workflows.
Question 32
Your chemical company needs to manually check documentation for customer order. You use a pull subscription in Pub/Sub so that sales agents get details from the order. You must ensure that you do not process orders twice with different sales agents and that you do not add more complexity to this workflow. What should you do?
A. Use a Deduplicate PTransform in Dataflow before sending the messages to the sales agents.
B. Create a transactional database that monitors the pending messages.
C. Use Pub/Sub exactly-once delivery in your pull subscription.
D. Create a new Pub/Sub push subscription to monitor the orders processed in the agent's system.
Show Answer
Correct Answer: C
Explanation: Exactly-once delivery for Pub/Sub pull subscriptions is designed to prevent redelivery of successfully acknowledged messages, reducing the risk of processing the same order twice without adding extra workflow components. The other options introduce additional infrastructure or solve a different problem.
Question 33
You need to look at BigQuery data from a specific table multiple times a day. The underlying table you are querying is several petabytes in size, but you want to filter your data and provide simple aggregations to downstream users. You want to run queries faster and get up-to-date insights quicker. What should you do?
A. Run a scheduled query to pull the necessary data at specific intervals dally.
B. Use a cached query to accelerate time to results.
C. Limit the query columns being pulled in the final result.
D. Create a materialized view based off of the query being run.
Show Answer
Correct Answer: D
Explanation: Materialized views precompute and incrementally maintain query results over large base tables, enabling much faster queries for filtered and aggregated data while staying up to date as the underlying table changes. This is the best fit for repeatedly querying a multi-petabyte table and serving downstream users. Scheduled queries duplicate data and are only refreshed on a schedule, cached queries are not reliable for repeated fresh insights, and limiting selected columns alone does not provide the requested performance improvement.
Question 34
You work for an airline and you need to store weather data in a BigQuery table. Weather data will be used as input to a machine learning model. The model only uses the last 30 days of weather data. You want to avoid storing unnecessary data and minimize costs. What should you do?
A. Create a BigQuery table where each record has an ingestion timestamp. Run a scheduled query to delete all the rows with an ingestion timestamp older than 30 days.
B. Create a BigQuery table partitioned by datetime value of the weather date. Set up partition expiration to 30 days.
C. Create a BigQuery table partitioned by ingestion time. Set up partition expiration to 30 days.
D. Create a BigQuery table with a datetime column for the day the weather data refers to. Run a scheduled query to delete rows with a datetime value older than 30 days.
Show Answer
Correct Answer: B
Explanation: Partition the table by the weather date (the data's event date) and configure partition expiration to 30 days. This automatically removes data older than 30 days without scheduled delete queries, minimizing storage and maintenance costs. Partitioning by ingestion time could retain or expire data based on load time rather than the actual weather date, which is not appropriate if historical data is loaded later.
Question 35
You created an analytics environment on Google Cloud so that your data scientist team can explore data without impacting the on-premises Apache Hadoop solution. The data in the on-premises Hadoop Distributed File System (HDFS) cluster is in Optimized Row Columnar (ORC) formatted files with multiple columns of Hive partitioning. The data scientist team needs to be able to explore the data in a similar way as they used the on-premises HDFS cluster with SQL on the Hive query engine. You need to choose the most cost-effective storage and processing solution. What should you do?
A. Import the ORC files to Bigtable tables for the data scientist team.
B. Import the ORC files to BigQuery tables for the data scientist team.
C. Copy the ORC files on Cloud Storage, then deploy a Dataproc cluster for the data scientist team.
D. Copy the ORC files on Cloud Storage, then create external BigQuery tables for the data scientist team.
Show Answer
Correct Answer: D
Explanation: The most cost-effective approach is to copy the ORC files to Cloud Storage and create external BigQuery tables. BigQuery can query ORC files directly in Cloud Storage, including Hive-partitioned layouts, avoiding the cost and operational overhead of loading data into BigQuery or maintaining a Dataproc cluster. This provides SQL-based exploration without impacting the on-premises Hadoop environment.
Question 36
You have a BigQuery table that ingests data directly from a Pub/Sub subscription. The ingested data is encrypted with a Google-managed encryption key. You need to meet a new organization policy that requires you to use keys from a centralized Cloud Key Management Service (Cloud KMS) project to encrypt data at rest. What should you do?
A. Use Cloud KMS encryption key with Dataflow to ingest the existing Pub/Sub subscription to the existing BigQuery table.
B. Create a new BigQuery table by using customer-managed encryption keys (CMEK), and migrate the data from the old BigQuery table.
C. Create a new Pub/Sub topic with CMEK and use the existing BigQuery table by using Google-managed encryption key.
D. Create a new BigQuery table and Pub/Sub topic by using customer-managed encryption keys (CMEK), and migrate the data from the old BigQuery table.
Show Answer
Correct Answer: B
Explanation: BigQuery table encryption cannot be changed in place from Google-managed keys to CMEK. To meet the requirement for BigQuery data at rest, create a new BigQuery table configured with a customer-managed encryption key from Cloud KMS and migrate the existing data. The question does not state that the Pub/Sub topic itself must also be migrated to CMEK, so replacing the topic is unnecessary for the stated requirement.
Question 37
You are creating the CI/CD cycle for the code of the directed acyclic graphs (DAGs) running in Cloud Composer. Your team has two Cloud Composer instances: one instance for development and another instance for production. Your team is using a Git repository to maintain and develop the code of the DAGs. You want to deploy the DAGs automatically to Cloud Composer when a certain tag is pushed to the Git repository. What should you do?
A. 1. Use Cloud Build to copy the code of the DAG to the Cloud Storage bucket of the development instance for DAG testing. 2. If the tests pass, use Cloud Build to copy the code to the bucket of the production instance.
B. 1. Use Cloud Build to build a container with the code of the DAG and the KubernetesPodOperator to deploy the code to the Google Kubernetes Engine (GKE) cluster of the development instance for testing. 2. If the tests pass, use the KubernetesPodOperator to deploy the container to the GKE cluster of the production instance.
C. 1. Use Cloud Build to build a container and the KubernetesPodOperator to deploy the code of the DAG to the Google Kubernetes Engine (GKE) cluster of the development instance for testing. 2. If the tests pass, copy the code to the Cloud Storage bucket of the production instance.
D. 1. Use Cloud Build to copy the code of the DAG to the Cloud Storage bucket of the development instance for DAG testing. 2. If the tests pass, use Cloud Build to build a container with the code of the DAG and the KubernetesPodOperator to deploy the container to the Google Kubernetes Engine (GKE) cluster of the production instance.
Show Answer
Correct Answer: A
Explanation: Cloud Composer deploys DAGs by synchronizing files placed in the environment's Cloud Storage bucket (the dags/ folder). A standard CI/CD pipeline uses Cloud Build triggered by Git tags or commits to copy DAG files into the development Composer bucket, run validation/tests, and upon success promote the same DAGs to the production Composer bucket. Building containers or deploying directly to the underlying GKE cluster is unnecessary for DAG deployment because Composer manages the Airflow infrastructure.
Question 38
You have 100 GB of data stored in a BigQuery table. This data is outdated and will only be accessed one or two times a year for analytics with SQL. For backup purposes, you want to store this data to be immutable for 3 years. You want to minimize storage costs. What should you do?
A. 1. Create a BigQuery table clone. 2. Query the clone when you need to perform analytics.
B. 1. Create a BigQuery table snapshot. 2. Restore the snapshot when you need to perform analytics.
C. 1. Perform a BigQuery export to a Cloud Storage bucket with archive storage class. 2. Enable versioning on the bucket. 3. Create a BigQuery external table on the exported files.
D. 1. Perform a BigQuery export to a Cloud Storage bucket with archive storage class. 2. Set a locked retention policy on the bucket. 3. Create a BigQuery external table on the exported files.
Show Answer
Correct Answer: D
Explanation: Exporting the data to Cloud Storage Archive minimizes long-term storage cost. A locked retention policy provides WORM (write once, read many) immutability for the required 3-year period. You can query the data when needed by creating a BigQuery external table over the exported files. Table clones and snapshots remain BigQuery storage constructs and are not the lowest-cost long-term immutable backup. Bucket versioning does not enforce immutability or retention.
Question 39
You have created an external table for Apache Hive partitioned data that resides in a Cloud Storage bucket, which contains a large number of files. You notice that queries against this table are slow. You want to improve the performance of these queries. What should you do?
A. Change the storage class of the Hive partitioned data objects from Coldline to Standard.
B. Create an individual external table for each Hive partition by using a common table name prefix. Use wildcard table queries to reference the partitioned data.
C. Upgrade the external table to a BigLake table. Enable metadata caching for the table.
D. Migrate the Hive partitioned data objects to a multi-region Cloud Storage bucket.
Show Answer
Correct Answer: C
Explanation: Upgrading the external table to a BigLake table and enabling metadata caching improves query performance for Hive-partitioned data with many files by caching file and partition metadata, reducing metadata lookup overhead. Changing Cloud Storage class or bucket location does not address metadata scan latency, and creating separate external tables with wildcard queries is not the recommended optimization.
$19
Get all 332 questions with detailed answers and explanations
Instant download HTML + PDF delivered the moment payment clears.
Secure Stripe checkout we never see or store your card details.
7-day refund if files are defective see our refund policy.