Welcome to awslagi.com – Sharing AWS, Anthropic, Google Cloud, Microsoft Azure IT Exams. It's free for all!

Certified Associate Developer for Apache Spark

Practice questions for the Certified Associate Developer for Apache Spark certification exam.

4.8★★★★★(316 ratings)
12,438 studentsIntermediate
This course covers everything you need to pass the Certified Associate Developer for Apache Spark (CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK) exam. Each part of this course contains real exam questions taken from the actual exam pool, with hint answers to guide your study. Practice with these questions to build confidence and master the topics needed for certification success.

What you'll learn

  • Master the core concepts for CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK certification
  • Practice with real exam-style questions
  • Understand platform services and architectures covered in CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK
  • Build confidence through timed practice exams
  • Learn from detailed hint answers and explanations
  • Pass the official CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK certification exam on your first try

CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK

Lectures2
Questions89
Duration30 week
Students12,438

$20.00

Full Free Question Bank (89 Questions)

Certified Associate Developer for Apache Spark (CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK) Practice Questions & Verified Answers

Click any option to test your knowledge, or reveal the verified answer and detailed explanation below each question.

Jump to Section:
Question #1Part 1

Which of the following operations fails to return a DataFrame with no duplicate rows?

ADataFrame.dropDuplicates()
BDataFrame.distinct()
CDataFrame.drop_duplicates()
DDataFrame.drop_duplicates(subset = None)
EDataFrame.drop_duplicates(subset = "all")
Question #2Part 1

The code block shown below should create a single-column DataFrame from Python list years which is made up of integers. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: _1_._2_(_3_, _4_)

A1. spark
B1. DataFrame
C1. spark
D1. spark
E1. spark
Question #3Part 1

The code block shown below contains an error. The code block is intended to use SQL to return a new DataFrame containing column storeId and column managerName from a table created from DataFrame storesDF. Identify the error. Code block: storesDF.createOrReplaceTempView("stores") storesDF.sql("SELECT storeId, managerName FROM stores")

AThe createOrReplaceTempView() operation does not make a Dataframe accessible via SQL.
BThe sql() operation should be accessed via the spark variable rather than DataFrame
CThere is the sql() operation in DataFrame storesDF. The operation query() should be used
DThis cannot be accomplished using SQL – the DataFrame API should be used instead.
EThe createOrReplaceTempView() operation should be accessed via the spark variable rather
Question #4Part 1

The code block shown below contains an error. The code block is intended to create a Python UDF assessPerformanceUDF() using the integer-returning Python function assessPerformance() and apply it to column customerSatisfaction in DataFrame storesDF. Identify the error. Code block: assessPerformanceUDF – udf(assessPerformance) storesDF.withColumn("result", assessPerformanceUDF(col("customerSatisfaction")))

AThe assessPerformance() operation is not properly registered as a UDF.
BThe withColumn() operation is not appropriate here – UDFs should be applied by iterating
CUDFs can only be applied vie SQL and not through the DataFrame API.
DThe return type of the assessPerformanceUDF() is not specified in the udf() operation.
EThe assessPerformance() operation should be used on column customerSatisfaction rather
Question #5Part 1

The code block shown below should create and register a SQL UDF named "ASSESS_PERFORMANCE" using the Python function assessPerformance() and apply it to column customerSatisfaction in table stores. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: spark._1_._2_(_3_, _4_) spark.sql("SELECT customerSatisfaction, _5_(customerSatisfaction) AS result FROM stores")

A1. udf
B1. udf
C1. udf
D1. register
E1. udf
Question #6Part 1

Which of the following code blocks applies the function assessPerformance() to each row of DataFrame storesDF?

A[assessPerformance(row) for row in storesDF.take(3)]
B[assessPerformance() for row in storesDF]
CstoresDF.collect().apply(lambda: assessPerformance)
D[assessPerformance(row) for row in storesDF.collect()]
E[assessPerformance(row) for row in storesDF]
Question #7Part 1

Which of the following code blocks returns a new DataFrame with column storeDescription where the pattern "Description: " has been removed from the beginning of column storeDescription in DataFrame storesDF? A sample of DataFrame storesDF is below:

AstoresDF.withColumn("storeDescription", regexp_replace(col("storeDescription"),
BstoresDF.withColumn("storeDescription",
CstoresDF.withColumn("storeDescription", regexp_extract(col("storeDescription"),
DstoresDF.withColumn("storeDescription", regexp_replace("storeDescription", "^Description: ",
EstoresDF.withColumn("storeDescription", regexp_replace(col("storeDescription"),
Question #8Part 1

Which of the following code blocks returns a new DataFrame where column productCategories only has one word per row, resulting in a DataFrame with many more rows than DataFrame storesDF? A sample of storesDF is displayed below:

AstoresDF.withColumn("productCategories", explode(col("productCategories")))
BstoresDF.withColumn("productCategories", split(col("productCategories")))
CstoresDF.withColumn("productCategories", col("productCategories").explode())
DstoresDF.withColumn("productCategories", col("productCategories").split())
EstoresDF.withColumn("productCategories", explode("productCategories"))
Question #9Part 1

The code block shown below contains an error. The code block intended to create a single-column DataFrame from Scala List years which is made up of integers. Identify the error. Code block: spark.createDataset(years)

AThe years list should be wrapped in another list like List(years) to make clear that it is a
BThe data type is not specified – the second argument to createDataset should be
CThere is no operation createDataset – the createDataFrame operation should be used
DThe result of the above is a Dataset rather than a DataFrame – the toDF operation must be
EThe column name must be specified as the second argument to createDataset.
Question #10Part 1

Which of the following code blocks returns a DataFrame where column storeCategory from DataFrame storesDF is split at the underscore character into column storeValueCategory and column storeSizeCategory? A sample of DataFrame storesDF is displayed below:

A(storesDF.withColumn("storeValueCategory", split(col("storeCategory"), "_")[1])
B(storesDF.withColumn("storeValueCategory", col("storeCategory").split("_")[0])
C(storesDF.withColumn("storeValueCategory", split(col("storeCategory"), "_")[0])
D(storesDF.withColumn("storeValueCategory", split("storeCategory", "_")[0])
E(storesDF.withColumn("storeValueCategory", col("storeCategory").split("_")[1])
Question #11Part 1

The code block shown below should return a new DataFrame from DataFrame storesDF where column modality is the constant string "PHYSICAL", Assume DataFrame storesDF is the only defined language variable. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: storesDF. _1_(_2_,_3_(_4_))

A1. withColumn
B1. withColumn
C1. withColumn
D1. withColumn
E1. newColumn
Question #12Part 1

Which of the following code blocks returns a new DataFrame with a new column employeesPerSqft that is the quotient of column numberOfEmployees and column sqft, both of which are from DataFrame storesDF? Note that column employeesPerSqft is not in the original DataFrame storesDF.

AstoresDF.withColumn("employeesPerSqft", col("numberOfEmployees") / col("sqft"))
BstoresDF.withColumn("employeesPerSqft", "numberOfEmployees" / "sqft")
CstoresDF.select("employeesPerSqft", "numberOfEmployees" / "sqft")
DstoresDF.select("employeesPerSqft", col("numberOfEmployees") / col("sqft"))
EstoresDF.withColumn(col("employeesPerSqft"), col("numberOfEmployees") / col("sqft"))
Question #13Part 1

Which of the following code blocks returns a new DataFrame from DataFrame storesDF where column storeId is of the type string?

AstoresDF.withColumn("storeId, cast(col("storeId"), StringType()))
BstoresDF.withColumn("storeId, col("storeId").cast(StringType()))
CstoresDF.withColumn("storeId, cast(storeId).as(StringType)
DstoresDF.withColumn("storeId, col(storeId).cast(StringType)
EstoresDF.withColumn("storeId, cast("storeId").as(StringType()))
Question #14Part 1

Which of the following code blocks returns a DataFrame containing only the rows from DataFrame storesDF where the value in column sqft is less than or equal to 25,000 OR the value in column customerSatisfaction is greater than or equal to 30?

AstoresDF.filter(col("sqft") <= 25000 | col("customerSatisfaction") >= 30)
BstoresDF.filter(col("sqft") <= 25000 or col("customerSatisfaction") >= 30)
CstoresDF.filter(sqft <= 25000 or customerSatisfaction >= 30)
DstoresDF.filter(col(sqft) <= 25000 | col(customerSatisfaction) >= 30)
EstoresDF.filter((col("sqft") <= 25000) | (col("customerSatisfaction") >= 30))
Question #15Part 1

The code block shown below contains an error. The code block is intended to print the schema of DataFrame storesDF. Identify the error. Code block: storesDF.printSchema

AThere is no printSchema member of DataFrame – schema and the print() function should be
BThe entire line needs to be a string – it should be wrapped by str().
CThere is no printSchema member of DataFrame – the getSchema() operation should be used
DThere is no printSchema member of DataFrame – the schema() operation should be used
EThe printSchema member of DataFrame is an operation and needs to be followed by
Question #16Part 1

Which of the following code blocks fails to return a DataFrame reverse sorted alphabetically based on column division?

AstoresDF.orderBy("division", ascending – False)
BstoresDF.orderBy(["division"], ascending = [0])
CstoresDF.orderBy(col("division").asc())
DstoresDF.sort("division", ascending – False)
EstoresDF.sort(desc("division"))
Question #17Part 1

Which of the following code blocks returns a collection of summary statistics for all columns in DataFrame storesDF?

AstoresDF.summary("mean")
BstoresDF.describe(all = True)
CstoresDF.describe("all")
DstoresDF.summary("all")
EstoresDF.describe()
Question #18Part 1

Which of the following operations can be used to return the number of rows in a DataFrame?

ADataFrame.numberOfRows()
BDataFrame.n()
CDataFrame.sum()
DDataFrame.count()
EDataFrame.countDistinct()
Question #19Part 1

The code block shown contains an error. The code block is intended to return a new DataFrame where column sqft from DataFrame storesDF has had its missing values replaced with the value 30,000. Identify the error. A sample of DataFrame storesDF is displayed below: Code block: storesDF.na.fill(30000, col("sqft"))

AThe argument to the subset parameter of fill() should be a string column name or a list of
BThe na.fill() operation does not work and should be replaced by the dropna() operation.
Che argument to the subset parameter of fill() should be a the numerical position of the column
DThe na.fill() operation does not work and should be replaced by the nafill() operation.
EThe na.fill() operation does not work and should be replaced by the fillna() operation.
Question #20Part 1

Which of the following operations can be used to create a DataFrame with a subset of columns from DataFrame storesDF that are specified by name?

AstoresDF.subset()
BstoresDF.select()
CstoresDF.selectColumn()
DstoresDF.filter()
EstoresDF.drop()
Question #21Part 1

Which of the following statements about Spark’s stability is incorrect?

ASpark is designed to support the loss of any set of worker nodes.
BSpark will rerun any failed tasks due to failed worker nodes.
CSpark will recompute data cached on failed worker nodes.
DSpark will spill data to disk if it does not fit in memory.
ESpark will reassign the driver to a worker node if the driver’s node fails.
Question #22Part 1

Which of the following operations fails to return a DataFrame with no duplicate rows?

ADataFrame.dropDuplicates()
BDataFrame.distinct()
CDataFrame.drop_duplicates()
DDataFrame.drop_duplicates(subset = None)
EDataFrame.drop_duplicates(subset = "all")
Question #23Part 1

Which of the following will occur if there are more slots than there are tasks?

AThe Spark job will likely not run as efficiently as possible.
BThe Spark application will fail – there must be at least as many tasks as there are slots.
CSome executors will shut down and allocate all slots on larger executors first.
DMore tasks will be automatically generated to ensure all slots are being used.
EThe Spark job will use just one single slot to perform all tasks.
Question #24Part 1

The code block shown below should read a CSV at the file path filePath into a DataFrame with the specified schema schema. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: __1__.__2__.__3__(__4__).format("csv").__5__(__6__)

A1. spark
B1. spark
C1. spark
D1. spark
E1. spark
Question #25Part 1

The code block shown below should return a new DataFrame where column productСategories only has one word per row, resulting in a DataFrame with many more rows than DataFrame storesDF. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. A sample of storesDF is displayed below: Code block: storesDF.__1__(__2__, __3__(__4__(__5__)))

A1. newColumn
B1. withColumn
C1. withColumn
D1. newColumn
E1. withColumn
Question #26Part 1

The code block shown below contains an error. The code block is intended to create a single-column DataFrame from Python list years which is made up of integers. Identify the error. Code block: spark.createDataFrame(years, IntegerType)

AThe column name must be specified.
BThe years list should be wrapped in another list like [years] to make clear that it is a column
CThere is no createDataFrame operation in spark.
DThe IntegerType call must be followed by parentheses.
EThe IntegerType call should not be present — Spark can tell that list years is full of integers.
Question #27Part 1

The code block shown below should read a parquet at the file path filePath into a DataFrame. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: __1__.__2__.__3__(__4__)

A1.spark
B1. spark
C1. spark
D1. storesDF
E1. spark
Question #28Part 1

A Spark application has a 128 GB DataFrame A and a 1 GB DataFrame B. If a broadcast join were to be performed on these two DataFrames, which of the following describes which DataFrame should be broadcasted and why?

AEither DataFrame can be broadcasted. Their results will be identical in result and efficiency.
BDataFrame B should be broadcasted because it is smaller and will eliminate the need for the
CDataFrame A should be broadcasted because it is larger and will eliminate the need for the
DDataFrame B should be broadcasted because it is smaller and will eliminate the need for the
EDataFrame A should be broadcasted because it is smaller and will eliminate the need for the
Question #29Part 1

Which of the following describes why garbage collection in Spark is important?

ALogical results will be incorrect if inaccurate data is not collected and removed from the Spark
BSpark jobs will fail or run slowly if inaccurate data is not collected and removed from the
CSpark jobs will fail or run slowly if memory is not available for new objects to be created.
DSpark jobs will produce inaccurate results if there are too many different transformations
ESpark jobs will produce inaccurate results if memory is not available for new tasks to run and
Question #30Part 1

The code block shown below contains an error. The code block is intended to create and register a SQL UDF named “ASSESS_PERFORMANCE” using the Scala function assessPerformance() and apply it to column customerSatisfaction in the table stores. Identify the error. Code block: spark.udf.register(“ASSESS_PERFORMANCE”, assessPerforance) spark.sql(“SELECT customerSatisfaction, assessPerformance(customerSatisfaction) AS result FROM stores”)

AThe customerSatisfaction column cannot be called twice inside the SQL statement.
BRegistered UDFs cannot be applied inside of a SQL statement.
CThe order of the arguments to spark.udf.register() should be reversed.
DThe wrong SQL function is used to compute column result - it should be
EThere is no sql() operation - the DataFrame API must be used to apply the UDF
Question #31Part 1

The code block shown below contains an error. The code block is intended to return a new DataFrame where column managerName from DataFrame storesDF is split at the space character into column managerFirstName and column managerLastName. Identify the error. A sample of DataFrame storesDF is displayed below: Code block: storesDF.withColumn("managerFirstName", col("managerName").split(" ").getItem(0)) .withColumn("managerLastName", col("managerName").split(" ").getItem(1))

AThe index values of 0 and 1 are not correct – they should be 1 and 2, respectively.
BThe index values of 0 and 1 should be provided as second arguments to the split() operation
CThe split() operation comes from the imported functions object. It accepts a string column
DThe split() operation comes from the imported functions object. It accepts a Column object
EThe withColumn operation cannot be called twice in a row.
Question #32Part 1

The code block shown below should adjust the number of partitions used in wide transformations like join() to 32. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: __1__(__2__, __3__)

A1. spark.conf.get
B1. spark.conf.set
C1. spark.conf.text
D1. spark.conf.set
E1. spark.conf.set
Question #33Part 1

Which of the following operations performs a cross join on two DataFrames?

ADataFrame.join()
BThe standalone join() function
CThe standalone crossJoin() function
DDataFrame.crossJoin()
EDataFrame.merge()
Question #34Part 1

Which of the following describes the Spark driver?

AThe Spark driver is responsible for performing all execution in all execution modes – it is the
BThe Spare driver is fault tolerant – if it fails, it will recover the entire Spark application.
CThe Spark driver is the coarsest level of the Spark execution hierarchy – it is synonymous
DThe Spark driver is the program space in which the Spark application’s main method runs
EThe Spark driver is horizontally scaled to increase overall processing throughput of a Spark
Question #35Part 1

Which of the following code blocks returns a DataFrame containing a column openDateString, a string representation of Java’s SimpleDateFormat? Note that column openDate is of type integer and represents a date in the UNIX epoch format — the number of seconds since midnight on January 1st, 1970. An example of Java's SimpleDateFormat is "Sunday, Dec 4, 2008 1:05 pm". A sample of storesDF is displayed below:

AstoresDF.withColumn("openDatestring", from unixtime(col("openDate“), “EEEE, MMM d, yyyy
BstoresDF.withColumn("openDateString", from_unixtime(col("openDate“), "EEEE, MMM d,
CstoresDF.withColumn("openDateString", date(col("openDate"), "EEEE, MMM d, yyyy h:mm
DstoresDF.newColumn(col("openDateString"), from_unixtime("openDate", "EEEE, MMM d,
EstoresDF.withColumn("openDateString", date(col("openDate“), "EEEE, MMM d, yyyy h:mm
Question #36Part 1

Which of the following cluster configurations is most likely to experience delays due to garbage collection of a large Dataframe? Note: each configuration has roughly the same compute power using 100GB of RAM and 200 cores.

AMore information is needed to determine an answer.
BScenario #5
CScenario #4
DScenario #1
EScenario #2
Question #37Part 1

Which of the following code blocks returns a DataFrame containing only the rows from DataFrame storesDF where the value in column sqft is less than or equal to 25,000 AND the value in column customerSatisfaction is greater than or equal to 30?

AstoresDF.filter(col("sqft") <= 25000 and col("customerSatisfaction") >= 30)
BstoresDF.filter(col("sqft") <= 25000 or col("customerSatisfaction") >= 30)
CstoresDF.filter(sqft) <= 25000 and customerSatisfaction >= 30)
DstoresDF.filter(col("sqft") <= 25000 & col("customerSatisfaction") >= 30)
EstoresDF.filter(sqft <= 25000) & customerSatisfaction >= 30)
Question #38Part 1

The code block shown below contains an error. The code block intended to return a new DataFrame that is the result of an inner join between DataFrame storesDF and DataFrame employeesDF on column storeId. Identify the error. Code block: StoresDF.join(employeesDF, Seq("storeId")

AThe key column storeId needs to be a string like “storeId”.
BThe key column storeId needs to be specified in an expression of both Data Frame columns
CThe default argument to the joinType parameter is “inner” - an additional argument of “left”
DThere is no DataFrame.join() operation - DataFrame.merge() should be used instead.
EThe key column storeId needs to be wrapped in the col() operation.
Question #39Part 1

The code block shown below should create a single-column DataFrame from Scala list years which is made up of integers. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: __1__.__2__(__3__).__4__

A1. spark
B1. spark
C1. spark
D1. spark
Question #40Part 1

The code block shown below contains an error. The code block is intended to create the Scala UDF assessPerformanceUDF() and apply it to the integer column customers1t1sfaction in Data Frame storesDF. Identify the error. Code block:

AThe input type of customerSatisfaction is not specified in the udf() operation.
BThe return type of assessPerformanceUDF() must be specified.
CThe withColumn() operation is not appropriate here - UDFs should be applied by iterating
DThe assessPerformanceUDF() must first be defined as a Scala function and then converted
EUDFs can only be applied via SQL and not through the Data Frame API.
Question #41Part 1

The code block shown below should extract the integer value for column sqft from the first row of DataFrame storesDF. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: __1__.__2__.__3__[Int](__4__)

A1. storesDF
B1. storesDF
C1. storesDF
D1. storesDF
Question #42Part 1

Which of the following code blocks creates and registers a SQL UDF named "ASSESS_PERFORMANCE" using the Scala function assessPerformance() and applies it to column customerSatisfaction in table stores?

Aspark.udf.register("ASSESS_PERFORMANCE", assessPerformance)
Bspark.udf.register("ASSESS_PERFORMANCE", assessPerformance)
Cspark.udf.register("ASSESS_PERFORMANCE", assessPerformance)
Dspark.udf.register("ASSESS_PERFORMANCE", assessPerformance)
Espark.udf.register("ASSESS_PERFORMANCE", assessPerformance)
Question #43Part 1

Which of the following code blocks returns a DataFrame sorted alphabetically based on column division?

AstoresDF.sort("division")
BstoresDF.orderBy(desc("division"))
CstoresDF.orderBy(col("division").desc())
DstoresDF.orderBy("division", ascending - true)
EstoresDF.sort(desc("division"))
Question #44Part 1

Which of the following code blocks will most quickly return an approximation for the number of distinct values in column division in DataFrame storesDF?

AstoresDF.agg(approx_count_distinct(col("division")).alias("divisionDistinct"))
BstoresDF.agg(approx_count_distinct(col("division"), 0.01).alias("divisionDistinct"))
CstoresDF.agg(approx_count_distinct(col("division"), 0.15).alias("divisionDistinct"))
DstoresDF.agg(approx_count_distinct(col("division"), 0.0).alias("divisionDistinct"))
EstoresDF.agg(approx_count_distinct(col("division"), 0.05).alias("divisionDistinct"))
Question #45Part 1

Which of the following code blocks returns a new DataFrame where column division is the first two characters of column division in DataFrame storesDF?

AstoresDF.withColumn(“division”, substr(col(“division”), 0, 2))
BstoresDF.withColumn(“division”, susbtr(col(“division”), 1, 2))
CstoresDF,withColumn(“division”, col(“division”).substr(0, 3))
DstoresDF.withColumn(“division”, col(“division”).substr(0, 2))
EstoresDF.withColumn(“division”, col(“division”).substr(l, 2))
Question #46Part 1

Which of the following Spark properties is used to configure whether DataFrames found to be below a certain size threshold at runtime will be automatically broadcasted?

Aspark.sql.broadcastTimeout
Bspark.sql.autoBroadcastJoinThreshold
Cspark.sql.shuffle.partitions
Dspark.sql.inMemoryColumnarStorage.batchSize
Espark.sql.adaptive.localShuffleReader.enabled
Question #47Part 1

Which of the following code blocks returns a new DataFrame where column sqft from DataFrame storesDF has had its missing values replaced with the value 30,000? A sample of DataFrame storesDF is below:

AstoresDF.na.fill(30000, Seq("sqft"))
BstoresDF.nafill(30000, col("sqft"))
CstoresDF.na.fill(30000, col("sqft"))
DstoresDF.fillna(30000, col("sqft"))
EstoresDF.na.fill(30000, "sqft")
Question #48Part 1

Which of the following code blocks returns a new DataFrame that is the result of a cross join between DataFrame storesDF and DataFrame employeesDF?

AstoresDF.crossJoin(employeesDF)
BstoresDF.join(employeesDF, "storeId", "cross")
CcrossJoin(storesDF, employeesDF)
Djoin(storesDF, employeesDF, "cross")
EstoresDF.join(employeesDF, "cross")
Question #49Part 1

The code block shown below should return a new DataFrame where rows in DataFrame storesDF with missing values in every column have been dropped. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: storesDF.__1__.2__(3__ = __4__)

A1. na
B1. na
C1. na
D1. na
E1. drop
Question #50Part 1

The code block shown below should use SQL to return a new DataFrame containing column storeId and column managerName from a table created from DataFrame storesDF. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: __1__.__2__("stores") __3__.__4__("SELECT storeId, managerName FROM stores")

A1. spark
B1. spark
C1. storesDF
D1. spark
E1. storesDF
Question #51Part 1

Which of the following describes the relationship between nodes and executors?

AExecutors and nodes are not related.
BAnode is a processing engine running on an executor.
CAn executor is a processing engine running on a node.
DThere are always the same number of executors and nodes.
EThere are always more nodes than executors.
Question #52Part 1

Which of the following code blocks returns a DataFrame with column storeSlogan where single quotes in column storeSlogan in DataFrame storesDF have been replaced with double quotes? A sample of DataFrame storesDF is below:

AstoresDF.withColumn("storeSlogan", col("storeSlogan").regexp_replace("’" "\""))
BstoresDF.withColumn("storeSlogan", regexp_replace(col("storeSlogan"), "’"))
CstoresDF.withColumn("storeSlogan", regexp_replace(col("storeSlogan"), "’", "\""))
DstoresDF.withColumn("storeSlogan", regexp_replace("storeSlogan", "’", "\""))
EstoresDF.withColumn("storeSlogan", regexp_extract(col("storeSlogan"), "’", "\""))
Question #53Part 1

Which of the following code blocks returns a new DataFrame with column storeReview where the pattern "End" has been removed from the end of column storeReview in DataFrame storesDF? A sample DataFrame storesDF is below:

AstoresDF.withColumn("storeReview", col("storeReview").regexp_replace(" End$", ""))
BstoresDF.withColumn("storeReview", regexp_replace(col("storeReview"), " End$", ""))
CstoresDF.withColumn("storeReview”, regexp_replace(col("storeReview"), " End$"))
DstoresDF.withColumn("storeReview", regexp_replace("storeReview", " End$", ""))
EstoresDF.withColumn("storeReview", regexp_extract(col("storeReview"), " End$", ""))
Question #54Part 1

Which of the following code blocks returns a DataFrame where rows in DataFrame storesDF containing missing values in every column have been dropped?

AstoresDF.na.drop()
BstoresDF.dropna()
CstoresDF.na.drop("all", subset = "sqft")
DstoresDF.na.drop("all")
EstoresDF.nadrop("all")
Question #55Part 1

Which of the following pairs of arguments cannot be used in DataFrame.join() to perform an inner join on two DataFrames, named and aliased with "a" and "b" respectively, to specify two key columns column1 and column2?

AjoinExprs = col(“a.column1”) === col(“b.column1”) and col(“a.column2”) === col(“b.column2”)
BusingColumns = Seq(col(“column1”), col(“column2”))
CAll of these options can be used to perform an inner join with two key columns.
DjoinExprs = storesDF(“column1”) === employeesDF(“column1”) and storesDF(“column2”)
EusingColumns = Seq(“column1”, “column2”)
Question #56Part 1

The code block shown below should read a JSON at the file path filePath into a DataFrame with the specified schema schema. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: __1__.__2__.__3__(__4__).format("csv").__5__(__6__)

A1. spark
B1. spark
C1. spark
D1. spark
E1. spark
Question #57Part 1

Which of the following operations can perform an outer join on two DataFrames?

ADataFrame.crossJoin()
BStandalone join() function
CDataFrame.outerJoin()
DDataFrame.join()
EDataFrame.merge()
Question #58Part 1

Which of the following operations calculates the simple average of a group of values, like a column?

AsimpleAvg()
Bmean()
Cagg()
Daverage()
EapproxMean()
Question #59Part 1

Which of the following code blocks returns a DataFrame containing a column month, an integer representation of the month from column openDate from DataFrame storesDF? Note that column openDate is of type integer and represents a date in the UNIX epoch format — the number of seconds since midnight on January 1 st, 1970. A sample of storesDF is displayed below:

AstoresDF.withColumn("month", getMonth(col("openDate")))
BstoresDF.withColumn("month", substr(col("openDate"), 4, 2))
C(storesDF.withColumn("openDateFormat", col("openDate").cast("Date"))
D(storesDF.withColumn("openTimestamp", col("openDate").cast("Timestamp"))
EstoresDF.withColumn("month", month(col("openDate")))
Question #60Part 1

Which of the following operations will always return a new DataFrame with updated partitions from DataFrame storesDF by inducing a shuffle?

AstoresDF.coalesce()
BstoresDF.rdd.getNumPartitions()
CstoresDF.repartition()
DstoresDF.union()
EstoresDF.intersect()
Question #61Part 2

Which of the following code blocks attempts to cache the partitions of DataFrame storesDF only in Spark’s memory?

AstoresDF.cache(StorageLevel.MEMORY_ONLY).count()
BstoresDF.persist().count()
CstoresDF.cache().count()
DstoresDF.persist(StorageLevel.MEMORY_ONLY).count()
EstoresDF.persist("MEMORY_ONLY").count()
Question #62Part 2

The code block shown below contains an error. The code block is intended to create and register a SQL UDF named "ASSESS_PERFORMANCE" using the Python function assessPerformance() and apply it to column customerSatistfaction in table stores. Identify the error. Code block: spark.udf.register("ASSESS_PERFORMANCE", assessPerformance) spark.sql("SELECT customerSatisfaction, assessPerformance(customerSatisfaction) AS result FROM stores")

AThere is no sql() operation — the DataFrame API must be used to apply the UDF
BThe order of the arguments to spark.udf.register() should be reversed.
CThe customerSatisfaction column cannot be called twice inside the SQL statement.
DRegistered UDFs cannot be applied inside of a SQL statement.
EThe wrong SQL function is used to compute column result — it should be
Question #63Part 2

The code block shown below should print the schema of DataFrame storesDF. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: __1__.__2__(__3__)

A1. storesDF
B1. storesDF
C1. storesDF
D1. storesDF
E1. storesDF
Question #64Part 2

Which of the following operations can be used to rename and replace an existing column in a DataFrame?

ADataFrame.renamedColumn()
BDataFrame.withColumnRenamed()
CDataFrame.wlthColumn()
Dcol()
EDataFrame.newColumn()
Question #65Part 2

The code block shown below should return a DataFrame containing only the rows from DataFrame storesDF where the value in column sqft is less than or equal to 25,000 AND the value in column customerSatisfaction is greater than or equal to 30. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: storesDF.__1__(__2__ __3__ __4__)

A1. filter
B1. filter
C1. filter
D1. drop
E1. filter
Question #66Part 2

Which of the following describes executors?

AExecutors are the communication pathways from the driver node to the worker nodes.
BExecutors are the most granular level of execution in the Spark execution hierarchy.
CExecutors always have a one-to-one relationship with worker nodes.
DExecutors are synonymous with worker nodes.
EExecutors are processing engine instances for performing data computations which run on a
Question #67Part 2

The code block shown below contains an error. The code block is intended to read JSON at the file path filePath into a DataFrame with the specified schema schema. Identify the error. Code block: spark.read.schema("schema").format("json").load(filePath)

AThe schema operation from read takes a schema object rather than a string — the argument
BThere is no load() operation for DataFrameReader — it should be replaced with the json()
CThe spark.read operation should be followed by parentheses in order to return a
DThere is no read property of spark — spark should be replaced with DataFrame.
EThe schema operation from read takes a column rather than a string — the argument should
Question #68Part 2

Which of the following code blocks writes DataFrame storesDF to file path filePath as text files overwriting any existing files in that location?

AstoresDF.write(filePath, mode = "overwrite", source = "text")
BstoresDF.write.mode("overwrite").text(filePath)
CstoresDF.write.mode("overwrite").path(filePath)
DstoresDF.write.option("text", "overwrite").path(filePath)
EstoresDF.write().mode("overwrite").text(filePath)
Question #69Part 2

The code block shown below should return a new DataFrame that is the result of an inner join between DataFrame storesDF and DataFrame employeesDF on column storeId and column employeeId. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: storesDF.join(employeesDF, [__1__ == __2__, __3__ == __4__])

A1. storesDF.storeId
B1. col("storeId")
C1. storeId
D1. col("storeId")
E1. storesDF.storeId
Question #70Part 2

The code block shown below should return a new DataFrame that is the result of a position-wise union between DataFrame storesDF and DataFrame acquiredStoresDF. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: __1__.__2__(__3__)

A1. DataFrame
B1. DataFrame
C1. storesDF
D1. storesDF
E1. DataFrame
Question #71Part 2

Which of the following operations can be used to perform a left join on two DataFrames?

ADataFrame.join()
BDataFrame.crossJoin()
CDataFrame.merge()
DDataFrame.leftJoin()
EStandalone join() function
Question #72Part 2

The code block shown below should return a DataFrame containing a column openDateString, a string representation of Java’s SimpleDateFormat. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Note that column openDate is of type integer and represents a date in the UNIX epoch format — the number of seconds since midnight on January 1st, 1970. An example of Java’s SimpleDateFormat is "Sunday, Dec 4, 2008 1:05 pm". A sample of storesDF is displayed below: Code block: storesDF.__1__("openDateString", __2__(__3__, __4__))

A1. withColumn
B1. withColumn
C1. newColumn
D1. withColumn
E1. withColumn
Question #73Part 2

Which of the following code blocks creates a Python UDF assessPerformanceUDF() using the integer-returning Python function assessPerformance() and applies it to Column customerSatisfaction in DataFrame storesDF?

AassessPerformanceUDF = udf(assessPerformance, IntegerType)
BassessPerformanceUDF = udf(assessPerformance, IntegerType())
CassessPerformanceUDF - udf(assessPerformance) storesDF.withColumn("result",
DassessPerformanceUDF = udf(assessPerformance) storesDF.withColumn("result",
EassessPerformanceUDF = udf(assessPerformance, IntegerType())
Question #74Part 2

The code block shown below should return a 25 percent sample of rows from DataFrame storesDF with reproducible results. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: StoresDF.__1__(__2__ = __3__, __4__ = __5__)

A1. sample
B1. sample
C1. sample
D1. sample
E1. sample
Question #75Part 2

The code block shown below should return a new DataFrame where rows in DataFrame storesDF containing at least one missing value have been dropped. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: StoresDF.__1__.__2__(__3__ = __4__)

A1. na
B1. na
C1. na
D1. na
E1. drop
Question #76Part 2

Which of the following cluster configurations is least likely to experience delays due to garbage collection of a large DataFrame? Note: each configuration has roughly the same compute power using 100GB of RAM and 200 cores.

AScenario #4
BScenario #1
CScenario #5
DMore information is needed to determine an answer.
EScenario #6
Question #77Part 2

Which of the following operations is least likely to result in a shuffle?

ADataFrame.join()
BDataFrame.fliter()
CDataFrame.orderBy()
DDataFrame.distinct()
EDataFrame.intersect()
Question #78Part 2

Which of the following describes slots?

ASlots are the most coarse level of execution in the Spark execution hierarchy.
BSlots are resource threads that can be used for parallelization within a Spark application.
CSlots are resources that are used to run multiple Spark applications at once on a single
DSlots are the most granular level of execution in the Spark execution hierarchy.
ESlots are unique segments of data from a DataFrame that are split up by row.
Question #79Part 2

In what order should the below lines of code be run in order to read a parquet at the file path filePath into a DataFrame? Lines of code: 1. storesDF 2. .load(filePath, source = "parquet") 3. .read \ 4. spark \ 5. .read() \ 6. .parquet(filePath)

A1, 5, 2
B4, 5, 2
C4, 3, 6
D4, 5, 6
E4, 3, 2
Question #80Part 2

Which of the following code blocks returns a new DataFrame that is the result of a position-wise union between DataFrame storesDF and DataFrame acquiredStoresDF?

AstoresDF.unionByName(acquiredStoresDF)
BunionAll(storesDF, acquiredStoresDF)
Cunion(storesDF, acquiredStoresDF)
Dconcat(storesDF, acquiredStoresDF)
EstoresDF.union(acquiredStoresDF)
Question #81Part 2

Which of the following code blocks uses SQL to return a new DataFrame containing column storeId and column managerName from a table created from DataFrame storesDF?

AstoresDF.createOrReplaceTempView()
BstoresDF.query(”SELECT storeid, managerName from stores")
Cspark.createOrReplaceTempView("storesDF")
DstoresDF.createOrReplaceTempView("stores")
EstoresDF.createOrReplaceTempView("stores")
Question #82Part 2

Which of the following code blocks returns a 15 percent sample of rows from DataFrame storesDF without replacement?

AstoresDF.sample(True, fraction = 0.15)
BstoresDF.sample(fraction = 0.15)
CstoresDF.sampleBy(fraction = 0.15)
DstoresDF.sample(fraction = 0.10)
EstoresDF.sample()
Question #83Part 2

Which of the following best describes the similarities and differences between the MEMORY_ONLY storage level and the MEMORY_AND_DISK storage level?

AThe MEMORY_ONLY storage level will store as much data as possible in memory and will
BThe MEMORY_ONLY storage level will store as much data as possible in memory on two
CThe MEMORY_ONLY storage level will store as much data as possible in memory on two
DThe MEMORY_ONLY storage level will store as much data as possible in memory and will
EThe MEMORY_ONLY storage level will store as much data as possible in memory and will
Question #84Part 2

Which of the following will cause a Spark job to fail?

ANever pulling any amount of data onto the driver node.
BTrying to cache data larger than an executor's memory.
CData needing to spill from memory to disk.
DA failed worker node.
EA failed driver node.
Question #85Part 2

Spark's execution/deployment mode determines where the driver and executors are physically located when a Spark application is run. Which of the following Spark execution/deployment modes does not exist? If they all exist, please indicate so with Response E.

AClient mode
BCluster mode
CStandard mode
DLocal mode
EAll of these execution/deployment modes exist
Question #86Part 2

Which of the following identifies multiple narrow operations that are executed in sequence?

ASlot
BJob
CStage
DTask
EExecutor
Question #87Part 2

Which of the following describes a partition?

AA partition is the amount of data that fits in a single executor.
BA partition is an automatically-sized segment of data that is used to create efficient logical
CA partition is the amount of data that fits on a single worker node.
DA partition is a portion of a Spark application that is made up of similar jobs.
EA partition is a collection of rows of data that fit on a single machine in a cluster.
Question #88Part 2

Which of the following cluster configurations will induce the least network traffic during a shuffle operation? Note: each configuration has roughly the same compute power using 100GB of RAM and 200 cores.

AThis cannot be determined without knowing the number of partitions.
BScenario 5
CScenario 1
DScenario 4
EScenario 6
Question #89Part 2

Which of the following types of processes induces a stage boundary?

AShuffle
BCaching
CExecutor failure
DJob delegation
EApplication failure

📢 Unlock Full Access to Success!

"The content displayed here is a promotional preview and contains only 50% of the actual exam database. To access the complete set of updated questions, please upgrade to the Full Version."

👉 Click the button and follow the instructions to secure your full access immediately!