Databricks Certified Associate Developer for Apache Spark 3.5 - Python Sample Questions:
1. Given the schema:
event_ts TIMESTAMP,
sensor_id STRING,
metric_value LONG,
ingest_ts TIMESTAMP,
source_file_path STRING
The goal is to deduplicate based on: event_ts, sensor_id, and metric_value.
Options:
A) dropDuplicates on the exact matching fields
B) dropDuplicates with no arguments (removes based on all columns)
C) dropDuplicates on all columns (wrong criteria)
D) groupBy without aggregation (invalid use)
2. A developer notices that all the post-shuffle partitions in a dataset are smaller than the value set for spark.sql.adaptive.maxShuffledHashJoinLocalMapThreshold.
Which type of join will Adaptive Query Execution (AQE) choose in this case?
A) A sort-merge join
B) A shuffled hash join
C) A Cartesian join
D) A broadcast nested loop join
3. A data engineer is building a Structured Streaming pipeline and wants the pipeline to recover from failures or intentional shutdowns by continuing where the pipeline left off.
How can this be achieved?
A) By configuring the option recoveryLocation during the SparkSession initialization
B) By configuring the option recoveryLocation during writeStream
C) By configuring the option checkpointLocation during readStream
D) By configuring the option checkpointLocation during writeStream
4. A data engineer needs to persist a file-based data source to a specific location. However, by default, Spark writes to the warehouse directory (e.g., /user/hive/warehouse). To override this, the engineer must explicitly define the file path.
Which line of code ensures the data is saved to a specific location?
Options:
A) users.write.option("path", "/some/path").saveAsTable("default_table")
B) users.write(path="/some/path").saveAsTable("default_table")
C) users.write.saveAsTable("default_table").option("path", "/some/path")
D) users.write.saveAsTable("default_table", path="/some/path")
5. 21 of 55.
What is the behavior of the function date_sub(start, days) if a negative value is passed into the days parameter?
A) The same start date will be returned.
B) The number of days specified will be removed from the start date.
C) The number of days specified will be added to the start date.
D) An error message of an invalid parameter will be returned.
Solutions:
| Question # 1 Answer: A | Question # 2 Answer: B | Question # 3 Answer: D | Question # 4 Answer: A | Question # 5 Answer: C |
We're so confident of our products that we provide no hassle product exchange.


By Mona

