Question 277 of 503
Design and implement database schemasmediumMultiple SelectObjective-mapped

Quick Answer

The answer is to create an interleaved table for product variants under the product table and to colocate product data by category in the primary key. This works because Cloud Spanner stores rows in sorted order by primary key, so leading with category enables efficient range scans on category and price without cross-node fan-out, while interleaving variants ensures they are physically stored with their parent row for zero-latency joins. On the Google Professional Cloud Database Engineer exam, this tests your understanding of how primary key design directly impacts distributed query performance and strong consistency at global scale—a common trap is to over-index or normalize instead of leveraging colocation. Remember the memory tip: “Lead with your filter, nest your children” to recall that the primary key prefix should match your most common query filter, and interleaving is for child tables always queried with the parent.

PCDE Design and implement database schemas Practice Question

This PCDE practice question tests your understanding of design and implement database schemas. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. 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 Cloud Database Engineer is designing a schema for an e-commerce application on Cloud Spanner. The application requires high read throughput for product queries by category and price range, and must support global scale with strong consistency. The team is considering primary key design and interleaved tables. Which TWO design considerations should the engineer apply? (Choose TWO.)

Clue words in this question

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

  • Clue: "primary"

    Why it matters: Asks for the main purpose or function, not a secondary benefit. Eliminate answers that describe side-effects or partial functions.

Question 1mediummulti select
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 a primary key that starts with the category column to colocate product data for efficient queries by category.

Option D is correct because colocating product data by category in the primary key enables efficient range scans on category and price, as Cloud Spanner stores rows in sorted order by primary key. This design minimizes cross-node fan-out for queries filtering by category, directly supporting high read throughput at global scale with strong consistency.

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.

  • Define secondary indexes on price and category columns to support range queries without considering the primary key design.

    Why it's wrong here

    While secondary indexes help, primary key design is critical for avoiding hotspots and ensuring efficient data distribution.

  • Use a timestamp as the first part of the primary key to enable time-based partitioning and efficient range scans.

    Why it's wrong here

    Monotonically increasing timestamps cause hotspots on the last split, degrading write performance.

  • Define interleaved tables for all related entities, even if they are not always accessed together, to reduce joins.

    Why it's wrong here

    Interleaving unrelated tables can lead to hotspots and does not improve performance for independent queries.

  • Use a primary key that starts with the category column to colocate product data for efficient queries by category.

    Why this is correct

    Leading with category allows Spanner to distribute rows by category, improving locality for queries filtering by category.

    Clue confirmation

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

    Related concept

    Read the scenario before looking for a memorised answer.

  • Create an interleaved table for product variants under the product table, since variants are always queried with the parent product.

    Why this is correct

    Interleaving is ideal for parent-child relationships where child rows are frequently accessed with the parent.

    Clue confirmation

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

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Google Cloud often tests the misconception that secondary indexes are a universal solution for query performance, ignoring that primary key design and interleaved tables are critical for colocation and avoiding cross-node fan-out in globally distributed databases like Cloud Spanner.

Detailed technical explanation

How to think about this question

Cloud Spanner uses a distributed, strongly consistent storage system where rows are partitioned into splits based on the primary key prefix. By starting the primary key with the category column, all products in the same category are stored in the same split, allowing range scans on price to be executed locally without cross-node communication. Interleaved tables physically store child rows within the parent row's split, ensuring zero-latency joins for parent-child queries, but this colocation comes at the cost of reduced write throughput if the parent key is a hotspot.

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 company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.

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 PCDE 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 PCDE 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 PCDE question test?

Design and implement database schemas — This question tests Design and implement database schemas — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Use a primary key that starts with the category column to colocate product data for efficient queries by category. — Option D is correct because colocating product data by category in the primary key enables efficient range scans on category and price, as Cloud Spanner stores rows in sorted order by primary key. This design minimizes cross-node fan-out for queries filtering by category, directly supporting high read throughput at global scale with strong consistency.

What should I do if I get this PCDE 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: "primary". Asks for the main purpose or function, not a secondary benefit. Eliminate answers that describe side-effects or partial functions.

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 30, 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 PCDE 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 PCDE exam.