Free Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 Exam Braindumps
Databricks Certified Associate Developer for Apache Spark 3.5 - Python Questions 41–45 (page: 10)

Updated On: 10-Feb-2026

A Spark application is experiencing performance issues in client mode because the driver is resource- constrained.

How should this issue be resolved?

  1. Add more executor instances to the cluster
  2. Increase the driver memory on the client machine
  3. Switch the deployment mode to cluster mode
  4. Switch the deployment mode to local mode

Answer(s): C

Explanation:

In Spark's client mode, the driver runs on the local machine that submitted the job. If that machine is resource-constrained (e.g., low memory), performance degrades.

From the Spark documentation:

"In cluster mode, the driver runs inside the cluster, benefiting from cluster resources and scalability."

Option A is incorrect -- executors do not help the driver directly.

Option B might help short-term but does not scale.

Option C is correct -- switching to cluster mode moves the driver to the cluster.

Option D (local mode) is for development/testing, not production.

Final

Answer(s): C



A Data Analyst is working on the DataFrame sensor_df, which contains two columns:

Which code fragment returns a DataFrame that splits the record column into separate columns and has one array item per row?

A)



B)



C)



D)

  1. exploded_df = sensor_df.withColumn("record_exploded", explode("record")) exploded_df = exploded_df.select("record_datetime", "sensor_id", "status", "health")
  2. exploded_df = exploded_df.select(
    "record_datetime",
    "record_exploded.sensor_id",
    "record_exploded.status",
    "record_exploded.health"
    )
    exploded_df = sensor_df.withColumn("record_exploded", explode("record"))
  3. exploded_df = exploded_df.select(
    "record_datetime",
    "record_exploded.sensor_id",
    "record_exploded.status",
    "record_exploded.health"
    )
    exploded_df = sensor_df.withColumn("record_exploded", explode("record"))
  4. exploded_df = exploded_df.select("record_datetime", "record_exploded")
  5. Option A
  6. Option B
  7. Option C
  8. Option D

Answer(s): C

Explanation:

To flatten an array of structs into individual rows and access fields within each struct, you must:

Use explode() to expand the array so each struct becomes its own row.

Access the struct fields via dot notation (e.g., record_exploded.sensor_id).

Option C does exactly that:

First, explode the record array column into a new column record_exploded.

Then, access fields of the struct using the dot syntax in select.

This is standard practice in PySpark for nested data transformation.

Final

Answer(s): C



A data engineer needs to write a Streaming DataFrame as Parquet files.

Given the code:



Which code fragment should be inserted to meet the requirement?

A)



B)



C)



D)



Which code fragment should be inserted to meet the requirement?

  1. .format("parquet")
    .option("location", "path/to/destination/dir")
  2. CopyEdit
    .option("format", "parquet")
    .option("destination", "path/to/destination/dir")
  3. .option("format", "parquet")
    .option("location", "path/to/destination/dir")
  4. .format("parquet")
    .option("path", "path/to/destination/dir")
  5. Option A

  6. Option B
  7. Option C
  8. Option D

Answer(s): D

Explanation:

To write a structured streaming DataFrame to Parquet files, the correct way to specify the format and output directory is:

.writeStream

.format("parquet")

.option("path", "path/to/destination/dir")

According to Spark documentation:

"When writing to file-based sinks (like Parquet), you must specify the path using the .option("path", ...) method. Unlike batch writes, .save() is not supported."

Option A incorrectly uses .option("location", ...) (invalid for Parquet sink).

Option B incorrectly sets the format via .option("format", ...), which is not the correct method.

Option C repeats the same issue.

Option D is correct: .format("parquet") + .option("path", ...) is the required syntax.

Final

Answer(s): D



A data engineer noticed improved performance after upgrading from Spark 3.0 to Spark 3.5. The engineer found that Adaptive Query Execution (AQE) was enabled.

Which operation is AQE implementing to improve performance?

  1. Dynamically switching join strategies
  2. Collecting persistent table statistics and storing them in the metastore for future use
  3. Improving the performance of single-stage Spark jobs
  4. Optimizing the layout of Delta files on disk

Answer(s): A

Explanation:

Adaptive Query Execution (AQE) is a Spark 3.x feature that dynamically optimizes query plans at runtime. One of its core features is:

Dynamically switching join strategies (e.g., from sort-merge to broadcast) based on runtime statistics.

Other AQE capabilities include:

Coalescing shuffle partitions

Skew join handling

Option A is correct.

Option B refers to statistics collection, which is not AQE's primary function.

Option C is too broad and not AQE-specific.

Option D refers to Delta Lake optimizations, unrelated to AQE.

Final

Answer(s): A



A data engineer wants to write a Spark job that creates a new managed table. If the table already exists, the job should fail and not modify anything.

Which save mode and method should be used?

  1. saveAsTable with mode ErrorIfExists
  2. saveAsTable with mode Overwrite
  3. save with mode Ignore
  4. save with mode ErrorIfExists

Answer(s): A

Explanation:

The method saveAsTable() creates a new table and optionally fails if the table exists.

From Spark documentation:

"The mode 'ErrorIfExists' (default) will throw an error if the table already exists."

Thus:

Option A is correct.

Option B (Overwrite) would overwrite existing data -- not acceptable here.

Option C and D use save(), which doesn't create a managed table with metadata in the metastore.

Final

Answer(s): A



Viewing page 10 of 28
Viewing questions 46 - 50 out of 135 questions


Post your Comments and Discuss Databricks Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!