Free sample exam
Databricks Certified Associate Developer for Apache Spark
Free practice questions for the Databricks Apache Spark Developer Associate exam, written to the October 2026 guide, in PySpark, scored as you go, with the reason behind every answer.
Tecyfy is independent of Databricks and the Apache Software Foundation. These are our own practice questions, written to the objectives in the official exam guide and answered from the Apache Spark documentation.
The real exam
This is the Spark exam, not the Databricks one: it tests whether you can write PySpark that does the right thing and know why it runs the way it does. The DataFrame API is 30% of the questions, Spark's architecture and Spark SQL are 20% each, and tuning and Structured Streaming 10% each. Spark Connect and the pandas API on Spark get 5% each.
The current version went live on 8 October 2026, and its guide adds broadcast variables and accumulators, stateful UDFs and streaming deduplication with and without a watermark. The code in the questions is Python. The questions below follow the same split, and every answer is checked against the Apache Spark documentation.
- Questions
- 45 scored multiple choice, plus up to 10 unscored
- Time
- 90 minutes
- Pass mark
- Not published by Databricks
- Fee
- $200, plus tax
- Delivery
- Online proctored or at a test centre
- Language
- English
- Valid for
- 2 years, renewed by passing the current exam
- Prerequisite
- None; 6 months of hands-on Spark work recommended
What it covers, by share of the questions
- Apache Spark Architecture and Components20%
- Using Spark SQL20%
- Developing Apache Spark DataFrame/DataSet API Applications30%
- Troubleshooting and Tuning Apache Spark DataFrame API Applications10%
- Structured Streaming10%
- Using Spark Connect to Deploy Applications5%
- Using Pandas API on Spark5%
The sample
15 questions in the style of the exam. Pick an answer to see why it is right or wrong. Your best score stays in this browser.
Question 1 of 15
Question 1
A script reads orders with spark.read.parquet, keeps rows with df.filter(df.amount > 100), counts them per day with groupBy("order_date").count(), and saves the result with write.mode("overwrite").saveAsTable("daily"). Which step makes Spark run the filter and the count?
Not this time. filter and groupBy(...).count() on a DataFrame are transformations: Spark only adds them to the plan, which is lazy evaluation. Nothing runs until an action asks for a result, and writing the DataFrame is one, so the write starts the job and Spark plans the filter and the aggregation together. A shuffle splits the job into stages; it does not start a job by itself.
Question 2
In Spark's execution hierarchy, what ends one stage and starts the next?
Not this time. An action starts a job. Spark splits the job into stages at shuffle boundaries: narrow transformations such as filter, select and withColumn run in the same stage, one task per partition, and a wide transformation that has to move rows between partitions ends the stage. Executors run tasks; they do not shape the plan.
Question 3
You call orders.cache() and then orders.count(). What happens, and at what storage level is the data kept?
Not this time. cache() is lazy, like a transformation: it marks the DataFrame, and the first action that computes it, here count(), stores the partitions. For a DataFrame, cache() uses the default storage level, MEMORY_AND_DISK_DESER, so partitions that do not fit in memory go to disk. persist() is the same call with a storage level you choose.
Question 4
You want to look at a folder of JSON files with SQL without creating a table or a view first. Which query works?
Not this time. Spark SQL can query a file or folder directly by putting the format before the path in backticks: json.
path, parquet.path, csv.path, orc.pathor text.path(and delta.pathwhere Delta Lake is installed). The other 2 forms are not Spark SQL syntax.Question 5
A notebook registers a DataFrame with createOrReplaceTempView("recent_orders"). A second SparkSession in the same application cannot find it. What should the first session do instead?
Not this time. Temporary views are session-scoped: they disappear when the session that made them ends and other sessions cannot see them. A global temporary view lasts until the Spark application ends and is shared by its sessions; it lives in the system database global_temp, so it must be named with that prefix. Caching changes how the data is stored, not who can see the view.
Question 6
A table named sales already exists. What does df.write.saveAsTable("sales") do when no mode is set?
Not this time. The default save mode is errorifexists (also written error): if the target already exists, the write fails. append adds rows, overwrite replaces the data, and ignore is the mode that quietly does nothing when the target exists. Set the mode you mean every time.
Question 7
A column ts_ms holds event times as Unix epoch milliseconds, such as 1792700000000. Which expression gives the date as a yyyy-MM-dd string?
Not this time. from_unixtime converts a number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) to a string in the format you give, so milliseconds must be divided by 1,000 first. Passing milliseconds straight in reads them as seconds and gives a date tens of thousands of years ahead. to_date and date_format expect a date, timestamp or date string, not an epoch number.
Question 8
An orders DataFrame has several rows per order_id, one per update, with an updated_at timestamp. You need only the newest row of each order. What do you write?
Not this time. dropDuplicates keeps one row per key but does not promise which one, and sorting first does not change that, because the rows are shuffled to deduplicate them. row_number() over a window partitioned by the key and ordered newest first numbers each order's rows, so keeping number 1 gives the newest full row every time. groupBy with max returns only the key and the newest time, not the rest of the row.
Question 9
A job counts bad rows with an accumulator that a UDF increments inside a map step. After some tasks are retried, the count is higher than the number of bad rows. Why?
Not this time. Spark guarantees that each task's update to an accumulator is applied once only when the update is made inside an action, such as foreach. In a transformation, a task that is re-run, for a failure, a lost executor or a recomputed stage, adds its update again. Count in an action, or count with a filter and count() instead.
Question 10
A job writes 2,000 small files because its last DataFrame has 2,000 partitions. You want about 50 files and no extra full shuffle. What do you add before the write?
Not this time. coalesce(50) merges existing partitions through a narrow dependency, so going from 2,000 to 50 partitions needs no shuffle; each new partition takes several of the old ones. repartition(50) does the same with a full shuffle, which gives even sizes but costs more. spark.sql.shuffle.partitions sets how many partitions a shuffle makes; it does not merge the partitions you already have, and repartition(2000, ...) keeps 2,000 files.
Question 11
Adaptive Query Execution is on, as it is by default since Spark 3.2. Which change can it make while a query runs?
Not this time. AQE re-plans the query from statistics collected at runtime. Its main features are coalescing post-shuffle partitions, converting a sort-merge join to a broadcast hash join when one side turns out smaller than the adaptive broadcast threshold, and splitting skewed partitions in sort-merge joins. Adding executors is dynamic allocation, a separate feature, and AQE never rewrites UDFs or caches data.
Question 12
A stream of payment events can deliver the same event_id twice, up to 10 minutes apart. Deduplicating with dropDuplicates(["event_id"]) works, but the state grows every day. What fixes it?
Not this time. Without a watermark, Spark cannot know when a duplicate can no longer arrive, so it keeps every past event_id as state. A watermark bounds that: with dropDuplicatesWithinWatermark, Spark drops duplicates within the watermark's delay and clears older state. Complete mode, a trigger interval and caching do not limit deduplication state.
Question 13
A streaming query counts events per 5-minute window with a 10-minute watermark and writes Parquet files to a folder. Which output mode does it use?
Not this time. The file sink supports only append mode. With an event-time aggregation and a watermark, append mode writes each window once, when the watermark has passed its end and the count can no longer change. Complete and update modes rewrite results, which files written once cannot do.
Question 14
An application moves to Spark Connect. Which part of its code has to change?
Not this time. Spark Connect separates the client from the Spark driver: the client sends DataFrame operations to the server as unresolved logical plans over gRPC. Because the client is not in the driver's process, it has no SparkContext and does not support the RDD API, so code that uses them has to be rewritten with DataFrames. DataFrame code, SQL and Structured Streaming work over Spark Connect.
Question 15
A row-at-a-time Python UDF that converts prices with a formula is the slowest step of a job. What should you use instead, if no built-in function does it?
Not this time. A pandas UDF is run by Spark with Apache Arrow moving the data and pandas working on whole batches of a column, which is much faster than calling Python once per row. toPandas() loads every row into the driver's memory, which fails or crawls on large data. Calling the same UDF from SQL changes nothing, and more memory does not remove the per-row cost.
Sources
Where each fact comes from
- 1Databricks Certified Associate Developer for Apache Spark exam guide
- 2Databricks Certified Associate Developer for Apache Spark
- 3Badge and Certification FAQ
- 4pyspark.sql.DataFrame.cache
- 5Generic Load/Save Functions
- 6Getting Started: global temporary view
- 7pyspark.sql.functions.from_unixtime
- 8pyspark.sql.DataFrame.dropDuplicates
- 9RDD Programming Guide: accumulators
- 10pyspark.sql.DataFrame.coalesce
- 11Performance Tuning: Adaptive Query Execution
- 12Structured Streaming: APIs on DataFrames and Datasets
- 13Spark Connect Overview
- 14pyspark.sql.functions.pandas_udf
- 15pyspark.sql.DataFrame.toPandas
How to study for it, domain by domain
Study the domains in order of weight: the larger the share, the more questions it sets. Each one links to our own free pages that teach it.
30%
Developing Apache Spark DataFrame/DataSet API Applications
- ReferencePySpark cheat sheet
- CourseData engineering course, Module 2: PySpark DataFrames, Read files with a schema
- CourseData engineering course, Module 2: PySpark DataFrames, Keep the newest row
- ArticlePySpark Joins: Broadcast, Sort-Merge and Shuffled Hash, and How Spark Chooses
- ArticleSpark VARIANT vs JSON Strings: A Benchmark on 2 Million Events
20%
Apache Spark Architecture and Components
20%
Using Spark SQL
10%
Troubleshooting and Tuning Apache Spark DataFrame API Applications
10%
Structured Streaming
5%
Using Spark Connect to Deploy Applications
5%
Using Pandas API on Spark
Questions
- How many questions are on the Databricks Apache Spark Developer Associate exam?
- 45 scored multiple-choice questions in 90 minutes, and up to 10 unscored ones, so you may see up to 55. The time limit already allows for the unscored questions.
- Is the Databricks Spark Developer exam in Python or Scala?
- Python. The exam guide says that someone who passes can complete basic Spark DataFrame tasks using Python, and its sample questions are PySpark.
- What is the passing score for the Databricks Spark Developer Associate exam?
- Databricks does not publish one. Its certification FAQ says the passing score is set by statistical analysis and may change, so prepare for every section rather than aim for a percentage.
- What changed in the October 2026 Spark Developer exam?
- The version live since 8 October 2026 keeps 7 sections and adds objectives on broadcast variables and accumulators, UDFs with stateful operators, streaming deduplication with and without a watermark, and driver and executor logs. Spark Connect and the pandas API on Spark are 5% each.
- How much does the Databricks Spark Developer certification cost, and does it expire?
- $200 plus tax for each attempt, and it is valid for 2 years. To renew it, you pass the exam version that is live at the time.
- Do I need Databricks to prepare for the Spark Developer exam?
- No. Everything on it is Apache Spark, so a local PySpark install is enough to practise. Databricks Free Edition also works, and the guide suggests practice tasks small enough for it.