Exam Information
Free practice questions with explanations
Databricks Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 Practice Questions
Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.
- Questions
- 14
- Answered
- 0
- Correct
- 0
- Score
- -
-
1 Question 1 Single choice Apache Spark Architecture and Components
A data engineering team runs a PySpark batch job on a standalone cluster. The driver logs show that the job finishes its shuffle stages, but the application fails with OutOfMemoryError on the driver after calling collect() on a DataFrame with 40 million rows. The team must keep the job on the same cluster, cannot increase driver memory this sprint, and the downstream consumer only needs the aggregated result written to cloud storage. Which action is the BEST fix?
Correct Answer: BExplanationcollect() pulls all rows into the driver JVM, so the driver must hold the full result regardless of executor memory or shuffle partitioning. Writing with DataFrameWriter lets executors write their own partitions directly to storage, keeping the driver memory footprint small and meeting the no-driver-memory-increase constraint. Executor memory (A) does not affect driver heap. Shuffle partitions (C) do not reduce the total rows returned to the driver. cache() (D) keeps data on executors but collect() still ships everything to the driver, so the error persists.
-
2 Question 2 Single choice Developing Apache Spark DataFrame/DataSet API Applications
A retail company ingests nested JSON order files into a Spark DataFrame. Each record contains an array field items with structs holding sku, qty and price. The analytics team needs one row per item with the order_id retained, and they want to avoid a Python UDF for performance reasons. Which DataFrame transformation sequence achieves this MOST efficiently?
Correct Answer: AExplanationexplode() from pyspark.sql.functions produces one row per array element, and selecting struct fields with dot notation extracts the nested values, all using built-in Catalyst-optimised expressions. posexplode_outer (B) adds a position column the team does not need and is not the stated requirement. The groupBy and UDF approach (C) introduces a shuffle and a Python UDF, both of which the team wanted to avoid. Indexing only the first element with unions (D) is incorrect because it drops items beyond index zero and is inefficient.
-
3 Question 3 Single choice Structured Streaming
A fintech team processes card transactions with Structured Streaming from a Kafka topic. They compute the count of transactions per account over a 10-minute tumbling window and must tolerate events arriving up to 15 minutes late. Downstream dashboards must not be updated with a result that later changes once the window has been finalised. The team wants to keep state bounded. Which configuration BEST meets these requirements?
Correct Answer: AExplanationA watermark of 15 minutes allows late data up to that threshold and lets Spark drop state for finalised windows, bounding memory. Append mode emits each window only once after the watermark passes its end, so downstream results never change, matching the requirement. Update mode (B) can emit intermediate revisions, violating the no-changes requirement. Omitting the watermark (C) causes unbounded state growth. A 10-minute watermark (D) would drop events arriving between 10 and 15 minutes late, and complete mode retains all state.
-
4 Question 4 Single choice Troubleshooting and Tuning Apache Spark DataFrame API Applications
A Spark job joins a 2 TB fact table with a 300 MB dimension table. The job runs for hours and the Spark UI shows one task in the join stage processing 80 percent of the shuffle data while others finish in seconds. The cluster is shared, so the team cannot change cluster sizing or disable adaptive execution globally. The dimension table is only needed for a lookup on a single key column. Which change is the MOST appropriate?
Correct Answer: AExplanationBroadcasting the 300 MB dimension table sends a copy to every executor, so the large fact table is not shuffled by the join key and the single hot key no longer overloads one reducer. Raising shuffle partitions (B) does not split a single skewed key across tasks. Disabling adaptive execution (C) is forbidden and would not fix skew. repartition(1) (D) funnels all data into one partition, worsening the bottleneck.
-
5 Question 5 Multiple choice Using Pandas API on Apache Spark
A data scientist has a pandas-based feature script that works on samples but must now run on a 500 GB Parquet dataset stored in cloud object storage. The team wants minimal code changes and must avoid collecting the full dataset into driver memory. Which TWO actions are appropriate? (Choose two.)
Correct Answer: A, DExplanationThe pandas API on Spark (pyspark.pandas) mirrors pandas syntax while executing operations distributed across the cluster, and read_parquet loads the data as a distributed DataFrame, meeting the minimal-change requirement. Calling to_pandas() (B) collects everything to the driver, violating the constraint. Staying with single-node pandas (C) cannot handle 500 GB. Streaming with chunksize (E) is a pandas-only option that does not exist for read_parquet in the way described, and still processes on the driver rather than the cluster.
-
6 Question 6 Single choice Using Spark Connect to Deploy Applications
A company runs a shared Spark cluster in a private network. Analysts work from laptops and notebooks outside that network and need to submit PySpark code without installing a full Spark distribution or having direct access to driver-side JVM ports. The security team requires that only a single gRPC endpoint be exposed and that client environments stay lightweight. Which approach BEST satisfies these constraints?
Correct Answer: AExplanationSpark Connect runs a gRPC server on the cluster side, and thin Python clients (pyspark-client) connect via a remote sc:// URL, requiring only one exposed endpoint and no local Spark installation. Exposing driver RPC ports (B) violates the security requirement. Installing full Spark on laptops (C) violates the lightweight-client constraint and needs direct cluster-manager access. A JDBC-only approach (D) does not allow submitting arbitrary PySpark DataFrame code and is not the Spark Connect mechanism.
-
7 Question 7 Single choice Using Spark SQL
An analytics team stores daily sales in a managed Delta table with columns region, product, sale_date and revenue. Analysts run frequent queries filtering by sale_date and aggregating revenue by region. The team wants to inspect whether the Catalyst optimizer is pruning partitions and pushing filters before deciding on a layout change, and they must not run the query to obtain this information. Which command should they use?
Correct Answer: AExplanationEXPLAIN (with FORMATTED) displays the logical and physical plan, including PartitionFilters and PushedFilters in the FileScan node, without executing the query, which is what the team needs. DESCRIBE HISTORY (B) shows table commit history, not query plans. ANALYZE TABLE (C) modifies statistics and does not show pruning behaviour. SHOW PARTITIONS (D) lists partition values but does not reveal what the optimizer chooses for a given query.
-
8 Question 8 Single choice Apache Spark Architecture and Components
A PySpark application running on YARN in cluster mode shows that the executors are idle for long periods while the driver spends several minutes building a very large execution plan before any tasks are launched. The team has confirmed that the number of executors and their resources are adequate. Which component is primarily responsible for this delay, and what should the team review first?
Correct Answer: BExplanationThe driver is responsible for logical and physical planning and DAG construction, and very long lineages or deeply iterative code (for example, loops that keep chaining DataFrame transformations) can make planning slow. Reviewing lineage length and using checkpointing or restructuring is the appropriate first step. The cluster manager (A) only allocates resources and is not the bottleneck described. Executors (C) do not build the plan. There is no SparkContext per worker node (D); SparkContext lives on the driver.
-
9 Question 9 Single choice Developing Apache Spark DataFrame/DataSet API Applications
A team maintains a PySpark pipeline that reads customer records with a schema defined in code. A new upstream source sometimes sends a numeric column customer_id as a string such as 'C-1029' and sometimes as an integer, and the job must not fail for either form. The team wants to keep rows with malformed IDs for later review instead of dropping them. Which read and transformation strategy is MOST appropriate?
Correct Answer: AExplanationDeclaring customer_id as StringType accepts both integer-looking and string values without failure, and try_cast (available in Spark 3.5) returns NULL for non-convertible values instead of raising an error, while the original string column preserves the malformed records for review. FAILFAST (B) aborts on bad records. DROPMALFORMED (C) discards the rows the team wants to keep. inferSchema (D) produces inconsistent types across files and does not guarantee a stable schema.
-
10 Question 10 Multiple choice Troubleshooting and Tuning Apache Spark DataFrame API Applications
A nightly Spark job that writes partitioned Parquet files is slow and generates thousands of very small output files, which later slow down downstream reads. The job's stages show many tasks with very little data each. Which TWO actions are the most appropriate to address the small files issue at write time? (Choose two.)
Correct Answer: A, CExplanationEach write task produces one or more files per partition, so reducing the number of tasks with coalesce or repartition before writing reduces output file count. Adaptive query execution with coalesced shuffle partitions (spark.sql.adaptive.coalescePartitions.enabled, enabled alongside AQE) merges small post-shuffle partitions automatically. Executor memory (B) does not change task count or file size directly. Lowering maxPartitionBytes (D) increases input partitions, worsening the problem. Switching to CSV (E) does not address small files and is not a best practice here.
-
11 Question 11 Single choice Structured Streaming
A logistics company streams GPS pings from Kafka and needs to maintain the latest position per vehicle, updating the state on every new ping. The job must run continuously, and the team wants checkpointed fault tolerance so that it recovers after executor loss without reprocessing from the earliest offset. The output goes to a Delta table. Which combination of settings is MOST appropriate?
Correct Answer: AExplanationA streaming aggregation grouped by vehicle with max over timestamp maintains state keyed by vehicle, and complete mode outputs the full aggregated table each trigger, suitable for a latest-position table. A checkpointLocation on durable storage is required for fault tolerance and offset tracking. Append mode (B) cannot emit updated aggregates for a non-watermarked aggregation, and omitting the checkpoint breaks recovery. A driver-side list (C) is not fault tolerant and is not scalable. A batch overwrite hourly (D) is not continuous and does not use streaming state.
-
12 Question 12 Single choice Using Spark SQL
A data analyst must produce a report that compares each store's monthly revenue with the revenue of the same store in the prior month, using a Spark SQL view named monthly_sales with columns store_id, month (DATE, first day of month) and revenue. The report must include all stores in each month even when a store had no sales in the prior month, returning NULL for the prior-month value in that case. Which SQL approach BEST meets the requirement?
Correct Answer: BExplanationA LEFT JOIN from the current month rows to the prior month rows, matching on store_id and the prior month value computed with add_months(month, -1), keeps every current row and returns NULL where no prior-month sale exists. The INNER JOIN (A) drops rows without a prior month and also matches the direction incorrectly. The CROSS JOIN (C) is inefficient and risks a combinatorial blow-up. LAG partitioned by month (D) is wrong because it partitions across stores rather than by store, and ordering by revenue does not give chronological comparison.
-
13 Question 13 Single choice Troubleshooting and Tuning Apache Spark DataFrame API Applications
A Spark application repeatedly reads the same 50 GB curated DataFrame in several downstream branches. The Spark UI shows the full lineage, including the original Parquet scan, being recomputed for each branch, and the job's runtime has doubled since a new branch was added. The cluster has ample memory but is shared, and the team must avoid storing more than the active working set. Which action is the MOST appropriate?
Correct Answer: AExplanationPersisting with MEMORY_AND_DISK keeps the reused DataFrame in memory and spills partitions to disk when memory is insufficient, avoiding recomputation across branches, and calling unpersist after the branches respects the shared-cluster constraint by releasing the working set. MEMORY_ONLY without unpersist (B) holds memory unnecessarily and can evict partitions causing recomputation. Writing temporary tables per branch (C) adds unnecessary I/O and does not follow the shared-cluster best practice. Shuffle partitions (D) do not change how many times a scan is recomputed by separate branches.
-
14 Question 14 Single choice Apache Spark Architecture and Components
An engineer is comparing deployment options for a PySpark batch pipeline that must run on a shared Kubernetes cluster managed by the platform team. The organisation requires that the Spark driver and executors be scheduled as pods, that resource quotas per namespace be enforced by Kubernetes, and that no separate long-running Spark master service be maintained. Which deployment mode and cluster manager combination BEST satisfies these constraints?
Correct Answer: BExplanationSpark's native Kubernetes support uses the Kubernetes API as the cluster manager; in cluster deploy mode the driver runs in a pod and creates executor pods, which respects namespace quotas and avoids a standing Spark master. A standalone master (A) is the long-running service the team wants to avoid. YARN (C) is not a Kubernetes-native scheduler and does not fit pods-with-quotas. Local mode (D) does not distribute work across executors and is not a production cluster deployment.
These are 14 of the 135 questions in the full Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 pack.
Get All 135 QuestionsGet all 135 questions & answers
Full access options for Databricks Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5
Self-study
PDF Version
- 135 actual exam questions
- Compatible with all devices
- Printable PDF format
- No download limits
- 90 days free updates
- 24/7 customer support
Best value
Bundle Pack
- Discounted PDF + online access
- 135 actual exam questions
- Both PDF and online practice test
- Free 90 days updates
- No download or practice limits
- 24/7 customer support
Exam simulation
Online Practice Test
- 135 actual exam questions
- Actual exam environment
- 90 days free updates
- Browser-based software
- 24/7 customer support
100% Money Back Guarantee
Your success comes first
At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 Exam (Databricks Certified Associate Developer for Apache Spark 3.5 - Python) on your very first attempt.
In a rare case, if you fail your exam, we will refund your amount without asking a single question.