CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-5-QUESTIONS practice question 2 of 25
A Spark DataFrame df is cached using the MEMORY_AND_DISK storage level, but the DataFrame is too large to fit entirely in memory. What is the likely…
Choose your answer, then check it against the explanation and the full breakdown below.
Question breakdown
Key idea: MEMORY_AND_DISK keeps as many partitions in memory as fit and writes the remaining partitions to disk, reading them back when needed.
How to reach the answer
- The clue is the MEMORY_AND_DISK level combined with data that is larger than available memory.
- This level fills memory first and puts the overflow on disk; it does not keep a full duplicate copy on disk.
- Spark works at partition granularity, not individual rows, and does not split data evenly or by access frequency.
- Processing continues, but disk reads add latency, which matches option C.
Each option
Common trap: Option D sounds like a smart caching policy, but Spark persistence does not track per-row access frequency; it is a simple memory-first, overflow-to-disk scheme.
In practice: When the Storage tab in the Spark UI shows a cached DataFrame split between memory and disk, expect slower reuse. Consider a serialized storage level, more executor memory, or caching only the columns you need.
Remember: MEMORY_AND_DISK means memory first, with whole partitions overflowing to disk, so the job keeps running but more slowly.
Drafted with AI assistance and checked against the answer key.
Keep practicing
Take the free CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-5-QUESTIONS practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-5-QUESTIONS practice questions
- Question 1You have: DataFrame A: 128 GB of transactions DataFrame B: 1 GB user lookup table Which s…
- Question 344 of 55. A data engineer is working on a real-time analytics pipeline using Spark Struct…
- Question 7A developer wants to test Spark Connect with an existing Spark application. What are the …
- Question 8A data engineer is running a Spark job to process a dataset of 1 TB stored in distributed…
- Question 10A data engineer is building a Structured Streaming pipeline and wants the pipeline to rec…
- Question 11Given a DataFrame df that has 10 partitions, after running the code: result = df.coalesce…
