Databricks Developer for Apache Spark - Python Certification Sample Questions

Developer for Apache Spark - Python Dumps, Developer for Apache Spark - Python PDF, Developer for Apache Spark - Python VCE, Databricks Certified Associate Developer for Apache Spark - Python VCE, Databricks Apache Spark Developer Associate PDFThe purpose of this Sample Question Set is to provide you with information about the Databricks Certified Associate Developer for Apache Spark - Python exam. These sample questions will make you very familiar with both the type and the difficulty level of the questions on the Developer for Apache Spark - Python certification test. To get familiar with real exam environment, we suggest you try our Sample Databricks Apache Spark Developer Associate Certification Practice Exam. This sample practice exam gives you the feeling of reality and is a clue to the questions asked in the actual Databricks Certified Associate Developer for Apache Spark certification exam.

These sample questions are simple and basic questions that represent likeness to the real Databricks Certified Associate Developer for Apache Spark - Python exam questions. To assess your readiness and performance with real-time scenario based questions, we suggest you prepare with our Premium Databricks Developer for Apache Spark - Python Certification Practice Exam. When you solve real time scenario based questions practically, you come across many difficulties that give you an opportunity to improve.

Databricks Developer for Apache Spark - Python Sample Questions:

01. A Structured Streaming query reads order events from Kafka, keeps a running count of orders per store, and writes the updated counts each micro-batch to a sink that supports idempotent writes.
After a driver failure the query is restarted, and every store's count must continue from where it stopped, with no event counted twice and none skipped.
What makes this recovery possible?
a)
Caching the streaming DataFrame, so the counts already computed stay in executor memory while the driver restarts.
b) Restarting the query with the same checkpoint location, which records the processed offsets and the running count state.
c) Using Complete output mode, so each trigger re-reads the Kafka topic from the earliest offset and recounts every store.
d) Switching to a continuous trigger, since continuous processing provides exactly-once guarantees without needing saved progress.
 
02. The code block below contains an error. It is intended to return a new DataFrame that is the result of an inner join between DataFrames storesDF and employeesDF on columns storeId and employeeId, which exist in both DataFrames.
storesDF.join(employeesDF, [col("storeId"), col("employeeId")])
Which choice identifies the error?
a)
The join() operation is a standalone function rather than a method of DataFrame; it should be called with storesDF and employeesDF as its first two arguments.
b) The col("storeId") and col("employeeId") arguments should not be separate elements of a list; they should be tested for equality with col("storeId") == col("employeeId").
c) There is no DataFrame.join() operation; DataFrame.merge() should be used instead.
d) There must be a third argument to join() because the default for the how parameter is not "inner".
e) The references to "storeId" and "employeeId" should not be inside the col() function; removing col() should result in a successful join.
 
03. DataFrame df is very large and has many more partitions than there are executors in the cluster. Each executor has one core.
Which of the following statements about this situation is NOT correct?
a)
 
Performance will be suboptimal because not all executors will be used at the same time.
b) There will be considerable overhead from scheduling and managing many small tasks.
c) Performance will be suboptimal because not all of the data can be processed at the same time.
d) Operations that cause a shuffle will involve a large number of shuffle connections.
e) There may be a risk of out-of-memory errors, depending on the size of the executors.
 
04. The code block below should return a new DataFrame with the mean of column sqft from DataFrame storesDF in column sqftMean.
storesDF.__1__(__2__(__3__).alias("sqftMean"))
Which response correctly fills in the numbered blanks to complete this task?
a)
1: withColumn, 2: mean, 3: col("sqft")
b) 1: agg, 2: average, 3: col("sqft")
c) 1: agg, 2: mean, 3: col("sqft")
d) 1: agg, 2: mean, 3: sqft
e) 1: mean, 2: col, 3: "sqft"
 
05. A Structured Streaming job reads sensor readings from Kafka. For each reading, custom Python logic normalises a device code, which no built-in function can do, and flags out-of-range values. Each reading is judged on its own, without reference to earlier readings.
Which approach meets this requirement while keeping the query scalable?
a)
Group the stream by device code and aggregate in Complete mode before applying the logic.
b) Call dropDuplicates() on the device code without a watermark before applying the logic.
c) Apply the logic with applyInPandasWithState(), keeping each device's history in the state store.
d) Apply the logic as a UDF inside withColumn(), so the query keeps no state between micro-batches.
 
06. DataFrame surveyDF has one row per survey response. Its integer column rating is null when the respondent skipped the rating question. The functions used below are imported from pyspark.sql.functions.
A report needs the number of responses that include a rating and the average of those ratings, with skipped ratings excluded from both figures.
Which code returns both figures?
a)
surveyDF.fillna(0, subset=["rating"]).agg(count("rating"), avg("rating"))
b) 
surveyDF.agg(count("rating"), sum("rating") / count("*"))
c) surveyDF.agg(count("rating"), avg("rating"))
d) surveyDF.agg(count("*"), avg("rating"))
 
07. A developer starts a SparkSession on a laptop with the master URL local[4] and runs a DataFrame job.
Where do the Spark driver and executor run?
a)
The driver is launched inside a cluster, and the laptop only submits the application.
b) Each of the four threads starts its own executor JVM alongside a separate driver JVM.
c) The driver runs on the laptop, and four executors run on worker nodes of a remote cluster.
d) The driver and executor share one JVM on the laptop, which runs up to four tasks in parallel.
 
08. Which of the following code blocks returns a DataFrame containing summary statistics only for column sqft in DataFrame storesDF?
a)
storesDF.describeColumn("sqft")
b) storesDF.summary()
c) storesDF.summary("mean")
d) 
storesDF.summary(col("sqft"))
e) storesDF.describe("sqft")
 
09. Assume col and lower are imported from pyspark.sql.functions.
Which code block returns a new DataFrame in which column storeCategory holds an all-lowercase version of column storeCategory in DataFrame storesDF?
a)
storesDF.withColumn("storeCategory", tolower(col("storeCategory")))
b) storesDF.withColumn(lower(col("storeCategory")), "storeCategory")
c) storesDF.withColumn("storeCategory", col("storeCategory").lower())
d) storesDF.withColumn("storeCategory", lower(col("storeCategory")))
e) storesDF.withColumn("storeCategory", lower(storeCategory))
 
10. DataFrame inventoryDF contains some rows in which every column is null, along with other rows in which only some columns, such as sqft, are null.
Which code fragment returns a new DataFrame that removes only the rows in which every column is null?
a)
 
inventoryDF.dropna()
b) inventoryDF.dropna(how="all")
c) inventoryDF.fillna("all")
d) inventoryDF.dropna(how="any", subset=["sqft"])

Answers:

Question: 01
Answer: b
Question: 02
Answer: e
Question: 03
Answer: a
Question: 04
Answer: c
Question: 05
Answer: d
Question: 06
Answer: c
Question: 07
Answer: d
Question: 08
Answer: e
Question: 09
Answer: d
Question: 10
Answer: b

Note: For any error in Databricks Certified Associate Developer for Apache Spark certification exam sample questions, please update us by writing an email on feedback@certfun.com.

Rating: 5 / 5 (75 votes)