πŸ”

DATA-ENGINEER-PROFESSIONAL β€” questions

Page 3 of 6 Β· 110 total questions.

Topic 1 Β· Question 41

A member of the data engineering team has submitted a short notebook that they wish to schedule as part of a larger data pipeline. Assume that the commands provided below produce the logically correct results when run as presented. Which command should be removed from the notebook before scheduling it as a job?

Exhibit 1 for question 41
  • ACmd 2
  • BCmd 3
  • CCmd 4
  • DCmd 5 (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Cmd 5

Topic 1 Β· Question 42

Which statement regarding Spark configuration on the Databricks platform is true?

  • AThe Databricks REST API can be used to modify the Spark configuration properties for an interactive cluster without interrupting jobs currently running on the cluster.
  • BSpark configurations set within a notebook will affect all SparkSessions attached to the same interactive cluster.
  • CWhen the same Spark configuration property is set for an interactive cluster and a notebook attached to that cluster, the notebook setting will always be ignored.
  • DSpark configuration properties set for an interactive cluster with the Clusters UI will impact all notebooks attached to that cluster. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Spark configuration properties set for an interactive cluster with the Clusters UI will impact all notebooks attached to that cluster.

Topic 1 Β· Question 43

The business reporting team requires that data for their dashboards be updated every hour. The total processing time for the pipeline that extracts, transforms, and loads the data for their pipeline runs in 10 minutes. Assuming normal operating conditions, which configuration will meet their service-level agreement requirements with the lowest cost?

  • AConfigure a job that executes every time new data lands in a given directory
  • BSchedule a job to execute the pipeline once an hour on a new job cluster (correct answer)
  • CSchedule a Structured Streaming job with a trigger interval of 60 minutes
  • DSchedule a job to execute the pipeline once an hour on a dedicated interactive cluster
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Schedule a job to execute the pipeline once an hour on a new job cluster

Explanation

A job cluster provides isolated, ephemeral compute for a job run and terminates afterward to control cost. This option delivers the requirement at the lowest cost.

Topic 1 Β· Question 44

A Databricks SQL dashboard has been configured to monitor the total number of records present in a collection of Delta Lake tables using the following query pattern: SELECT COUNT (*) FROM table - Which of the following describes how results are generated each time the dashboard is updated?

  • AThe total count of rows is calculated by scanning all data files
  • BThe total count of rows will be returned from cached results unless REFRESH is run
  • CThe total count of records is calculated from the Delta transaction logs (correct answer)
  • DThe total count of records is calculated from the parquet file metadata
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: The total count of records is calculated from the Delta transaction logs

Topic 1 Β· Question 45

A Delta Lake table was created with the below query: Consider the following query: DROP TABLE prod.sales_by_store - If this statement is executed by a workspace admin, which result will occur?

Exhibit 1 for question 45
  • AData will be marked as deleted but still recoverable with Time Travel.
  • BThe table will be removed from the catalog but the data will remain in storage.
  • CThe table will be removed from the catalog and the data will be deleted. (correct answer)
  • DAn error will occur because Delta Lake prevents the deletion of production data.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: The table will be removed from the catalog and the data will be deleted.

Topic 1 Β· Question 46

A developer has successfully configured their credentials for Databricks Repos and cloned a remote Git repository. They do not have privileges to make changes to the main branch, which is the only branch currently visible in their workspace. Which approach allows this user to share their code updates without the risk of overwriting the work of their teammates?

  • AUse Repos to create a new branch, commit all changes, and push changes to the remote Git repository. (correct answer)
  • BUse Repos to create a fork of the remote repository, commit all changes, and make a pull request on the source repository.
  • CUse Repos to pull changes from the remote Git repository; commit and push changes to a branch that appeared as changes were pulled.
  • DUse Repos to merge all differences and make a pull request back to the remote repository.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Use Repos to create a new branch, commit all changes, and push changes to the remote Git repository.

Explanation

Databricks Repos integrates Git-based source control with workspace development workflows.

Topic 1 Β· Question 47

The security team is exploring whether or not the Databricks secrets module can be leveraged for connecting to an external database. After testing the code with all Python variables being defined with strings, they upload the password to the secrets module and configure the correct permissions for the currently active user. They then modify their code to the following (leaving all other variables unchanged). Which statement describes what will happen when the above code is executed?

Exhibit 1 for question 47
  • AThe connection to the external table will succeed; the string "REDACTED" will be printed. (correct answer)
  • BAn interactive input box will appear in the notebook; if the right password is provided, the connection will succeed and the encoded password will be saved to DBFS.
  • CAn interactive input box will appear in the notebook; if the right password is provided, the connection will succeed and the password will be printed in plain text.
  • DThe connection to the external table will succeed; the string value of password will be printed in plain text.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: The connection to the external table will succeed; the string "REDACTED" will be printed. This option keeps traffic private / properly secured as required.

Topic 1 Β· Question 48

The data science team has created and logged a production model using MLflow. The model accepts a list of column names and returns a new column of type DOUBLE. The following code correctly imports the production model, loads the customers table containing the customer_id key column into a DataFrame, and defines the feature columns needed for the model. Which code block will output a DataFrame with the schema "customer_id LONG, predictions DOUBLE"?

Exhibit 1 for question 48
  • Adf.map(lambda x:model(x[columns])).select("customer_id, predictions")
  • Bdf.select("customer_id", model(*columns).alias("predictions")) (correct answer)
  • Cmodel.predict(df, columns)
  • Ddf.apply(model, columns).select("customer_id, predictions")
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: df.select("customer_id", model(*columns).alias("predictions"))

Topic 1 Β· Question 49

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 database contains only two tables: geo_lookup and sales. What will be the outcome of executing these command cells m order m an interactive notebook?

Exhibit 1 for question 49
  • ABoth commands will succeed. Executing SHOW TABLES will show that countries_af and sales_af have been registered as views.
  • BCmd 1 will succeed. Cmd 2 will search all accessible databases for a table or view named countries_af: if this entity exists, Cmd 2 will succeed.
  • CCmd 1 will succeed and Cmd 2 will fail. countries_af will be a Python variable representing a PySpark DataFrame.
  • DCmd 1 will succeed and Cmd 2 will fail. countries_af will be a Python variable containing a list of strings. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Cmd 1 will succeed and Cmd 2 will fail. countries_af will be a Python variable containing a list of strings.

Topic 1 Β· Question 50

The data science team has requested assistance in accelerating queries on free-form text from user reviews. The data is currently stored in Parquet with the below schema: item_id INT, user_id INT, review_id INT, rating FLOAT, review STRING The review column contains the full text of the review left by the user. Specifically, the data science team is looking to identify if any of 30 key words exist in this field. A junior data engineer suggests converting this data to Delta Lake will improve query performance. Which response to the junior data engineer’s suggestion is correct?

  • ADelta Lake statistics are not optimized for free text fields with high cardinality. (correct answer)
  • BDelta Lake statistics are only collected on the first 4 columns in a table.
  • CZORDER ON review will need to be run to see performance gains.
  • DThe Delta log creates a term matrix for free text fields to support selective filtering.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Delta Lake statistics are not optimized for free text fields with high cardinality.

Explanation

Delta Lake adds ACID transactions, schema enforcement, time travel, and reliable batch and streaming operations to a data lake. OPTIMIZE compacts small Delta files to improve data-skipping and query performance.

Topic 1 Β· Question 51

The data engineering team has configured a job to process customer requests to be forgotten (have their data deleted). All user data that needs to be deleted is stored in Delta Lake tables 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?

  • ABecause the VACUUM command permanently deletes all files containing deleted records, deleted records may be accessible with time travel for around 24 hours.
  • BBecause 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.
  • CBecause 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. (correct answer)
  • DBecause 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.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: 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.

Explanation

VACUUM removes old unreferenced Delta files after the retention period, reducing storage while preserving time-travel safety.

Topic 1 Β· Question 52

Assuming that the Databricks CLI has been installed and configured correctly, which Databricks CLI command can be used to upload a custom Python Wheel to object storage mounted with the DBFS for use with a production job?

  • Aconfigure
  • Bfs (correct answer)
  • Cworkspace
  • Dlibraries
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: fs

Topic 1 Β· Question 53

The following table consists of items found in user carts within an e-commerce website. The following MERGE statement is used to update this table using an updates view, with schema evolution enabled on this table. How would the following update be handled?

Exhibit 1 for question 53Exhibit 2 for question 53Exhibit 3 for question 53
  • AThe update throws an error because changes to existing columns in the target schema are not supported.
  • BThe new nested Field is added to the target schema, and dynamically read as NULL for existing unmatched records. (correct answer)
  • CThe update is moved to a separate "rescued" column because it is missing a column expected in the target schema.
  • DThe new nested field is added to the target schema, and files underlying existing records are updated to include NULL values for the new field.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: The new nested Field is added to the target schema, and dynamically read as NULL for existing unmatched records.

Topic 1 Β· Question 54

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?

  • AIterate through an ordered set of changes to the table, applying each in turn to create the current state of the table, (insert, update, delete), timestamp of change, and the values.
  • BUse merge into to insert, update, or delete the most recent entry for each pk_id into a table, then propagate all changes throughout the system.
  • CDeduplicate records in each batch by pk_id and overwrite the target table.
  • DUse 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. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option 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.

Explanation

Delta Lake adds ACID transactions, schema enforcement, time travel, and reliable batch and streaming operations to a data lake.

Topic 1 Β· Question 55

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. Which implementation can be used to efficiently update the described account_current table as part of each hourly batch job assuming there are millions of user accounts and tens of thousands of records processed hourly?

  • AFilter records in account_history using the last_updated field and the most recent hour processed, making sure to deduplicate on username; write a merge statement to update or insert the most recent value for each username.
  • BUse Auto Loader to subscribe to new files in the account_history directory; configure a Structured Streaming trigger available job to batch update newly detected files into the account_current table.
  • COverwrite the account_current table with each batch using the results of a query against the account_history table grouping by user_id and filtering for the max value of last_updated.
  • DFilter records in account_history using the last_updated field and the most recent hour processed, as well as the max last_login by user_id write a merge statement to update or insert the most recent value for each user_id. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Filter records in account_history using the last_updated field and the most recent hour processed, as well as the max last_login by user_id write a merge statement to update or insert the most recent value for each us...

Topic 1 Β· Question 56

The business intelligence team has a dashboard configured to track various summary metrics for retail stores. This includes total sales for the previous day alongside totals and averages for a variety of time periods. The fields required to populate this dashboard have the following schema: For demand forecasting, the Lakehouse contains a validated table of all itemized sales updated incrementally in near real-time. This table, named products_per_order, includes the following fields: Because reporting on long-term sales trends is less volatile, analysts using the new dashboard only require data to be refreshed once daily. Because the dashboard will be queried interactively by many users throughout a normal business day, it should return results quickly and reduce total compute associated with each materialization. Which solution meets the expectations of the end users while controlling and limiting possible costs?

Exhibit 1 for question 56Exhibit 2 for question 56
  • APopulate the dashboard by configuring a nightly batch job to save the required values as a table overwritten with each update. (correct answer)
  • BUse Structured Streaming to configure a live dashboard against the products_per_order table within a Databricks notebook.
  • CDefine a view against the products_per_order table and define the dashboard against this view.
  • DUse the Delta Cache to persist the products_per_order table in memory to quickly update the dashboard with each query.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Populate the dashboard by configuring a nightly batch job to save the required values as a table overwritten with each update. This option meets the real-time / low-latency performance requirement.

Topic 1 Β· Question 57

A Delta lake table with CDF enabled table in the Lakehouse named customer_churn_params is used in churn prediction by the machine learning team. The table contains information about customers derived from a number of upstream sources. Currently, the data engineering team populates this table nightly by overwriting the table with the current valid values derived from upstream data sources. The churn prediction model used by the ML team is fairly stable in production. The team is only interested in making predictions on records that have changed in the past 24 hours. Which approach would simplify the identification of these changed records?

  • AApply the churn model to all rows in the customer_churn_params table, but implement logic to perform an upsert into the predictions table that ignores rows where predictions have not changed.
  • BConvert the batch job to a Structured Streaming job using the complete output mode; configure a Structured Streaming job to read from the customer_churn_params table and incrementally predict against the churn model.
  • CReplace the current overwrite logic with a merge statement to modify only those records that have changed; write logic to make predictions on the changed records identified by the change data feed. (correct answer)
  • DModify the overwrite logic to include a field populated by calling spark.sql.functions.current_timestamp() as data are being written; use this field to identify records written on a particular date.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Replace the current overwrite logic with a merge statement to modify only those records that have changed; write logic to make predictions on the changed records identified by the change data feed.

Topic 1 Β· Question 58

A view is registered with the following code: Both users and orders are Delta Lake tables. Which statement describes the results of querying recent_orders?

Exhibit 1 for question 58
  • AAll logic will execute when the view is defined and store the result of joining tables to the DBFS; this stored data will be returned when the view is queried.
  • BResults will be computed and cached when the view is defined; these cached results will incrementally update as new records are inserted into source tables.
  • CAll 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.
  • DAll 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. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option 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.

Topic 1 Β· Question 59

A data ingestion task requires a one-TB JSON dataset to be written out to Parquet with a target part-file size of 512 MB. Because Parquet is being used instead of Delta Lake, built-in file-sizing features such as Auto-Optimize & Auto-Compaction cannot be used. Which strategy will yield the best performance without shuffling data?

  • ASet spark.sql.files.maxPartitionBytes to 512 MB, ingest the data, execute the narrow transformations, and then write to parquet.
  • BSet spark.sql.shuffle.partitions to 2,048 partitions (1TB*1024*1024/512), ingest the data, execute the narrow transformations, optimize the data by sorting it (which automatically repartitions the data), and then write to parquet.
  • CSet spark.sql.adaptive.advisoryPartitionSizeInBytes to 512 MB bytes, ingest the data, execute the narrow transformations, coalesce to 2,048 partitions (1TB*1024*1024/512), and then write to parquet.
  • DIngest the data, execute the narrow transformations, repartition to 2,048 partitions (1TB* 1024*1024/512), and then write to parquet. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Ingest the data, execute the narrow transformations, repartition to 2,048 partitions (1TB* 1024*1024/512), and then write to parquet.

Topic 1 Β· Question 60

Which statement regarding stream-static joins and static Delta tables is correct?

  • AThe checkpoint directory will be used to track updates to the static Delta table.
  • BEach microbatch of a stream-static join will use the most recent version of the static Delta table as of the job's initialization. (correct answer)
  • CThe checkpoint directory will be used to track state information for the unique keys present in the join.
  • DStream-static joins cannot use static Delta tables because of consistency issues.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option 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.

Showing questions 41–60 of 110 Β· Page 3 of 6