Databricks Certified Associate Developer for Apache Spark 3.5 - Python Sample Questions:
1. 6 of 55.
Which components of Apache Spark's Architecture are responsible for carrying out tasks when assigned to them?
A) CPU Cores
B) Executors
C) Worker Nodes
D) Driver Nodes
2. A data scientist is analyzing a large dataset and has written a PySpark script that includes several transformations and actions on a DataFrame. The script ends with a collect() action to retrieve the results.
How does Apache Spark™'s execution hierarchy process the operations when the data scientist runs this script?
A) The script is first divided into multiple applications, then each application is split into jobs, stages, and finally tasks.
B) Spark creates a single task for each transformation and action in the script, and these tasks are grouped into stages and jobs based on their dependencies.
C) The collect() action triggers a job, which is divided into stages at shuffle boundaries, and each stage is split into tasks that operate on individual data partitions.
D) The entire script is treated as a single job, which is then divided into multiple stages, and each stage is further divided into tasks based on data partitions.
3. A data engineer replaces the exact percentile() function with approx_percentile() to improve performance, but the results are drifting too far from expected values.
Which change should be made to solve the issue?
A) Increase the last value of the percentage parameter to increase the accuracy of the percentile ranges
B) Increase the value of the accuracy parameter in order to increase the memory usage but also improve the accuracy
C) Decrease the value of the accuracy parameter in order to decrease the memory usage but also improve the accuracy
D) Decrease the first value of the percentage parameter to increase the accuracy of the percentile ranges
4. 3 of 55. A data engineer observes that the upstream streaming source feeds the event table frequently and sends duplicate records. Upon analyzing the current production table, the data engineer found that the time difference in the event_timestamp column of the duplicate records is, at most, 30 minutes.
To remove the duplicates, the engineer adds the code:
df = df.withWatermark("event_timestamp", "30 minutes")
What is the result?
A) It removes duplicates that arrive within the 30-minute window specified by the watermark.
B) It is not able to handle deduplication in this scenario.
C) It removes all duplicates regardless of when they arrive.
D) It accepts watermarks in seconds and the code results in an error.
5. In the code block below, aggDF contains aggregations on a streaming DataFrame:
Which output mode at line 3 ensures that the entire result table is written to the console during each trigger execution?
A) replace
B) aggregate
C) complete
D) append
Solutions:
| Question # 1 Answer: B | Question # 2 Answer: C | Question # 3 Answer: B | Question # 4 Answer: A | Question # 5 Answer: C |
We're so confident of our products that we provide no hassle product exchange.


By June

