All Databricks exams

Databricks Certified Associate Developer for Apache Spark

What the Databricks Certified Associate Developer for Apache Spark exam covers and what it costs, with a free 30-question practice test and an explanation for every answer.

At a glance
Level
Associate
Topic areas
8
Free practice questions
30
Full question bank
112 questions

What the Databricks Certified Associate Developer for Apache Spark exam covers

The topic areas in our Databricks Certified Associate Developer for Apache Spark question bank, with each one's share of the 112 practice questions.

Databricks Certified Associate Developer for Apache Spark cost and format

CertificationDatabricks Certified Associate Developer for Apache Spark
VendorDatabricks
LevelAssociate
StatusActive

Last checked October 22, 2026 against the official Databricks exam page.

Databricks Certified Associate Developer for Apache Spark sample questions

The first 5 questions from the free practice test. Open a question to see the answer and why it is right.

All 30 free questions
  1. Question 1DataFrame and Dataset API

    Which code correctly creates a SparkSession for a PySpark application?

    1. Aspark = SparkSession.create(appName='demo').start()
    2. Bspark = SparkSession.builder.appName('demo').getOrCreate()
    3. Cspark = new SparkSession.builder().appName('demo')
    4. Dspark = SparkContext.getSession().withName('demo').build()
    Show answer and explanation
    Correct answer: B

    SparkSession.builder configures the session and getOrCreate returns an existing session or creates one, which is the standard entry point. The other options use methods that do not exist on SparkSession or are not valid Python.

  2. Question 2Spark architecture and execution

    A PySpark job reads a large Parquet dataset and calls collect() on the result. The driver runs out of memory. What is the best change?

    1. ACall cache() before collect(), so that the data is stored in executor memory and passed to the driver more efficiently
    2. BIncrease the driver memory and keep collect(), since the driver must always hold the full result set in memory
    3. CReplace collect() with write() or show(n) so that results are written out or limited instead of being pulled to the driver
    4. DRepartition the DataFrame to a single partition before collect(), so that one executor sends the full result to the driver
    Show answer and explanation
    Correct answer: C

    collect() brings every row to the driver, so large results exhaust its memory no matter how much is added. Writing the output to storage or limiting it with show(n) keeps the data on executors, while caching or repartitioning do not reduce what collect() pulls to the driver.

  3. Question 3Data sources and I/O

    Which code reads a CSV file with a header row and lets Spark infer the column types?

    1. Aspark.read.format('text').load('/data/sales.csv', header=True)
    2. Bspark.load.csv('/data/sales.csv', header=True, schema=True)
    3. Cspark.read.csv('/data/sales.csv', header=True, inferSchema=True)
    4. Dspark.read.json('/data/sales.csv', header=True, inferSchema=True)
    Show answer and explanation
    Correct answer: C

    spark.read.csv with header=True and inferSchema=True reads the header and infers types from the data. The text format does not parse columns, load.csv is not a reader method, and the json reader cannot parse CSV.

  4. Question 4Spark SQL

    Which code registers a DataFrame as a temporary view and queries it with Spark SQL?

    1. Adf.saveAsSQL('sales'); spark.query('SELECT region, SUM(amount) FROM sales GROUP BY region')
    2. Bspark.sql('sales'); df.sql('SELECT region, SUM(amount) FROM sales GROUP BY region')
    3. Cdf.createOrReplaceTempView('sales'); spark.sql('SELECT region, SUM(amount) FROM sales GROUP BY region')
    4. Ddf.registerTable('sales'); df.execute('SELECT region, SUM(amount) FROM sales GROUP BY region')
    Show answer and explanation
    Correct answer: C

    createOrReplaceTempView registers the DataFrame under a name, and spark.sql runs a SQL query against it. The other methods such as saveAsSQL, query, registerTable and execute do not exist as used.

  5. Question 5Performance and caching

    A DataFrame is reused in several actions, and its computation is expensive. Which action best reduces repeated work?

    1. ACall coalesce(1) on the DataFrame before each action, so that a single task recomputes the full dataset each time
    2. BCall persist() or cache() on the DataFrame before the first action, so that later actions reuse the stored partitions
    3. CCall collect() on the DataFrame after each transformation, so that every later step starts from a driver copy
    4. DCall repartition(1000) on the DataFrame before each action, so that more tasks share the recomputation work
    Show answer and explanation
    Correct answer: B

    cache or persist stores the computed partitions so that later actions do not recompute the lineage. Collect, coalesce(1) and high repartitioning either move data to the driver or add cost without avoiding recomputation.

How to prepare for Databricks Certified Associate Developer for Apache Spark

  1. Read the official Databricks outline first (exam page), so you know exactly what is in scope.
  2. Give the most time to DataFrame and Dataset API and Spark architecture and execution: together they make up 52% of the questions.
  3. Take the free 30-question practice test and note which topics you miss.
  4. Go back to the weak topics, then test again. A practice score shows where to study; it does not predict your exam result.

Full Databricks Certified Associate Developer for Apache Spark question bank

All 112 questions with answers and explanations, as a PDF, an online practice exam, or both.

Full question bank
Coming to the store soon

The full 112-question bank for Databricks Certified Associate Developer for Apache Spark is in final review. The free practice test is open now.

Start the free practice test

Databricks Certified Associate Developer for Apache Spark FAQ