Courseiva

PCDE Practice Question: Design innovative, scalable, and highly available cloud database solutions

An organization is designing a Cloud Spanner schema for a social media application. The application frequently queries for all posts by a specific user, and also updates the number of likes on a post. To ensure high performance and avoid hotspots, which TWO schema design principles should the team apply? (Choose two.)

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

Interleave the Post table under the User table using UserID as the first part of the primary key

Interleaving the Post table under the User table colocates posts with their user, making queries for a user's posts efficient by reducing distributed reads. Using a UUID for the post ID ensures writes are distributed across the cluster, avoiding hotspots from sequential keys like timestamps.

Answer analysis

Option-by-option breakdown

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

  • Interleave the Post table under the User table using UserID as the first part of the primary key

    Why this is correct

    Interleaving provides data locality for user-post queries.

  • Use a secondary index on the Post table for UserID queries

    Why it's wrong here

    A secondary index is less efficient than interleaving for this pattern.

  • Denormalize the like count into the User table to avoid joins

    Why it's wrong here

    Denormalization leads to update anomalies and increased write amplification.

  • Use a monotonically increasing integer as the post ID to simplify indexing

    Why it's wrong here

    Monotonically increasing keys cause write hotspots.

  • Use a UUID as the post ID to distribute writes evenly

    Why this is correct

    UUIDs are random and spread write load across nodes.

About these practice questions

Courseiva writes every PCDE question from scratch — 1,446 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.