Official Bank 0/180

Databricks Certified Associate Developer for Apache Spark 3.0 (Databricks-Certified-Associate-Developer-for-Apache-Spark-3.0) - Databricks Exam Questions

Last updated on June 20, 2026

97% Exam Compliance
180 Total Questions
1
Question
Which of the following describes a narrow transformation?
Options
A narrow transformation is an operation in which data is exchanged across partitions.
B A narrow transformation is an operation in which data is exchanged across the cluster.
C A narrow transformation is a process in which data from multiple RDDs is used.
D A narrow transformation is a process in which 32-bit float variables are cast to smaller float variables, like 16-bit or 8-bit float variables.
E A narrow transformation is an operation in which no data is exchanged across the cluster.
Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

2
Question
Which of the following code blocks returns approximately 1000 rows, some of them potentially being duplicates, from the 2000-row DataFrame transactionsDf that only has unique rows?
Options
A transactionsDf.take(1000).distinct()
B transactionsDf.sample(True, 0.5)
C transactionsDf.take(1000)
D transactionsDf.sample(False, 0.5)
E transactionsDf.sample(True, 0.5, force=True)
Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

3
Question
Which of the following code blocks returns a DataFrame where columns predError and productId are removed from DataFrame transactionsDf?

Sample of DataFrame transactionsDf:

1. +-------------+---------+-----+-------+---------+----+

2. |transactionId|predError|value|storeId|productId|f |

3. +-------------+---------+-----+-------+---------+----+

4. |1 |3 |4 |25 |1 |null|

5. |2 |6 |7 |2 |2 |null|

6. |3 |3 |null |25 |3 |null|

7. +-------------+---------+-----+-------+---------+----+
A. transactionsDf.withColumnRemoved("predError", "productId")
Options
A transactionsDf.drop(["predError", "productId", "associateId"])
B transactionsDf.drop("predError", "productId", "associateId")
C transactionsDf.dropColumns("predError", "productId", "associateId")
D transactionsDf.drop(col("predError", "productId"))
Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

4
Question
Which of the following code blocks applies the boolean-returning Python function evaluateTestSuccess to column storeId of DataFrame transactionsDf as a user-defined function?
Options
A 1. from pyspark.sql import types as T
2. evaluateTestSuccessUDF = udf(evaluateTestSuccess, T.BooleanType())
3. transactionsDf.withColumn("result", evaluateTestSuccess(col("storeId")))
B 1. from pyspark.sql import types as T
2. evaluateTestSuccessUDF = udf(evaluateTestSuccess, T.IntegerType())
3. transactionsDf.withColumn("result", evaluateTestSuccess(col("storeId")))
C 1. from pyspark.sql import types as T
2. evaluateTestSuccessUDF = udf(evaluateTestSuccess, T.BooleanType())
3. transactionsDf.withColumn("result", evaluateTestSuccessUDF(col("storeId")))
D 1. evaluateTestSuccessUDF = udf(evaluateTestSuccess)
2. transactionsDf.withColumn("result", evaluateTestSuccessUDF(storeId))
E 1. evaluateTestSuccessUDF = udf(evaluateTestSuccess)
2. transactionsDf.withColumn("result", evaluateTestSuccessUDF(col("storeId")))
Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

5
Question
In which order should the code blocks shown below be run in order to return the number of records that are not empty in column value in the DataFrame resulting from an inner join of DataFrame transactionsDf and itemsDf on columns productId and itemId, respectively?

1. .filter(~isnull(col('value')))

2. .count()

3. transactionsDf.join(itemsDf, col("transactionsDf.productId")==col("itemsDf.itemId"))

4. transactionsDf.join(itemsDf, transactionsDf.productId==itemsDf.itemId, how='inner')

5. .filter(col('value').isnotnull())

6. .sum(col('value'))
Options
A 3, 1, 6
B 4, 6
C 3, 5, 2
D 3, 1, 2
E 4, 1, 2
Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

Finish Practice?

Are you sure you want to finish? This will end your practice session.