Professional Cloud Database Engineer Free Sample Questions

19 free sample questions258 in the full practice test Other version: GCP-PCDE(207)

Try simulator

PCDBE Sample Questions

  1. Question 1

    Advanced

    Manage a solution that can span multiple database solutions · Assess auditing policies for managed services

    A financial services firm is migrating its on-premises PostgreSQL database to Google Cloud. A key regulatory requirement is that all database administrator actions must be logged, including the exact SQL text of queries executed against administrative views. You have configured Cloud Audit Logs for the Cloud SQL for PostgreSQL instance, but the CISO reports that Data Access audit logs are not capturing the full text of SELECT statements run by DBAs. Which action is required to meet this compliance mandate?

    Answer and explanation

    Correct answer: A

    Standard Cloud Audit Logs for Cloud SQL do not capture the full SQL text for data access events like SELECT queries for performance reasons. To meet the strict requirement of logging the exact SQL text for administrative queries, you must enable the pgaudit extension. This is done by setting the cloudsql.enable_pgaudit flag to on and then configuring the pgaudit.log flag to specify which classes of commands to log, such as READ for select statements.

  2. Question 2

    Advanced

    Manage a solution that can span multiple database solutions · Assess slow running queries and database locking

    A global media company uses a multi-region Cloud Spanner instance for its content metadata catalog. To optimize costs, the development team has been instructed to use stale reads (exact_staleness or max_staleness) for non-critical user-facing queries. However, they report that some stale reads are unexpectedly slow, occasionally taking almost as long as strong reads. You need to diagnose the underlying cause of this performance anomaly. What is the most likely reason for this behavior?

    Answer and explanation

    Correct answer: A

    Cloud Spanner serves stale reads from the closest replica that has data up to the requested timestamp. If the staleness bound (e.g., max_staleness of 1 second) is too aggressive, the nearest replica may not have received the data for that timestamp yet. In this case, the query must wait for the data to propagate, which can introduce latency and make the stale read perform similarly to a strong read that goes to the leader region.

  3. Question 3

    IntermediateMultiple answers

    Migrate data solutions · Develop and execute migration strategies and plans, including fallback plans

    You are designing a database migration strategy for a large retail company moving from a self-managed Oracle RAC environment on-premises to Google Cloud. The primary goals are to minimize downtime and provide a safety net for rollback if issues arise post-migration. The target database will be Cloud SQL for PostgreSQL. You will use the Database Migration Service (DMS) for the migration. Which TWO actions should you incorporate into your migration plan to meet the requirements? (Select TWO)

    Answer and explanation

    Correct answers: A, B

    A continuous migration job using Change Data Capture (CDC) is essential for minimizing downtime. It performs the initial bulk copy and then streams ongoing changes, allowing the target database to remain in sync with the source until the final cutover.

    Setting up reverse replication is a critical part of a fallback plan. After promoting the Cloud SQL instance and directing traffic to it, this reverse stream sends any new changes back to the original source database. This keeps the source 'warm' and enables a rapid rollback to the on-premises environment if a critical issue is discovered in the new Google Cloud application.

  4. Question 4

    Intermediate

    Design scalable and highly available cloud database solutions · Evaluate appropriate database solutions on Google Cloud

    A social media company is launching a new feature that generates a personalized, chronological feed of events for each user. The projected workload is extremely write-heavy, with billions of events ingested daily. The most common query pattern is retrieving the last N events for a specific user. The data must be durable, but eventual consistency is acceptable for the feed generation. The company wants a solution that offers predictable low latency for writes and scales linearly without manual sharding. Which database solution and schema design should you recommend?

    Answer and explanation

    Correct answer: A

    Cloud Bigtable is ideal for massive-scale, low-latency write workloads like this event ingestion scenario. The key to performance is the row key design. A userId prefix groups all events for a single user together. Appending a reversed timestamp (e.g., Long.MAX_VALUE - timestamp) ensures that the most recent events are stored at the beginning of the row range for that user. This makes the query for the 'last N events' a highly efficient scan of just a few rows, satisfying all requirements.

  5. Question 5

    Beginner

    Design scalable and highly available cloud database solutions · Evaluate database high availability and disaster recovery options

    True or False: When a Cloud SQL for MySQL instance is configured for high availability (HA), read requests are automatically load-balanced between the primary and standby instances to improve read throughput.

    Answer and explanation

    Correct answer: A

    This statement is false. The purpose of the standby instance in a Cloud SQL HA configuration is solely for failover. It is a 'hot standby' that takes over if the primary instance becomes unavailable. It does not serve read traffic. To scale read throughput, you must create one or more separate read replicas.

  6. Question 6

    Intermediate

    Deploy scalable and highly available databases in Google Cloud · Provision high availability database solutions in Google Cloud

    Your company runs a critical order processing system on a regional Cloud SQL for PostgreSQL instance. The business has defined a Recovery Point Objective (RPO) of zero and a Recovery Time Objective (RTO) of less than 5 minutes for regional failures. You have already configured the instance for high availability (HA). What additional step is required to meet these business requirements?

    Answer and explanation

    Correct answer: A

    The standard HA configuration for Cloud SQL protects against zonal failures, not regional failures. To meet a low RTO for a regional disaster, you must have a replica in another region. A cross-region read replica serves this purpose. While replication is asynchronous (meaning RPO is not strictly zero, but very close), it is the standard and required Cloud SQL pattern for regional DR. The promotion must be handled manually or via automation scripts, as it's not an automatic process like zonal HA failover.

  7. Question 7

    Beginner

    Manage a solution that can span multiple database solutions · Assess slow running queries and identify missing indexes

    You are a database administrator for an online retailer. During a performance audit of your Cloud SQL for MySQL database, you discover several long-running queries that are causing CPU contention. The Query Insights dashboard shows that these queries are performing full table scans on a large products table. The queries typically filter products by category and is_active status. What is the most effective and efficient way to resolve this performance issue?

    Answer and explanation

    Correct answer: A

    The problem describes queries filtering by two specific columns, which are causing full table scans. This is a classic indicator of a missing index. A composite index on the columns used in the WHERE clause (category and is_active) will allow the database to directly look up the required rows instead of scanning the entire table, which is the most direct and efficient solution.

  8. Question 8

    Intermediate

    Design scalable and highly available cloud database solutions · Design scalable, highly available, and secure databases

    A gaming company uses Firestore in Native Mode to store player profiles and inventory. They are designing a new feature that requires retrieving all players who possess a specific rare item and have a skill level greater than 90. The players collection contains millions of documents. The development team is concerned about query performance and cost. Which Firestore feature should they use to implement this query efficiently?

    Answer and explanation

    Correct answer: A

    Firestore requires an index for every query it executes. A simple query on one field will use a default single-field index. However, this query involves a range filter (skill_level > 90) and an array membership filter (inventory contains rare_item). To perform this query efficiently, Firestore requires a manually created composite index that includes both fields. Without it, the query would be rejected by the Firestore API.

  9. Question 9

    Intermediate

    Migrate data solutions · Plan and perform database migration, including fallback plans and schema conversion

    You are migrating a 10 TB on-premises MySQL 5.7 database to Cloud SQL for MySQL 8.0. The business requires the migration to have near-zero downtime. You plan to use the Database Migration Service (DMS). During the planning phase, you need to identify the correct sequence of steps to perform the migration and cutover. What is the correct order of operations?

    Answer and explanation

    Correct answer: A

    This sequence follows the Google-recommended best practices for a near-zero downtime migration with DMS. You first set up connectivity, then start the continuous job which handles the initial dump and ongoing replication. It's crucial to monitor the replication delay to ensure the target is caught up before cutover. The cutover itself involves stopping the application to prevent new writes to the old source, promoting the Cloud SQL instance to a standalone, writable server, and finally, pointing the application to the new database.

Register free for 10 more questions

Or unlock all 258 PCDBE questions with explanations, timed mode and flashcards.