Question 1
Which statement about predicate pushdown with Parquet is correct?
- The reader skips row groups using Parquet statistics — Correct
- Pushdown disables column pruning
- Parquet files must be fully loaded before filtering
- Pushdown only works for CSV files
Correct answer
The reader skips row groups using Parquet statistics
Explanation
Parquet stores min and max statistics per row group, allowing the reader to skip row groups that cannot match.
Question 2
A query filters a partitioned Parquet dataset with WHERE year = 2026. Which optimization reduces the data read?
- Caching the whole dataset first
- Speculative execution
- Partition pruning — Correct
- Broadcast join
Correct answer
Partition pruning
Explanation
Filters on partition columns let Spark skip directories that cannot contain matching rows.
Question 3
How can a developer change the log level of the driver to WARN to reduce output in a notebook?
- spark.stop(log='WARN')
- df.explain('WARN')
- spark.sparkContext.setLogLevel('WARN') — Correct
- spark.conf.set('log', 'WARN')
Correct answer
spark.sparkContext.setLogLevel('WARN')
Explanation
setLogLevel changes the root log level at runtime; log4j configuration files can also be customized.
Question 4
A stage spills heavily to disk during a sort. Which change is reasonable?
- Replace the sort with collect()
- Reduce executor memory
- Coalesce to 1 partition before the sort
- More shuffle partitions — Correct
Correct answer
More shuffle partitions
Explanation
Spill happens when a task's data exceeds memory; smaller partitions reduce per-task memory needs.
Question 5
A team wants Spark logs delivered to a storage location so they can be analyzed after the cluster terminates. What should be configured?
- A broadcast variable for the logs
- spark.sql.shuffle.partitions
- Caching the logs in memory
- Cluster log delivery — Correct
Correct answer
Cluster log delivery
Explanation
Cluster log delivery copies driver and executor logs to a configured location.
Question 6
Which configuration enables Adaptive Query Execution?
- spark.sql.adaptive.enabled — Correct
- spark.speculation
- spark.sql.cbo.enabled
- spark.dynamicAllocation.enabled
Correct answer
spark.sql.adaptive.enabled
Explanation
spark.sql.adaptive.enabled turns on AQE (it is on by default in recent Spark versions).
Question 7
Which statement about dynamic partition pruning is correct?
- It skips fact partitions using runtime filters from the dimension side — Correct
- It removes empty shuffle partitions
- It prunes columns not used in the query
- It deletes old partitions from storage
Correct answer
It skips fact partitions using runtime filters from the dimension side
Explanation
Dynamic partition pruning uses the join's dimension-side filter to prune partitions of the partitioned fact table.
Question 8
Which code forces a broadcast hash join of a large DataFrame big with a small DataFrame small?
- big.join(broadcast(small), 'key') — Correct
- broadcast(big).join(small, 'key')
- big.join(small.cache(), 'key')
- big.join(small, 'key').hint('shuffle')
Correct answer
big.join(broadcast(small), 'key')
Explanation
broadcast() marks the small side to be broadcast. Broadcasting the large side would be inefficient.
Question 9
A job's stage shows 1 task that takes 30 minutes while 199 tasks finish in 20 seconds. Which concept best explains this?
- Lazy evaluation of the transformations
- Caching with MEMORY_AND_DISK
- Too many executor cores
- Data skew in that task's partition — Correct
Correct answer
Data skew in that task's partition
Explanation
A straggler task with much more data than others indicates skew, often from a hot key in a join or aggregation.
Question 10
Which statement about spark.sql.autoBroadcastJoinThreshold is correct?
- Smaller tables are broadcast automatically; -1 disables it — Correct
- It controls the size of each shuffle partition
- It sets the maximum number of broadcast variables
- It is the memory reserved for caching
Correct answer
Smaller tables are broadcast automatically; -1 disables it
Explanation
The threshold (10 MB by default) governs automatic broadcast joins; -1 disables them.