Back to Google Professional Cloud Database Engineer questions

Scenario-based practice

Refer to the Exhibit Practice Questions

Practise Google Professional Cloud Database Engineer practice questions — original exam-style scenarios covering every exam domain, with detailed explanations, wrong-answer analysis, and common exam traps.

15
scenario questions
PCDE
exam code
Google Cloud
vendor

Scenario guide

How to approach refer to the exhibit practice questions

Practise exhibit-style questions that ask you to read a topology, table, command output or diagram before choosing the best answer.

Quick answer

Exhibit-style questions test whether you can read a topology, command output, diagram or table before choosing the best answer.

How to extract the relevant detail from an exhibit.

How topology, command output or routing information affects the answer.

How to avoid answering from memory before reading the evidence.

How to map the exhibit back to the exam objective.

Related practice questions

Related PCDE topic practice pages

Scenario questions usually connect to one or more exam topics. Use these links to review the underlying concepts behind the scenario.

Practice set

Practice scenarios

Question 1easymultiple choice
Full question →

The exhibit shows IAM policy for a BigQuery dataset. The BI team reports they can query tables but cannot create views. What is the missing role?

Exhibit

Refer to the exhibit.

```json
{
  "bindings": [
    {
      "role": "roles/bigquery.dataViewer",
      "members": [
        "group:bi-team@example.com"
      ]
    },
    {
      "role": "roles/bigquery.jobUser",
      "members": [
        "group:bi-team@example.com"
      ]
    }
  ]
}
```
Question 2mediummultiple choice
Full question →

Refer to the exhibit.

Which of the following statements is true regarding this schema design?

Exhibit

CREATE TABLE Singers (
  SingerId INT64 NOT NULL,
  FirstName STRING(1024),
  LastName STRING(1024),
  SingerInfo BYTES(MAX)
) PRIMARY KEY (SingerId);

CREATE TABLE Albums (
  SingerId INT64 NOT NULL,
  AlbumId INT64 NOT NULL,
  AlbumName STRING(1024)
) PRIMARY KEY (SingerId, AlbumId),
  INTERLEAVE IN PARENT Singers ON DELETE CASCADE;
Question 3easymultiple choice
Full question →

Refer to the exhibit. You are analyzing a slow query in Cloud SQL for PostgreSQL. The execution plan shows a sequential scan. Which index should you create to most effectively improve query performance?

Network Topology
+Refer to the exhibit.```Database: mydbTable: orderscolumn | type | sizetotal | float| 8 bytesIndexes:"orders_pkey" PRIMARY KEY, btree (id)"idx_orders_user_id" btree (user_id)Query:Execution Plan:
Question 4mediummultiple choice
Full question →

The exhibit shows query metadata for a query that scans 10 GB. Given the table is 100 GB and partitioned by hire_date, why did the query scan 10 GB and not less?

Exhibit

Refer to the exhibit.

```sql
-- BigQuery query results metadata
Query statement: SELECT department, COUNT(*) as cnt
FROM `project.dataset.employees`
WHERE hire_date >= '2023-01-01'
GROUP BY department
ORDER BY cnt DESC

Query plan:
- Stage 1: Input (scan) - 10 GB processed
- Stage 2: Aggregate - 5 GB processed
- Stage 3: Sort - 0 GB processed

Table details:
- Table size: 100 GB
- Partitioned by: hire_date (daily)
- Clustered by: department
```
Question 5hardmultiple choice
Full question →

Refer to the exhibit. You restored a Spanner database from a backup and are checking the status of the optimize operation. The operation has been running for 15 minutes and is 45% complete. The database is already accessible but queries on it are slower than expected. What should you do?

Exhibit

gcloud spanner operations describe projects/my-project/instances/test-instance/databases/test-db/operations/_auto_12345

--output:
name: projects/my-project/instances/test-instance/databases/test-db/operations/_auto_12345
metadata:
  '@type': type.googleapis.com/google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata
  name: projects/my-project/instances/test-instance/databases/test-db
  progress:
    progress_percent: 45
  start_time: '2023-10-01T10:00:00Z'
  end_time: '2023-10-01T10:15:00Z'
done: false
error: null
Question 6easymultiple choice
Full question →

Refer to the exhibit. Given the table definition and two queries, which statement about query performance is correct?

Exhibit

Refer to the exhibit.

```sql
CREATE TABLE `myproject.mydataset.sales` (
  sale_id INT64,
  product_id INT64,
  quantity INT64,
  price FLOAT64,
  sale_date DATE
)
PARTITION BY sale_date
CLUSTER BY product_id
OPTIONS (
  partition_expiration_days = 90
);

-- Query 1:
SELECT product_id, SUM(quantity * price) AS total_revenue
FROM `myproject.mydataset.sales`
WHERE sale_date BETWEEN '2024-01-01' AND '2024-01-31'
  AND product_id = 12345
GROUP BY product_id;

-- Query 2:
SELECT sale_date, SUM(quantity) AS total_units
FROM `myproject.mydataset.sales`
WHERE sale_date > '2024-06-01'
GROUP BY sale_date;
```
Question 7hardmultiple choice
Full question →

A developer reports that an application cannot connect to a Cloud SQL SQL Server instance. The error log shows the message in the exhibit. The instance exists and the user credentials are correct. What is the most likely cause?

Exhibit

Refer to the exhibit.

```
Failed to create connection to Cloud SQL instance `myproject:us-central1:myinstance`.
Error: SQL Server does not exist or access denied.
```
Question 8easymultiple choice
Full question →

Refer to the exhibit. What is the effect of the partition_expiration_days option?

Exhibit

CREATE TABLE mydataset.sales
PARTITION BY DATE(order_ts)
CLUSTER BY product_id
OPTIONS(
  partition_expiration_days = 365
)
AS SELECT * FROM staging.sales
Question 9hardmultiple choice
Full question →

Refer to the exhibit. The query scans 500 GB even though it filters on the partitioning column event_date and only needs data from 30 days. What is the most likely reason?

Exhibit

Refer to the exhibit.

-- Query that scans too many bytes
SELECT event_date, COUNT(DISTINCT user_id) as users
FROM `project.dataset.events`
WHERE event_date >= '2023-01-01'
GROUP BY event_date

-- INFORMATION_SCHEMA result for table `project.dataset.events`:
Size: 500 GB
Partitioned by: event_date (DATE)
Clustered by: user_id
Question 10mediummultiple choice
Full question →

Refer to the exhibit. A BI query is performing slowly. The query plan shows a large shuffle in the aggregate stage. The table is not partitioned or clustered. Which optimization would most directly reduce the shuffle size?

Exhibit

Refer to the exhibit.
{
  "queryPlan": [
    {
      "name": "S00: Input",
      "input": "myproject.mydataset.sales",
      "read": 1000000000,
      "recordsRead": "10G"
    },
    {
      "name": "S01: Aggregate",
      "shuffleBytes": 5000000000,
      "recordsProcessed": "10G"
    }
  ],
  "totalBytesProcessed": "10GB"
}
Question 11hardmultiple choice
Full question →

A team is reviewing IAM permissions on a Cloud Storage bucket. The exhibit shows the bucket's IAM policy. A developer is using the service account sa-1 and reports that they cannot delete objects in the bucket. What is the likely reason?

Exhibit

Refer to the exhibit.

{
  "bindings": [
    {
      "role": "roles/storage.objectViewer",
      "members": [
        "serviceAccount:sa-1@project.iam.gserviceaccount.com",
        "user:admin@example.com"
      ]
    },
    {
      "role": "roles/storage.objectAdmin",
      "members": [
        "serviceAccount:sa-2@project.iam.gserviceaccount.com"
      ]
    }
  ],
  "etag": "BwXQ=="
}
Question 12hardmultiple choice
Full question →

Refer to the exhibit. A data engineer created a materialized view on a table that receives streaming inserts. When they query the materialized view, they get this error. What is the most likely cause?

Exhibit

Refer to the exhibit.
bigquery error: Query failed: Cannot query a materialized view that references a table with streaming buffer data.
Question 13easymultiple choice
Full question →

Refer to the exhibit. The company plans to store 3 TB of data in this instance. What is the minimum number of nodes required? (Assume 2 TB per node for HDD and 4 TB per node for SSD; this instance uses SSD.)

Exhibit

gcloud spanner instances describe my-instance --format=json
Output:
{"config": "regional-us-central1", "nodeCount": 1, "displayName": "my-instance"}
Question 14mediummultiple choice
Full question →

A company notices that their Cloud SQL for PostgreSQL instance, as shown in the exhibit, frequently runs out of storage, causing downtime. They have set up automated backups with point-in-time recovery. What is the most likely cause of the storage issue?

Exhibit

Refer to the exhibit.

gcloud sql instances describe my-instance
...
databaseVersion: POSTGRES_13
settings:
  activationPolicy: ALWAYS
  availabilityType: ZONAL
  backupConfiguration:
    enabled: true
    pointInTimeRecoveryEnabled: true
    startTime: '03:00'
    transactionLogRetentionDays: '7'
  dataDiskSizeGb: '100'
  dataDiskType: PD_SSD
  tier: db-custom-4-15360
...
Question 15easymultiple choice
Full question →

Refer to the exhibit. A developer deployed these Firestore security rules. What is a security concern with this configuration?

Exhibit

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read: if request.auth != null;
      allow write: if request.auth != null && request.auth.uid == resource.data.owner;
    }
  }
}

These PCDE practice questions are part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style PCDE questions with detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics.