Docsity

DATABRICKS ACADEMY CERTIFICATION CERTIFIED ASSOCIATE DEVELOPER — APACHE SPARK COMPREHENS, Exams of Advanced Education

Toggle sidebar
bg1
1 | P a g e
🎓 DATABRICKS ACADEMY CERTIFICATION
CERTIFIED ASSOCIATE DEVELOPER —
APACHE SPARK COMPREHENSIVE
REVISION EXAMINATION 300 MULTIPLE
CHOICE QUESTIONS (UNBRIDGED &
CONTINUOUS)
---
Examination Details:
- Total Questions: 300
- Question Type: Multiple Choice (A, B, C, D)
- Format: Answer + Explanation + Reference immediately after each
question
- Recommended Time: 4 hours
- Passing Score: 70%
Primary Reference Materials:
1. Databricks Certified Associate Developer for Apache Spark —
Official Exam Guide
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

Download DATABRICKS ACADEMY CERTIFICATION CERTIFIED ASSOCIATE DEVELOPER — APACHE SPARK COMPREHENS and more Exams Advanced Education in PDF only on Docsity!

🎓 DATABRICKS ACADEMY CERTIFICATION

CERTIFIED ASSOCIATE DEVELOPER —

APACHE SPARK COMPREHENSIVE

REVISION EXAMINATION 300 MULTIPLE

CHOICE QUESTIONS (UNBRIDGED &

CONTINUOUS)

Examination Details:

  • Total Questions: 300
  • Question Type: Multiple Choice (A, B, C, D)
  • Format: Answer + Explanation + Reference immediately after each question
  • Recommended Time: 4 hours
  • Passing Score: 70% Primary Reference Materials:
  1. Databricks Certified Associate Developer for Apache Spark — Official Exam Guide
  1. Spark: The Definitive Guide — Bill Chambers & Matei Zaharia (O'Reilly)
  2. Learning Spark, 2nd Edition — Jules Damji et al. (O'Reilly)
  3. Databricks Documentation — docs.databricks.com
  4. Apache Spark Official Documentation — spark.apache.org/docs
  5. High Performance Spark — Holden Karau & Rachel Warren Sections Covered:
  • Section A: Spark Architecture & Internals (Q1–Q40)
  • Section B: Spark DataFrame API & Transformations (Q41–Q90)
  • Section C: Spark SQL & Catalogs (Q91–Q130)
  • Section D: RDDs & Low-Level API (Q131–Q160)
  • Section E: Structured Streaming (Q161–Q190)
  • Section F: Performance Tuning & Optimization (Q191–Q230)
  • Section G: Databricks Platform & Delta Lake (Q231–Q270)
  • Section H: Troubleshooting, Debugging & Best Practices (Q271– Q300)

SECTION A: SPARK ARCHITECTURE & INTERNALS (Q1–Q40)

A. Executes individual tasks in parallel B. Maintains the SparkContext and coordinates job execution C. Stores cached RDD partitions D. Manages the Hadoop Distributed File System ANSWER: B EXPLANATION: The Driver runs the main() function, creates the SparkSession/SparkContext, converts user programs into DAGs, schedules tasks on executors, and collects results. It does NOT execute tasks itself. REFERENCE: Learning Spark, 2nd Ed., Ch. 2, p. 31.

Q3. How many SparkContexts can be active in a single JVM at one time? A. Unlimited B. One C. Two D. Depends on executor count

ANSWER: B

EXPLANATION: Spark enforces a single active SparkContext per JVM. Attempting to create a second throws "Only one SparkContext may be active in this JVM." SparkSession wraps SparkContext and follows the same rule. REFERENCE: Apache Spark Documentation — SparkContext.

Q4. Which Spark component is responsible for building the DAG (Directed Acyclic Graph) of stages? A. Executor B. Cluster Manager C. DAG Scheduler D. Task Scheduler ANSWER: C EXPLANATION: The DAG Scheduler converts the logical execution plan into a physical plan of stages, splitting at shuffle boundaries. The Task Scheduler then launches tasks within each stage.

A. Every transformation B. A shuffle boundary C. Every action D. Caching an RDD ANSWER: B EXPLANATION: Stages are separated by shuffle operations (e.g., groupByKey, reduceByKey, join). Narrow transformations within a stage are pipelined; wide transformations require a shuffle, creating a new stage. REFERENCE: Chambers & Zaharia, Ch. 15, p. 294.

Q7. Which of the following is a NARROW transformation? A. groupByKey() B. reduceByKey() C. map() D. join() (default)

ANSWER: C

EXPLANATION: map() is narrow because each input partition contributes to exactly one output partition — no data movement across the network. groupByKey, reduceByKey, and default joins are wide. REFERENCE: Learning Spark, 2nd Ed., Ch. 2, p. 33.

Q8. How many tasks does a single stage typically have? A. One per executor B. One per partition C. One per core D. One per node ANSWER: B EXPLANATION: Spark creates one task per partition per stage. If a stage operates on an RDD with 200 partitions, it launches 200 tasks (assuming enough executor slots).

A. Driver B. Executor C. Cluster Manager D. DAG Scheduler ANSWER: B EXPLANATION: Executors are JVM processes on worker nodes that run tasks, store cached data, and report status to the Driver. Each application gets its own set of executors. REFERENCE: Chambers & Zaharia, Ch. 2, p. 29.

Q11. What happens when you call an ACTION on a DataFrame in Spark? A. Nothing until you call .collect() B. The DAG is built and execution begins C. Only the schema is computed D. Data is written to disk

ANSWER: B

EXPLANATION: Actions trigger the lazy evaluation chain. The DAG Scheduler builds the physical plan, and tasks are launched. Transformations alone do NOT trigger execution. REFERENCE: Learning Spark, 2nd Ed., Ch. 3, p. 60.

Q12. Which BEST describes Spark's lazy evaluation? A. Transformations execute immediately B. Transformations build a lineage graph; execution waits for an action C. Only actions are lazy D. DataFrames cache automatically ANSWER: B EXPLANATION: Spark records transformations as a lineage (logical plan) and waits for an action to trigger optimization (Catalyst) and physical execution. This enables whole-stage code generation and predicate pushdown.

Q14. What is the default number of partitions when reading a file with spark.read.csv() on HDFS? A. 1 B. 2 C. Determined by HDFS block size (typically one per block) D. Always 200 ANSWER: C EXPLANATION: Spark creates one partition per HDFS block (default 128 MB). A 1 GB file yields ~8 partitions. spark.sql.files.maxPartitionBytes (default 128 MB) controls this. REFERENCE: Learning Spark, 2nd Ed., Ch. 4, p. 78.

Q15. Which configuration controls the default number of shuffle partitions? A. spark.default.parallelism

B. spark.sql.shuffle.partitions C. spark.executor.cores D. spark.partition.size ANSWER: B EXPLANATION: spark.sql.shuffle.partitions defaults to 200 for DataFrame/SQL shuffles. spark.default.parallelism applies to RDD shuffles and defaults to total executor cores. REFERENCE: Databricks Documentation — Spark Configuration.

Q16. What is a "task" in Spark terminology? A. A unit of work applied to one partition of data B. A complete Spark application C. A query plan node D. A cluster resource request ANSWER: A

Q18. In client mode vs cluster mode, where does the Driver run? A. Both run on the client machine B. Client mode: on client; Cluster mode: on a worker node in the cluster C. Both run in the cluster D. Client mode: on a worker; Cluster mode: on the client ANSWER: B EXPLANATION: In client mode, the Driver runs on the machine submitting the job (outside the cluster). In cluster mode, the Driver runs inside a cluster worker node. Cluster mode is preferred for production. REFERENCE: Learning Spark, 2nd Ed., Ch. 7, p. 120.

Q19. What is the purpose of the SparkSession?

A. Replaces SparkContext and provides a unified entry point for DataFrame, SQL, and Streaming APIs B. Only manages SQL queries C. Only manages RDDs D. Replaces the Cluster Manager ANSWER: A EXPLANATION: Since Spark 2.0, SparkSession is the unified entry point wrapping SparkContext, SQLContext, and HiveContext. Use SparkSession.builder().getOrCreate(). REFERENCE: Chambers & Zaharia, Ch. 3, p. 51.

Q20. Which of these is a WIDE transformation? A. filter() B. select() C. groupByKey() D. mapPartitions()

Q22. Which file format allows Spark to read only needed columns, dramatically improving performance? A. CSV B. JSON C. Parquet D. XML ANSWER: C EXPLANATION: Parquet is columnar with built-in schema. Spark can perform column pruning and predicate pushdown, reading only required columns — huge I/O savings. REFERENCE: Learning Spark, 2nd Ed., Ch. 4, p. 82.

Q23. What is the default parallelism for RDD operations (e.g., sc.parallelize)?

A. 200

B. Number of executor cores available C. 1 D. Number of nodes × 10 ANSWER: B EXPLANATION: For RDDs, spark.default.parallelism defaults to the total number of cores across executors (or 2 in local mode). For sc.parallelize, partitions default to that value. REFERENCE: Apache Spark Documentation — Configuration.

Q24. Which statement about Broadcast Variables is TRUE? A. They are sent to executors once and cached read-only B. They are sent with every task C. They can be modified by executors D. They only work with RDDs ANSWER: A