Question 90 of 499
Designing data processing systemshardMultiple ChoiceObjective-mapped

Quick Answer

The answer is to use windowed streaming with a longer window duration combined with Spark's file size configuration. This approach directly addresses the small file problem in Spark streaming on Dataproc by allowing more data to accumulate in each micro-batch before writing to Cloud Storage, while Spark’s built-in settings like `spark.sql.files.maxRecordsPerFile` or the optimized output committer algorithm enforce a minimum file size, consolidating output without requiring an extra compaction job. On the Google Professional Data Engineer exam, this scenario tests your understanding of balancing latency and storage efficiency in streaming pipelines—a common trap is to reduce parallelism or add a separate batch compaction step, which either increases latency or adds operational overhead. The key insight is that Spark Streaming’s window duration directly controls how much data is written per file, so lengthening it is the simplest way to consolidate small files while keeping latency acceptable. Memory tip: “Longer window, bigger file—no compaction pile.”

PDE Designing data processing systems Practice Question

This PDE practice question tests your understanding of designing data processing systems. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A company runs a Dataproc cluster with 10 worker nodes for a Spark streaming job that processes data from Pub/Sub (via Pub/Sub Lite) and writes to Cloud Storage. They observe that the job is producing many small files in Cloud Storage, leading to high costs and performance issues in downstream batch pipelines. The team wants to consolidate output files while maintaining low latency. What is the best solution?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "best"

    Why it matters: Signals that multiple options may be partially correct. Choose the option that most directly solves the exact problem described, not the one that sounds most complete.

Question 1hardmultiple choice
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use windowed streaming with a longer window duration and Spark's file size configuration

Option B is correct because using a longer window duration in Spark Streaming allows more data to accumulate before writing, and combining this with Spark's file size configuration (e.g., `spark.sql.files.maxRecordsPerFile` or `spark.hadoop.mapreduce.fileoutputcommitter.algorithm.version=2`) ensures that output files are consolidated into larger sizes. This reduces the number of small files in Cloud Storage while maintaining low latency by avoiding an extra compaction job or reducing parallelism.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Run a separate compaction job that periodically merges small files into larger ones

    Why it's wrong here

    Adds complexity and delay; not a real-time solution.

  • Use windowed streaming with a longer window duration and Spark's file size configuration

    Why this is correct

    Allows batching data to create larger files with acceptable latency.

    Clue confirmation

    The clue word "best" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Reduce the number of workers to force more data per task

    Why it's wrong here

    Reducing workers may increase latency and does not guarantee larger files.

  • Switch from Dataproc to Dataflow, which has built-in file sharding optimization

    Why it's wrong here

    Significant architectural change; not the simplest immediate fix.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often choose a separate compaction job (Option A) because it seems like a straightforward fix, but they overlook the latency penalty and the fact that Spark's native streaming configurations can achieve the same goal without extra overhead.

Detailed technical explanation

How to think about this question

Under the hood, Spark Streaming uses micro-batches, and each micro-batch writes files per partition; by increasing the window duration, you effectively batch more data into fewer micro-batches, reducing the number of output files. The `spark.sql.files.maxRecordsPerFile` configuration limits the number of records per file, but for streaming, you can also use `spark.streaming.fileSink.partitionFile` or adjust the `spark.sql.shuffle.partitions` to control parallelism. A real-world scenario where this matters is when downstream batch pipelines (e.g., Hive or BigQuery) suffer from the 'small files problem,' causing slow metadata operations and high API costs.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A startup's cloud architect reviews their monthly bill and notices costs are higher than expected for a long-running batch job. Switching from on-demand instances to Reserved Instances — or using Spot/Preemptible VMs — can reduce compute costs by up to 72 %. Questions like this test whether you understand the tradeoffs between commitment, flexibility, and cost across cloud pricing models.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related PDE practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free PDE practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this PDE question test?

Designing data processing systems — This question tests Designing data processing systems — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Use windowed streaming with a longer window duration and Spark's file size configuration — Option B is correct because using a longer window duration in Spark Streaming allows more data to accumulate before writing, and combining this with Spark's file size configuration (e.g., `spark.sql.files.maxRecordsPerFile` or `spark.hadoop.mapreduce.fileoutputcommitter.algorithm.version=2`) ensures that output files are consolidated into larger sizes. This reduces the number of small files in Cloud Storage while maintaining low latency by avoiding an extra compaction job or reducing parallelism.

What should I do if I get this PDE question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Are there clue words in this question I should notice?

Yes — watch for: "best". Signals that multiple options may be partially correct. Choose the option that most directly solves the exact problem described, not the one that sounds most complete.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 24, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PDE exam.