Docsity

databricks-data-engineer-professional, Egzaminy z Basics of Data Warehousing

Toggle sidebar
bg1
Certified Data Engineer Professional Actual Exam Questions
Question #1Topic 1
An upstream system has been configured to pass the date for a given batch of data to the
Databricks Jobs API as a parameter. The notebook to be scheduled will use this parameter to
load data with the following code: df =
spark.read.format("parquet").load(f"/mnt/source/(date)")
Which code block should be used to create the date Python variable used in the above code
block?
●A.,date = spark.conf.get("date")
●B.,input_dict = input()
date= input_dict["date"]
●C.,import sys
date = sys.argv[1]
●D.,date = dbutils.notebooks.getParam("date")
●E.,dbutils.widgets.text("date", "null")
date = dbutils.widgets.get("date")
Question #2Topic 1
The Databricks workspace administrator has configured interactive clusters for each of the
data engineering groups. To control costs, clusters are set to terminate after 30 minutes of
inactivity. Each user should be able to execute workloads against their assigned clusters at any
time of the day.
Assuming users have been added to a workspace but not granted any permissions, which of
the following describes the minimal permissions a user would need to start and attach to an
already configured cluster.
●A.,"Can Manage" privileges on the required cluster
●B.,Workspace Admin privileges, cluster creation allowed, "Can Attach To" privileges on
the required cluster
●C.,Cluster creation allowed, "Can Attach To" privileges on the required cluster
●D.,"Can Restart" privileges on the required cluster
●E.,Cluster creation allowed, "Can Restart" privileges on the required cluster
Question #3Topic 1
When scheduling Structured Streaming jobs for production, which configuration automatically
recovers from query failures and keeps costs low?
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62

Podgląd częściowego tekstu

Pobierz databricks-data-engineer-professional i więcej Egzaminy w PDF z Basics of Data Warehousing tylko na Docsity!

Certified Data Engineer Professional Actual Exam Questions

Question #1 Topic 1 An upstream system has been configured to pass the date for a given batch of data to the Databricks Jobs API as a parameter. The notebook to be scheduled will use this parameter to load data with the following code: df = spark.read.format("parquet").load(f"/mnt/source/(date)") Which code block should be used to create the date Python variable used in the above code block? ● A. date = spark.conf.get("date") ● B. input_dict = input() date= input_dict["date"] ● C. import sys date = sys.argv[1] ● D. date = dbutils.notebooks.getParam("date") ● E. dbutils.widgets.text("date", "null") date = dbutils.widgets.get("date") Question #2 Topic 1 The Databricks workspace administrator has configured interactive clusters for each of the data engineering groups. To control costs, clusters are set to terminate after 30 minutes of inactivity. Each user should be able to execute workloads against their assigned clusters at any time of the day. Assuming users have been added to a workspace but not granted any permissions, which of the following describes the minimal permissions a user would need to start and attach to an already configured cluster. ● A. "Can Manage" privileges on the required cluster ● B. Workspace Admin privileges, cluster creation allowed, "Can Attach To" privileges on the required cluster ● C. Cluster creation allowed, "Can Attach To" privileges on the required cluster ● D. "Can Restart" privileges on the required cluster ● E. Cluster creation allowed, "Can Restart" privileges on the required cluster Question #3 Topic 1 When scheduling Structured Streaming jobs for production, which configuration automatically recovers from query failures and keeps costs low?

● A. Cluster: New Job Cluster; Retries: Unlimited; Maximum Concurrent Runs: Unlimited ● B. Cluster: New Job Cluster; Retries: None; Maximum Concurrent Runs: 1 ● C. Cluster: Existing All-Purpose Cluster; Retries: Unlimited; Maximum Concurrent Runs: 1 ● D. Cluster: New Job Cluster; Retries: Unlimited; Maximum Concurrent Runs: 1 ● E. Cluster: Existing All-Purpose Cluster; Retries: None; Maximum Concurrent Runs: 1 Question #4 Topic 1 The data engineering team has configured a Databricks SQL query and alert to monitor the values in a Delta Lake table. The recent_sensor_recordings table contains an identifying sensor_id alongside the timestamp and temperature for the most recent 5 minutes of recordings. The below query is used to create the alert: The query is set to refresh each minute and always completes in less than 10 seconds. The alert is set to trigger when mean (temperature) > 120. Notifications are triggered to be sent at most every 1 minute. If this alert raises notifications for 3 consecutive minutes and then stops, which statement must be true? ● A. The total average temperature across all sensors exceeded 120 on three consecutive executions of the query ● B. The recent_sensor_recordings table was unresponsive for three consecutive runs of the query ● C. The source query failed to update properly for three consecutive minutes and then restarted ● D. The maximum temperature recording for at least one sensor exceeded 120 on three consecutive executions of the query ● E. The average temperature recordings for at least one sensor exceeded 120 on three consecutive executions of the query Question #5 Topic 1

● D. The connection to the external table will succeed; the string value of password will be printed in plain text. ● E. The connection to the external table will succeed; the string "REDACTED" will be printed. Question #7 Topic 1 The data science team has created and logged a production model using MLflow. The following code correctly imports and applies the production model to output the predictions as a new DataFrame named preds with the schema "customer_id LONG, predictions DOUBLE, date DATE". The data science team would like predictions saved to a Delta Lake table with the ability to compare all predictions across time. Churn predictions will be made at most once per day. Which code block accomplishes this task while minimizing potential compute costs? ● A. preds.write.mode("append").saveAsTable("churn_preds") ● B. preds.write.format("delta").save("/preds/churn_preds") ● C. ● D.

● E.

Question #8 Topic 1 An upstream source writes Parquet data as hourly batches to directories named with the current date. A nightly batch job runs the following code to ingest all data from the previous day as indicated by the date variable: Assume that the fields customer_id and order_id serve as a composite key to uniquely identify each order. If the upstream system is known to occasionally produce duplicate entries for a single order hours apart, which statement is correct? ● A. Each write to the orders table will only contain unique records, and only those records without duplicates in the target table will be written. ● B. Each write to the orders table will only contain unique records, but newly written records may have duplicates already present in the target table. ● C. Each write to the orders table will only contain unique records; if existing records with the same key are present in the target table, these records will be overwritten. ● D. Each write to the orders table will only contain unique records; if existing records with the same key are present in the target table, the operation will fail. ● E. Each write to the orders table will run deduplication over the union of new and existing records, ensuring no duplicate records are present. Question # A junior member of the data engineering team is exploring the language interoperability of Databricks notebooks. The intended outcome of the below code is to register a view of all sales that occurred in countries on the continent of Africa that appear in the geo_lookup table. Before executing the code, running SHOW TABLES on the current database indicates the

using default table settings. The team has decided to process all deletions from the previous week as a batch job at 1am each Sunday. The total duration of this job is less than one hour. Every Monday at 3am, a batch job executes a series of VACUUM commands on all Delta Lake tables throughout the organization. The compliance officer has recently learned about Delta Lake's time travel functionality. They are concerned that this might allow continued access to deleted data. Assuming all delete logic is correctly implemented, which statement correctly addresses this concern? ● A. Because the VACUUM command permanently deletes all files containing deleted records, deleted records may be accessible with time travel for around 24 hours. ● B. Because the default data retention threshold is 24 hours, data files containing deleted records will be retained until the VACUUM job is run the following day. ● C. Because Delta Lake time travel provides full access to the entire history of a table, deleted records can always be recreated by users with full admin privileges. ● D. Because Delta Lake's delete statements have ACID guarantees, deleted records will be permanently purged from all storage systems as soon as a delete job completes. ● E. Because the default data retention threshold is 7 days, data files containing deleted records will be retained until the VACUUM job is run 8 days later. Topic 1 A junior data engineer has configured a workload that posts the following JSON to the Databricks REST API endpoint 2.0/jobs/create. Assuming that all configurations and referenced resources are available, which statement describes the result of executing this workload three times? ● A. Three new jobs named "Ingest new data" will be defined in the workspace, and they will each run once daily. ● B. The logic defined in the referenced notebook will be executed three times on new clusters with the configurations of the provided cluster ID. ● C. Three new jobs named "Ingest new data" will be defined in the workspace, but no jobs will be executed.

● D. One new job named "Ingest new data" will be defined in the workspace, but it will not be executed. ● E. The logic defined in the referenced notebook will be executed three times on the referenced existing all purpose cluster. Question #13 Topic 1 An upstream system is emitting change data capture (CDC) logs that are being written to a cloud object storage directory. Each record in the log indicates the change type (insert, update, or delete) and the values for each field after the change. The source table has a primary key identified by the field pk_id. For auditing purposes, the data governance team wishes to maintain a full record of all values that have ever been valid in the source system. For analytical purposes, only the most recent value for each record needs to be recorded. The Databricks job to ingest these records occurs once per hour, but each individual record may have changed multiple times over the course of an hour. Which solution meets these requirements? ● A. Create a separate history table for each pk_id resolve the current state of the table by running a union all filtering the history tables for the most recent state. ● B. Use MERGE INTO to insert, update, or delete the most recent entry for each pk_id into a bronze table, then propagate all changes throughout the system. ● C. Iterate through an ordered set of changes to the table, applying each in turn; rely on Delta Lake's versioning ability to create an audit log. ● D. Use Delta Lake's change data feed to automatically process CDC data from an external system, propagating all changes to all dependent tables in the Lakehouse. ● E. Ingest all log information into a bronze table; use MERGE INTO to insert, update, or delete the most recent entry for each pk_id into a silver table to recreate the current table state Question #14 Topic 1 An hourly batch job is configured to ingest data files from a cloud object storage container where each batch represent all records produced by the source system in a given hour. The batch job to process these records into the Lakehouse is sufficiently delayed to ensure no late- arriving data is missed. The user_id field represents a unique key for the data, which has the following schema: user_id BIGINT, username STRING, user_utc STRING, user_region STRING, last_login BIGINT, auto_pay BOOLEAN, last_updated BIGINT New records are all ingested into a table named account_history which maintains a full record of all data in the same schema as the source. The next table in the system is named account_current and is implemented as a Type 1 table representing the most recent value for each unique user_id. Assuming there are millions of user accounts and tens of thousands of records processed hourly, which implementation can be used to efficiently update the described account_current table as part of each hourly batch job?

A table is registered with the following code: Both users and orders are Delta Lake tables. Which statement describes the results of querying recent_orders? ● A. All logic will execute at query time and return the result of joining the valid versions of the source tables at the time the query finishes. ● B. All logic will execute when the table is defined and store the result of joining tables to the DBFS; this stored data will be returned when the table is queried. ● C. Results will be computed and cached when the table is defined; these cached results will incrementally update as new records are inserted into source tables. ● D. All logic will execute at query time and return the result of joining the valid versions of the source tables at the time the query began. ● E. The versions of each source table will be stored in the table transaction log; query results will be saved to DBFS with each query. Question #17 Topic 1 A production workload incrementally applies updates from an external Change Data Capture feed to a Delta Lake table as an always-on Structured Stream job. When data was initially migrated for this table, OPTIMIZE was executed and most data files were resized to 1 GB. Auto Optimize and Auto Compaction were both turned on for the streaming production job. Recent review of data files shows that most data files are under 64 MB, although each partition in the table contains at least 1 GB of data and the total table size is over 10 TB. Which of the following likely explains these smaller file sizes? ● A. Databricks has autotuned to a smaller target file size to reduce duration of MERGE operations ● B. Z-order indices calculated on the table are preventing file compaction ● C. Bloom filter indices calculated on the table are preventing file compaction

● D. Databricks has autotuned to a smaller target file size based on the overall size of data in the table ● E. Databricks has autotuned to a smaller target file size based on the amount of data in each partition Question #18 Topic 1 Which statement regarding stream-static joins and static Delta tables is correct? ● A. Each microbatch of a stream-static join will use the most recent version of the static Delta table as of each microbatch. ● B. Each microbatch of a stream-static join will use the most recent version of the static Delta table as of the job's initialization. ● C. The checkpoint directory will be used to track state information for the unique keys present in the join. ● D. Stream-static joins cannot use static Delta tables because of consistency issues. ● E. The checkpoint directory will be used to track updates to the static Delta table. Question #19 Topic 1 A junior data engineer has been asked to develop a streaming data pipeline with a grouped aggregation using DataFrame df. The pipeline needs to calculate the average humidity and average temperature for each non-overlapping five-minute interval. Events are recorded once per minute per device. Streaming DataFrame df has the following schema: "device_id INT, event_time TIMESTAMP, temp FLOAT, humidity FLOAT" Code block: Choose the response that correctly fills in the blank within the code block to complete this task. ● A. to_interval("event_time", "5 minutes").alias("time")

● B. Increase the trigger interval to 30 seconds; setting the trigger interval near the maximum execution time observed for each batch is always best practice to ensure no records are dropped. ● C. The trigger interval cannot be modified without modifying the checkpoint directory; to maintain the current stream state, increase the number of shuffle partitions to maximize parallelism. ● D. Use the trigger once option and configure a Databricks job to execute the query every 10 seconds; this ensures all backlogged records are processed with each batch. ● E. Decrease the trigger interval to 5 seconds; triggering batches more frequently may prevent records from backing up and large batches from causing spill. Topic 1 Which statement describes Delta Lake Auto Compaction? ● A. An asynchronous job runs after the write completes to detect if files could be further compacted; if yes, an OPTIMIZE job is executed toward a default of 1 GB. ● B. Before a Jobs cluster terminates, OPTIMIZE is executed on all tables modified during the most recent job. ● C. Optimized writes use logical partitions instead of directory partitions; because partition boundaries are only represented in metadata, fewer small files are written. ● D. Data is queued in a messaging bus instead of committing data directly to memory; all data is committed from the messaging bus in one batch once the job is complete. ● E. An asynchronous job runs after the write completes to detect if files could be further compacted; if yes, an OPTIMIZE job is executed toward a default of 128 MB. Question #23 Topic 1 Which statement characterizes the general programming model used by Spark Structured Streaming? ● A. Structured Streaming leverages the parallel processing of GPUs to achieve highly parallel data throughput. ● B. Structured Streaming is implemented as a messaging bus and is derived from Apache Kafka. ● C. Structured Streaming uses specialized hardware and I/O streams to achieve sub- second latency for data transfer. ● D. Structured Streaming models new data arriving in a data stream as new rows appended to an unbounded table. ● E. Structured Streaming relies on a distributed network of nodes that hold incremental state values for cached stages. Question #24 Topic 1

Which configuration parameter directly affects the size of a spark-partition upon ingestion of data into Spark? ● A. spark.sql.files.maxPartitionBytes ● B. spark.sql.autoBroadcastJoinThreshold ● C. spark.sql.files.openCostInBytes ● D. spark.sql.adaptive.coalescePartitions.minPartitionNum ● E. spark.sql.adaptive.advisoryPartitionSizeInBytes Question #25 Topic 1 A Spark job is taking longer than expected. Using the Spark UI, a data engineer notes that the Min, Median, and Max Durations for tasks in a particular stage show the minimum and median time to complete a task as roughly the same, but the max duration for a task to be roughly 100 times as long as the minimum. Which situation is causing increased duration of the overall job? ● A. Task queueing resulting from improper thread pool assignment. ● B. Spill resulting from attached volume storage being too small. ● C. Network latency due to some cluster nodes being in different regions from the source data ● D. Skew caused by more data being assigned to a subset of spark-partitions. ● E. Credential validation errors while pulling data from an external system. Question #26 Topic 1 Each configuration below is identical to the extent that each cluster has 400 GB total of RAM, 160 total cores and only one Executor per VM. Given a job with at least one wide transformation, which of the following cluster configurations will result in maximum performance? ● A. • Total VMs; 1

  • 400 GB per Executor
  • 160 Cores / Executor ● B. • Total VMs: 8
  • 50 GB per Executor
  • 20 Cores / Executor ● C. • Total VMs: 16
  • 25 GB per Executor
  • 10 Cores/Executor ● D. • Total VMs: 4
  • 100 GB per Executor
  • 40 Cores/Executor

● A. Each time the job is executed, newly updated records will be merged into the target table, overwriting previous values with the same primary keys. ● B. Each time the job is executed, the entire available history of inserted or updated records will be appended to the target table, resulting in many duplicate entries. ● C. Each time the job is executed, the target table will be overwritten using the entire history of inserted or updated records, giving the desired result. ● D. Each time the job is executed, the differences between the original and current versions are calculated; this may result in duplicate entries for some records. ● E. Each time the job is executed, only those records that have been inserted or updated since the last execution will be appended to the target table, giving the desired result. Topic 1 A new data engineer notices that a critical field was omitted from an application that writes its Kafka source to Delta Lake. This happened even though the critical field was in the Kafka source. That field was further missing from data written to dependent, long-term storage. The retention threshold on the Kafka service is seven days. The pipeline has been in production for three months. Which describes how Delta Lake can help to avoid data loss of this nature in the future? ● A. The Delta log and Structured Streaming checkpoints record the full history of the Kafka producer. ● B. Delta Lake schema evolution can retroactively calculate the correct value for newly added fields, as long as the data was in the original source. ● C. Delta Lake automatically checks that all fields present in the source data are included in the ingestion layer. ● D. Data can never be permanently dropped or deleted from Delta Lake, so data loss is not possible under any circumstance. ● E. Ingesting all raw data and metadata from Kafka to a bronze Delta table creates a permanent, replayable history of the data state. Question #30 Topic 1

A nightly job ingests data into a Delta Lake table using the following code: The next step in the pipeline requires a function that returns an object that can be used to manipulate new records that have not yet been processed to the next table in the pipeline. Which code snippet completes this function definition? def new_records(): ● A. return spark.readStream.table("bronze") ● B. return spark.readStream.load("bronze") ● C. ● D. return spark.read.option("readChangeFeed", "true").table ("bronze") ● E. Question #31 Topic 1 A junior data engineer is working to implement logic for a Lakehouse table named silver_device_recordings. The source data contains 100 unique fields in a highly nested JSON structure. The silver_device_recordings table will be used downstream to power several production monitoring dashboards and a production model. At present, 45 of the 100 fields are being used in at least one of these applications. The data engineer is trying to determine the best approach for dealing with schema declaration

The data engineering team maintains the following code: Assuming that this code produces logically correct results and the data in the source tables has been de-duplicated and validated, which statement describes what will occur when this code is executed? ● A. A batch job will update the enriched_itemized_orders_by_account table, replacing only those rows that have different values than the current version of the table, using accountID as the primary key. ● B. The enriched_itemized_orders_by_account table will be overwritten using the current valid version of data in each of the three tables referenced in the join logic.

● C. An incremental job will leverage information in the state store to identify unjoined rows in the source tables and write these rows to the enriched_iteinized_orders_by_account table. ● D. An incremental job will detect if new rows have been written to any of the source tables; if new rows are detected, all results will be recalculated and used to overwrite the enriched_itemized_orders_by_account table. ● E. No computation will occur until enriched_itemized_orders_by_account is queried; upon query materialization, results will be calculated using the current valid version of data in each of the three tables referenced in the join logic. Question #33 Topic 1 The data engineering team is migrating an enterprise system with thousands of tables and views into the Lakehouse. They plan to implement the target architecture using a series of bronze, silver, and gold tables. Bronze tables will almost exclusively be used by production data engineering workloads, while silver tables will be used to support both data engineering and machine learning workloads. Gold tables will largely serve business intelligence and reporting purposes. While personal identifying information (PII) exists in all tiers of data, pseudonymization and anonymization rules are in place for all data at the silver and gold levels. The organization is interested in reducing security concerns while maximizing the ability to collaborate across diverse teams. Which statement exemplifies best practices for implementing this system? ● A. Isolating tables in separate databases based on data quality tiers allows for easy permissions management through database ACLs and allows physical separation of default storage locations for managed tables. ● B. Because databases on Databricks are merely a logical construct, choices around database organization do not impact security or discoverability in the Lakehouse. ● C. Storing all production tables in a single database provides a unified view of all data assets available throughout the Lakehouse, simplifying discoverability by granting all users view privileges on this database. ● D. Working in the default Databricks database provides the greatest security when working with managed tables, as these will be created in the DBFS root. ● E. Because all tables must live in the same storage containers used for the database they're created in, organizations should be prepared to create between dozens and thousands of databases depending on their data isolation requirements. Question #34 Topic 1 The data architect has mandated that all tables in the Lakehouse should be configured as external Delta Lake tables. Which approach will ensure that this requirement is met? ● A. Whenever a database is being created, make sure that the LOCATION keyword is used