Professional Data Engineer · 22% of the exam

Designing data processing systems: free practice questions

5 sample questions from our 55-question bank for this domain — answers and explanations included. These are the same scenario-based style as the real Google Cloud exam.

1. A healthcare provider is designing a schema for BigQuery to store de-identified patient lab results. Each lab result has: patient_id (hashed), test_name, result_value, result_date, and lab_location. Queries will frequently filter by test_name and result_date (across millions of rows), and occasionally join with a demographics table on patient_id. How should you design the table schema and partitioning strategy?

  • A. Partition by result_date; cluster by test_name and patient_id✓ Correct
  • B. Partition by patient_id; cluster by result_date and test_name
  • C. Partition by test_name; cluster by result_date
  • D. Use no partitioning; apply clustering on all three columns
Explanation

Option A is correct. Partitioning by result_date aligns with the most common filter pattern (queries filtering by date range, e.g., "results from the last 30 days"). Clustering by test_name and patient_id optimizes the secondary filter and join patterns. Partitioning reduces the data scanned for date-range queries (mandatory pruning), while clustering provides optional pruning for test_name. BigQuery charges by data scanned, so this strategy minimizes cost. Option B (partition by patient_id) is inefficient—patient_id has high cardinality (~millions of unique values), creating too many partitions and fragmenting data, which hurts query performance and increases metadata overhead. Option C (partition by test_name) creates too few partitions; test_name has low cardinality and doesn't reflect access patterns. Option D (no partitioning) scans the entire table for every query, increasing cost and latency—partitioning is essential for billion-row tables.

2. Your team is designing a Bigtable schema for a social media platform's user activity log that requires two access patterns: (1) retrieve all posts by a user within a date range, and (2) retrieve all posts in a specific geographic region within a date range. Currently, you're considering using user_id as the row key. What is the primary issue with this design?

  • A. User IDs are not suitable for row keys in Bigtable because they are unstructured
  • B. This row key design cannot efficiently support range queries on geography; you would need to scan all users' data to find posts in a region✓ Correct
  • C. Bigtable does not support composite range queries on multiple dimensions
  • D. Using user_id as the row key will cause hot spotting if some users are more active than others
Explanation

Option 1 is correct: Row keys in Bigtable determine data locality and query efficiency. With user_id as the row key, all posts by a user are co-located (good for access pattern 1), but to answer access pattern 2 (posts by region), you'd need to scan every user's data—a full table scan. This violates Bigtable's design principle of pushing query logic into the row key. Option 0 is incorrect: User IDs are perfectly suitable as row keys; they're just opaque identifiers. The issue isn't the data type but the access pattern coverage. Option 2 is incorrect: Bigtable does support range scans on row keys. The problem isn't the limitation of Bigtable; it's that this row key doesn't support both access patterns efficiently. A composite key like region#timestamp could handle geographic queries. Option 3 is incorrect: While hot spotting is a real Bigtable concern, it applies when certain keys are accessed disproportionately more (e.g., a celebrity user). The question doesn't indicate this, and it's not the primary design flaw for supporting two different access patterns.

3. Your company's batch data pipeline processes 10 TB of daily data using Cloud Dataproc Spark jobs, transforming and loading results into BigQuery. The jobs run for 4 hours daily and must complete before 9 AM each day. Cost is a concern. Which optimization strategy provides the best balance of cost and reliability?

  • A. Use committed use discounts (CUDs) for Dataproc VMs with auto-scaling enabled to match dynamic workload demands
  • B. Switch to BigQuery Flex Slots and Dataflow (fully managed) to eliminate Dataproc cluster management overhead
  • C. Schedule Cloud Scheduler to tear down the Dataproc cluster after the job completes; use spot VMs for worker nodes to reduce costs✓ Correct
  • D. Optimize Spark partitioning to reduce job duration to under 2 hours; maintain a persistent on-demand cluster for better reliability
Explanation

Option 2 is correct: This is the most cost-effective approach for predictable, scheduled batch jobs: - Cloud Scheduler triggers the job at a fixed time (e.g., 5 AM), allowing 4 hours for processing to complete by 9 AM. - Spot VMs cost 60-80% less than on-demand; since Dataproc jobs are fault-tolerant and re-runnable, spot VM preemption is acceptable (reschedule via Cloud Scheduler logic or Dataproc's built-in auto-recovery). - Tearing down the cluster post-job saves costs during the 20-hour idle window (no cluster running overnight). - This is ideal for predictable daily jobs. Option 0 is incorrect: CUDs require minimum 1-year commitment and upfront payment; they're best for always-on infrastructure. This job runs 4 hours/day, leaving 20 hours of unused capacity. CUDs would be wasteful. Spot VMs (option 2) are cheaper for variable workloads. Option 1 is incorrect: Dataflow is better for streaming or complex ETL workflows, not simple batch transformations. BigQuery Flex Slots are useful for variable query loads but don't replace Dataproc for Spark jobs. This would likely be more expensive and introduces unnecessary complexity. Option 3 is incorrect: While optimizing Spark partitioning is good practice, it doesn't change the fundamental cost structure. A persistent on-demand cluster incurs charges 24/7 ($X/hour × 24 hours), even when idle. Spot VMs with cluster teardown (option 2) is more cost-effective than persistent clusters.

4. A startup is evaluating whether to implement Customer-Managed Encryption Keys (CMEK) for BigQuery as part of its security posture. The company stores customer payment data and faces regulatory pressure from enterprise customers. Which statement best describes when CMEK is appropriate?

  • A. CMEK is always required for compliance (HIPAA, PCI-DSS, GDPR); implement it immediately for all tables
  • B. CMEK is appropriate when your organization (not just the customer or GCP) must control the encryption key lifecycle, and regulations explicitly require customer-managed encryption—such as some financial or healthcare frameworks✓ Correct
  • C. CMEK is unnecessary because Google's default encryption (managed keys) meets all industry compliance standards
  • D. CMEK should be implemented only for the most sensitive columns using BigQuery's column-level encryption feature
Explanation

Option B is correct and nuanced. CMEK is appropriate when organizational policy or regulation requires the data owner (your company, not Google) to control key material and rotation. Some compliance frameworks (e.g., FedRAMP, certain HIPAA interpretations, some financial regulations) require this; others (e.g., standard PCI-DSS, most GDPR implementations) accept Google-managed encryption. CMEK is a security control, not a magic compliance solution. Option A overstates the requirement—most frameworks accept Google-managed encryption; CMEK adds operational burden (key rotation, recovery) and should be adopted purposefully. Option C is incomplete; while Google-managed encryption is robust, some contracts or regulations do require customer control. Option D is incorrect; BigQuery doesn't support column-level encryption natively—CMEK applies at the table/dataset level.

5. You are designing a storage solution for a manufacturing company that collects sensor telemetry from 10,000 IoT devices. Each device sends 500 KB of data every 5 minutes, and the data must be queryable with sub-second latency for real-time dashboards. Historical data (older than 90 days) is rarely accessed. Which combination of services should you recommend?

  • A. Pub/Sub to ingest, Bigtable for real-time serving, BigQuery for cold storage with expiration✓ Correct
  • B. Cloud Storage (multi-region) for all data with Cloud Functions to query
  • C. Firestore for all real-time and historical data with eventual consistency
  • D. Dataflow streaming pipeline writing directly to BigQuery for all queries
Explanation

The correct answer is option 1. This architecture separates concerns: Pub/Sub handles the high-volume ingestion, Bigtable provides sub-second query latency for 90 days of hot data (its native use case), and BigQuery archives cold data cost-effectively. Option 2 is incorrect because Cloud Storage is not queryable with sub-second latency. Option 3 is wrong because Firestore is not designed for 500 MB/min of streaming telemetry at this scale and lacks the time-series query patterns needed. Option 4 is suboptimal because BigQuery's query latency (seconds) exceeds the sub-second requirement, and it's expensive for retaining 90 days of hot data.

50 more questions in this domain

Practice the full bank with instant grading, flashcards, and a timed mock exam.

Start practicing free