Fun with Learning Technology
LearnCoursesQuestionsTracksToolsNewsExplorePractice
Fun with Learning Technology

A new problem, explained clearly, every day.

Subscribe
Learn
  • Lessons
  • Topics
  • News
  • Tools
  • Courses
  • Career tracks
  • Everything
Site
  • About
  • Contact
  • Support
  • Privacy
  • Terms
Get the daily one

One email per new problem. No spam.

Request a tutorial

Requests shape what gets made next.

Β© 2026 Fun with Learning TechnologyRSS
Homeβ€ΊGoogle Cloud (GCP)β€ΊQuiz

Google Cloud (GCP) quiz

Ten questions at a time, drawn from 100. Every answer is explained. Nothing is saved and no account is needed.

Question 1 of 10Score 0

An organization wants to deploy an application that scales automatically based on incoming web traffic and requires no server management. Which GCP service category is most appropriate?

Practice quiz for Google Cloud (GCP). Scores are not saved.

Study first?

Every question comes from a lesson in the Google Cloud (GCP) course.

Read the course β†’

Interview prep

Written questions with full answers.

Google Cloud (GCP) interview questions β†’

All Google Cloud (GCP) quiz questions and answers

  1. An organization wants to deploy an application that scales automatically based on incoming web traffic and requires no server management. Which GCP service category is most appropriate?

    • Compute Engine
    • Cloud Run
    • Google Kubernetes Engine
    • Persistent Disk

    Answer: Cloud Run. Cloud Run is a serverless platform that abstracts away infrastructure. Compute Engine requires manual management of VMs, GKE manages complex container orchestration, and Persistent Disk is a storage component, not a compute execution environment.

    From lesson: GCP Overview and Service Categories

  2. Which GCP storage service is best suited for hosting static website content that needs to be accessed globally with low latency?

    • Cloud SQL
    • Filestore
    • Cloud Storage
    • Cloud Spanner

    Answer: Cloud Storage. Cloud Storage buckets can be configured for global access and are optimized for static assets. Cloud SQL and Cloud Spanner are database services, and Filestore is for high-performance file sharing, none of which are designed for static web hosting.

    From lesson: GCP Overview and Service Categories

  3. You need to migrate an on-premises relational database that requires high availability and automated backups without managing the database engine version. What should you use?

    • Cloud SQL
    • Compute Engine with SQL installed
    • Cloud Storage
    • Dataproc

    Answer: Cloud SQL. Cloud SQL is a fully managed relational database service. Compute Engine requires you to manage the database engine, Cloud Storage is for objects, and Dataproc is for big data processing, not transactional database hosting.

    From lesson: GCP Overview and Service Categories

  4. Why would a company choose a Virtual Private Cloud (VPC) over a public-facing configuration for their internal application servers?

    • To increase the speed of the global internet
    • To provide a private, isolated network environment for security and resource grouping
    • To eliminate the need for IAM roles
    • To automatically generate database schemas

    Answer: To provide a private, isolated network environment for security and resource grouping. VPCs provide logical isolation for resources. VPCs do not affect internet speed, replace the need for IAM, or interact with database schema generation, which is a database layer task.

    From lesson: GCP Overview and Service Categories

  5. In the context of GCP resource hierarchy, what is the primary purpose of a 'Project'?

    • To define the physical location of a data center
    • To act as the foundation for creating resources, enabling APIs, and managing billing
    • To replace the need for virtual machines
    • To provide a global identity for a user

    Answer: To act as the foundation for creating resources, enabling APIs, and managing billing. Projects are the base level for resource management and billing. They do not define physical locations, replace compute resources, or serve as identity providers (which are handled by Cloud Identity/IAM).

    From lesson: GCP Overview and Service Categories

  6. An application running on a Compute Engine instance needs to read files from a Cloud Storage bucket. What is the most secure way to grant this access?

    • Create a service account, assign the 'Storage Object Viewer' role to it, and attach it to the instance.
    • Store a JSON service account key in the instance's metadata and read it from code.
    • Grant the 'Storage Object Viewer' role directly to the Compute Engine default service account.
    • Make the Cloud Storage bucket public so the instance can access it without authentication.

    Answer: Create a service account, assign the 'Storage Object Viewer' role to it, and attach it to the instance.. Attaching a custom service account is correct because it uses Workload Identity. Storing keys is insecure. Granting the default service account broad access violates least privilege. Making the bucket public is a security vulnerability.

    From lesson: IAM β€” Identity and Access Management

  7. A developer needs the ability to start and stop Compute Engine instances but should not be able to delete them. How should this be handled?

    • Grant the developer the 'Compute Admin' role.
    • Create a custom role containing only 'compute.instances.start' and 'compute.instances.stop' permissions.
    • Grant the 'Viewer' role to the developer.
    • Assign the 'Owner' role to the developer.

    Answer: Create a custom role containing only 'compute.instances.start' and 'compute.instances.stop' permissions.. Custom roles are the only way to satisfy the specific constraint of allowing stop/start without deletion. Compute Admin and Owner include delete permissions. Viewer only allows reading, not performing actions.

    From lesson: IAM β€” Identity and Access Management

  8. Which statement best describes the hierarchy of IAM policy inheritance in Google Cloud?

    • Policies defined at the resource level override policies at the project level.
    • Policies at the Organization, Folder, and Project levels are additive.
    • Policies at lower levels override policies at the Organization level.
    • Permissions are only effective if defined at the project level.

    Answer: Policies at the Organization, Folder, and Project levels are additive.. IAM policies are additive; an identity receives the union of all permissions granted at the Organization, Folder, Project, and Resource levels. They do not override each other, and they are not restricted to just the project level.

    From lesson: IAM β€” Identity and Access Management

  9. Your team needs to allow an external auditor read-only access to a specific project for one week. What is the best practice?

    • Create a shared service account and give the auditor the credentials.
    • Grant the auditor the 'Viewer' role at the project level and remove it after a week.
    • Grant the auditor the 'Owner' role to ensure they can see everything, then remove it.
    • Use a temporary 'Owner' role at the folder level.

    Answer: Grant the auditor the 'Viewer' role at the project level and remove it after a week.. Granting the 'Viewer' role provides necessary read-only access. Sharing service accounts is a security breach. Owner is excessive and violates least privilege, and folder-level access is too broad.

    From lesson: IAM β€” Identity and Access Management

  10. What happens if a user is granted the 'Storage Object Admin' role on a bucket and the 'Viewer' role on the project containing that bucket?

    • The user only has 'Viewer' permissions because the project level is higher.
    • The user only has 'Storage Object Admin' permissions because specific resource policies override general ones.
    • The user has the combined permissions of both roles.
    • The user is denied access because of conflicting role levels.

    Answer: The user has the combined permissions of both roles.. IAM permissions are additive. The user receives all permissions from both roles. There is no conflict or override mechanism; the result is the union of all granted rights.

    From lesson: IAM β€” Identity and Access Management

  11. A team needs to host a static website on GCS. Which configuration is required for the bucket to serve the site content correctly?

    • Enable the 'Static Website Hosting' property and set a default index page.
    • Add a public IAM binding of 'Storage Object Viewer' to allUsers on the bucket.
    • Both enable website hosting and grant public read access to the objects.
    • Place all files in a folder named 'public' and set the bucket to 'Public' visibility.

    Answer: Both enable website hosting and grant public read access to the objects.. To host a website, you must both configure the bucket for website hosting (to handle index/error pages) AND grant public read access to the objects, as buckets are private by default. Just enabling the property is insufficient without IAM/ACL permissions.

    From lesson: Cloud Storage (GCS) β€” Buckets and Objects

  12. You have a requirement to move data that hasn't been accessed in 90 days to a cheaper storage tier automatically. How do you implement this?

    • Write a Cloud Function to check 'last accessed' metadata and move objects.
    • Use Object Lifecycle Management policies to transition storage classes based on age.
    • Manually move the files to a different bucket with a different default storage class.
    • Use a Dataflow pipeline to read and rewrite files to a different bucket.

    Answer: Use Object Lifecycle Management policies to transition storage classes based on age.. Object Lifecycle Management is the native, serverless way to transition objects between classes. Options 1, 3, and 4 are inefficient, manual, or incur unnecessary compute costs compared to the built-in policy engine.

    From lesson: Cloud Storage (GCS) β€” Buckets and Objects

  13. What is the primary difference between a bucket's 'Uniform' vs 'Fine-grained' access control?

    • Uniform control is only for Standard storage; Fine-grained is for Archive.
    • Uniform control disables ACLs, relying entirely on IAM; Fine-grained allows individual object ACLs.
    • Fine-grained is faster for high-frequency writes than Uniform control.
    • Uniform control allows bucket-level permissions; Fine-grained allows organization-level permissions.

    Answer: Uniform control disables ACLs, relying entirely on IAM; Fine-grained allows individual object ACLs.. Uniform bucket-level access disables legacy ACLs, simplifying management through IAM. Fine-grained allows for more complex, older-style ACLs on individual objects. The others are incorrect as they conflate performance or scope with the access control mechanism.

    From lesson: Cloud Storage (GCS) β€” Buckets and Objects

  14. Your application uploads sensitive files that must be encrypted at rest, but your security team requires you to use your own encryption keys. What should you do?

    • Use Customer-Managed Encryption Keys (CMEK) via Cloud Key Management Service.
    • Upload files to a bucket that has 'External' storage enabled.
    • Encrypt files locally before uploading them to GCS.
    • Enable 'Bucket Lock' to ensure the data cannot be decrypted by anyone.

    Answer: Use Customer-Managed Encryption Keys (CMEK) via Cloud Key Management Service.. CMEK allows you to control the keys used to encrypt GCS data within GCP. While local encryption is possible, it creates overhead for data processing. Bucket Lock relates to retention, not encryption. External storage is not a standard GCS encryption feature.

    From lesson: Cloud Storage (GCS) β€” Buckets and Objects

  15. You accidentally deleted a critical object from a bucket. What is the most effective way to recover it?

    • Contact Google Cloud support to restore the bucket to a previous snapshot.
    • Use the 'Restore' feature if Object Versioning was enabled on the bucket.
    • Check the 'Trash' folder in the GCP Console under Storage.
    • Query the object's audit logs to regenerate the file content.

    Answer: Use the 'Restore' feature if Object Versioning was enabled on the bucket.. Object Versioning keeps versions of objects when deleted or overwritten. Without it, GCS does not have a 'Trash' folder or a support-level restore for individual objects. Audit logs provide metadata about the deletion, not the content of the file itself.

    From lesson: Cloud Storage (GCS) β€” Buckets and Objects

  16. An application on Compute Engine experiences inconsistent traffic. You want to ensure the Managed Instance Group (MIG) scales based on the number of requests per second rather than CPU usage. What should you do?

    • Create an autoscaling policy based on a custom metric via Cloud Monitoring
    • Enable predictive autoscaling based on historical traffic patterns
    • Switch to a target CPU utilization metric and set it to 10%
    • Use a fixed-size MIG and manually resize it based on logs

    Answer: Create an autoscaling policy based on a custom metric via Cloud Monitoring. Custom metrics via Cloud Monitoring are the correct way to handle application-specific scaling triggers like requests per second. CPU utilization (option 2) is often a poor proxy for request volume. Predictive autoscaling (option 1) forecasts demand but doesn't solve for specific metric triggers. Manual resizing (option 3) defeats the purpose of the autoscaler.

    From lesson: Compute Engine β€” VMs and Autoscaling

  17. Your Managed Instance Group is scaling up and down too frequently. Which configuration change would most effectively reduce this 'flapping' behavior?

    • Increase the cooldown period
    • Decrease the maximum number of instances
    • Switch to a preemptible VM machine type
    • Change the autoscaling metric to disk I/O

    Answer: Increase the cooldown period. The cooldown period forces the MIG to wait before taking further action, allowing newly created instances time to stabilize. Decreasing the max count (option 1) limits capacity, not stability. Preemptible VMs (option 2) actually increase volatility. Disk I/O (option 3) is unrelated to the flapping issue.

    From lesson: Compute Engine β€” VMs and Autoscaling

  18. What is the primary benefit of using a Managed Instance Group (MIG) over an Unmanaged Instance Group for production workloads?

    • MIGs automatically replace instances that crash or become unhealthy
    • MIGs allow for different machine types in the same group
    • MIGs are the only way to assign static external IP addresses
    • MIGs provide lower latency for global load balancing

    Answer: MIGs automatically replace instances that crash or become unhealthy. MIGs provide self-healing, ensuring instances stay running and healthy automatically. Option 1 is incorrect because MIGs require uniform templates. Option 2 is incorrect as unmanaged groups can also use static IPs. Option 3 is incorrect as both group types integrate with load balancers equally.

    From lesson: Compute Engine β€” VMs and Autoscaling

  19. When performing a rolling update on a MIG to change the machine image, how can you ensure that you don't lose all capacity simultaneously?

    • Set the max surge and max unavailable values in the update policy
    • Disable the health check for the duration of the update
    • Manually delete half of the instances before starting the update
    • Set the cooldown period to zero during the rollout

    Answer: Set the max surge and max unavailable values in the update policy. The update policy's 'max surge' and 'max unavailable' parameters control how many instances are created or taken down at once. Disabling health checks (option 1) risks downtime. Manual deletion (option 2) is inefficient. Cooldown (option 3) does not manage concurrent instance updates.

    From lesson: Compute Engine β€” VMs and Autoscaling

  20. You have a batch processing application that can be interrupted and resumed later. Which VM configuration provides the most cost-effective solution?

    • Spot VMs
    • N2 standard machine types with sole-tenant nodes
    • Reserved instances with a 3-year term
    • General-purpose E2 instances without autoscaling

    Answer: Spot VMs. Spot VMs are designed specifically for fault-tolerant, interruptible workloads at a significant discount. Sole-tenant nodes (option 1) and Reserved instances (option 2) are generally more expensive and geared toward predictable workloads. E2 instances (option 3) are standard VMs and lack the cost benefits of Spot.

    From lesson: Compute Engine β€” VMs and Autoscaling

  21. An application requires an environment where HTTP requests can trigger logic, but you need full control over the runtime environment, including custom binaries. Which service should you choose?

    • Cloud Functions
    • Cloud Run
    • App Engine Standard
    • Cloud SQL

    Answer: Cloud Run. Cloud Run is container-based, allowing for custom binaries and dependencies. Cloud Functions limits the runtime environment to specific supported languages. App Engine is a PaaS, and Cloud SQL is a database service.

    From lesson: Cloud Run and Cloud Functions

  22. You have a function that processes file uploads from Cloud Storage. The function sometimes takes 15 minutes to complete. What is a potential issue?

    • Cloud Functions has a maximum timeout of 60 minutes.
    • Cloud Functions has a maximum timeout of 9 minutes.
    • Cloud Run is required because Cloud Functions cannot process storage events.
    • The function is too large to deploy.

    Answer: Cloud Functions has a maximum timeout of 9 minutes.. Cloud Functions (2nd gen) has a hard timeout limit of 60 minutes, but 1st gen is limited to 9 minutes. The other options are incorrect because Cloud Functions handle storage events well, and timeout is a service limit, not a deployment size limit.

    From lesson: Cloud Run and Cloud Functions

  23. How does Cloud Run scale to zero?

    • It maintains one warm instance at all times to ensure low latency.
    • It keeps the container image running in a dormant state on a virtual machine.
    • It removes all running container instances when there are no incoming requests.
    • It transitions the request to a Cloud Function when traffic stops.

    Answer: It removes all running container instances when there are no incoming requests.. Cloud Run scales to zero by shutting down all container instances when no traffic is present, saving costs. It does not keep warm instances, nor does it switch to Cloud Functions.

    From lesson: Cloud Run and Cloud Functions

  24. Which mechanism provides the most secure way to authenticate a Cloud Run service that is internal-only?

    • Setting the ingress to 'All' and using a public IP.
    • Requiring an Authorization header with a hardcoded API key.
    • Using IAM service-to-service authentication via Identity Tokens.
    • Configuring the service to use a public load balancer without authentication.

    Answer: Using IAM service-to-service authentication via Identity Tokens.. Using Identity Tokens via IAM is the standard, secure way for Google Cloud services to communicate. API keys are less secure, and public ingress is unnecessary for internal services.

    From lesson: Cloud Run and Cloud Functions

  25. What is a primary advantage of using Cloud Functions over Cloud Run for simple event-driven tasks?

    • Cloud Functions can handle significantly more requests per second than Cloud Run.
    • Cloud Functions requires zero configuration regarding containers or images.
    • Cloud Functions is always cheaper regardless of execution time.
    • Cloud Functions allows you to run multiple containers in a single request.

    Answer: Cloud Functions requires zero configuration regarding containers or images.. Cloud Functions is a Function-as-a-Service (FaaS) model that abstracts away the container layer entirely, unlike Cloud Run which requires container management. The other options are incorrect as Cloud Run is often more cost-effective for high volume and supports more complex configurations.

    From lesson: Cloud Run and Cloud Functions

  26. Why is BigQuery's columnar storage format advantageous for analytical queries compared to row-based storage?

    • It allows for faster single-row lookups for web applications.
    • It enables the query engine to read only the specific columns needed, reducing I/O.
    • It automatically replicates data across all global regions by default.
    • It requires less storage space for index files and primary keys.

    Answer: It enables the query engine to read only the specific columns needed, reducing I/O.. Columnar storage allows BigQuery to read only the columns relevant to the query, minimizing data scanned, which is the primary cost driver. Row-based storage (Option A) is for OLTP. Option C is false as data is regional by default. Option D is incorrect because BigQuery does not use traditional indexes.

    From lesson: BigQuery β€” Architecture and Basics

  27. A data analyst is running a query over a massive table that spans several years of data. Which optimization technique will most directly reduce the cost of queries filtered by a specific time range?

    • Clustering the table by the timestamp column.
    • Creating a materialized view of the entire dataset.
    • Partitioning the table by the timestamp column.
    • Enabling long-term storage pricing on the dataset.

    Answer: Partitioning the table by the timestamp column.. Partitioning divides the table into segments (e.g., daily), allowing BigQuery to prune partitions that don't match the query filter, thus reducing bytes scanned. Clustering (Option A) improves performance but is less effective than partitioning for time-range filtering. Option B is for pre-computing results, and Option D refers to storage cost, not query cost.

    From lesson: BigQuery β€” Architecture and Basics

  28. How does the separation of compute and storage in BigQuery impact its scalability?

    • It allows users to scale compute resources independently of the volume of data stored.
    • It forces users to provision fixed clusters of virtual machines before running queries.
    • It ensures that query performance is strictly tied to the amount of data stored.
    • It requires manual intervention to balance storage nodes when data grows.

    Answer: It allows users to scale compute resources independently of the volume of data stored.. BigQuery's architecture decouples storage (managed by Colossus) from compute (Dremel), allowing users to scale compute power based on query complexity without migrating data. Option B describes older warehouse models. Option C is false because performance scales with compute slots. Option D is false because the platform handles scaling automatically.

    From lesson: BigQuery β€” Architecture and Basics

  29. When is it most appropriate to use Clustering in BigQuery?

    • When the table is small and rarely updated.
    • When queries frequently filter by multiple columns or require high-cardinality grouping.
    • When the data is primarily used for individual row inserts.
    • When you want to replace partitioning entirely.

    Answer: When queries frequently filter by multiple columns or require high-cardinality grouping.. Clustering improves query performance for filters and groupings on columns with high cardinality or when filtering by multiple columns within a partition. It is not for row-level inserts (Option C) and is usually used in conjunction with partitioning, not as a replacement (Option D).

    From lesson: BigQuery β€” Architecture and Basics

  30. You have a dashboard that runs the same query every hour on a table that is only updated once a day. How can you optimize for both cost and performance?

    • Increase the number of slots allocated to the project.
    • Use BigQuery cached results for subsequent queries.
    • Convert the table into a standard row-based database format.
    • Delete and recreate the table before every query execution.

    Answer: Use BigQuery cached results for subsequent queries.. BigQuery caches query results for 24 hours. If the underlying data has not changed, running the same query retrieves results from cache at zero cost. Option A increases cost unnecessarily. Option C is not possible in standard BigQuery. Option D would incur unnecessary processing costs.

    From lesson: BigQuery β€” Architecture and Basics

  31. A table receives data continuously throughout the day, and queries primarily filter by 'event_timestamp'. To optimize cost and performance, what is the best strategy?

    • Partition by day and cluster by event_timestamp.
    • Partition by event_timestamp (day) and cluster by frequently filtered columns.
    • Cluster by event_timestamp and partition by ingestion time.
    • Create separate tables for every hour to avoid partitioning overhead.

    Answer: Partition by event_timestamp (day) and cluster by frequently filtered columns.. Partitioning by day on the timestamp is the standard approach to enable partition pruning. Clustering then allows further narrowing of data within those partitions. Option 0 is redundant as the partition already acts as a filter. Option 2 is less efficient than native partitioning. Option 3 creates massive management overhead.

    From lesson: BigQuery β€” Partitioning, Clustering, and Optimization

  32. Which of the following scenarios best justifies the use of Clustering instead of Partitioning?

    • The data is queried based on a specific, high-cardinality ID field used for joining.
    • The data needs to be deleted or truncated using partition-level operations.
    • The table size is consistently under 1GB of data.
    • The queries always perform full table scans regardless of the column used.

    Answer: The data is queried based on a specific, high-cardinality ID field used for joining.. Clustering is designed for high-cardinality columns that are frequently used in filters or joins, allowing for efficient data block skipping. Partitioning (Option 1) is better for data lifecycle management. Option 2 does not benefit significantly from either. Option 3 is irrelevant, as clustering is ineffective if queries don't prune data.

    From lesson: BigQuery β€” Partitioning, Clustering, and Optimization

  33. If you have a query that filters by multiple columns frequently, how should you configure the clustering keys?

    • Include all columns in the clustering definition in any order.
    • Order the clustering columns by the order they appear in the SELECT statement.
    • Order the clustering columns by frequency and selectivity, placing the most used ones first.
    • Only cluster on the column with the least number of distinct values.

    Answer: Order the clustering columns by frequency and selectivity, placing the most used ones first.. The order of clustering columns matters; BigQuery sorts data based on the defined order. Placing highly selective and frequently filtered columns first maximizes the efficacy of data pruning. Option 0 ignores the significance of order. Option 1 is incorrect as query selectivity is key. Option 3 is the opposite of the best practice.

    From lesson: BigQuery β€” Partitioning, Clustering, and Optimization

  34. Why does BigQuery's automatic re-clustering happen in the background?

    • To ensure that new data inserted into the table remains optimized for performance.
    • To compress the table size to save storage costs.
    • To move data from cold storage to hot storage for faster retrieval.
    • To force the table to reach the 4,000 partition limit.

    Answer: To ensure that new data inserted into the table remains optimized for performance.. As data is streamed or modified, the 'clustering' order can become fragmented. Background re-clustering maintains the performance benefits of the original clustering configuration. Option 1 is false (compression is automatic). Option 2 is unrelated to clustering. Option 3 is incorrect as partitioning limits are a constraint, not a goal.

    From lesson: BigQuery β€” Partitioning, Clustering, and Optimization

  35. When considering the cost of queries, how do Partitioning and Clustering differ in their impact?

    • Partitioning affects storage costs, while clustering only affects compute costs.
    • Both reduce costs by only scanning data blocks that match the query filters.
    • Clustering is always more cost-effective than partitioning for large datasets.
    • Partitioning is for ingestion time, whereas clustering is for query time.

    Answer: Both reduce costs by only scanning data blocks that match the query filters.. Both techniques enable BigQuery to skip scanning irrelevant data blocks, which directly reduces the amount of data processed and thus reduces query costs. Option 0 is wrong as both primarily affect compute costs by reducing bytes processed. Option 2 depends on data structure, not just size. Option 3 is a misconception about the purpose of these features.

    From lesson: BigQuery β€” Partitioning, Clustering, and Optimization

  36. When a Dataflow job experiences 'Hot Keys' during a GroupByKey operation, what is the most effective approach to mitigate performance bottlenecks?

    • Increase the number of worker nodes to handle the imbalance
    • Use a Combine transform with pre-aggregation (like map-side combine) to reduce data volume
    • Switch to a slower machine type to ensure better CPU stability
    • Increase the pipeline's memory limit in the Dataflow settings

    Answer: Use a Combine transform with pre-aggregation (like map-side combine) to reduce data volume. Pre-aggregation reduces the amount of data shuffled, which is the primary cause of hot key latency. Increasing workers (A) doesn't solve the skew where one key is too large for a single partition. (C) and (D) do not address the fundamental logic of data distribution.

    From lesson: Dataflow β€” Apache Beam on GCP

  37. Which component of Dataflow automatically scales the number of workers based on the current workload?

    • The Dataflow Service autoscaler
    • The Pub/Sub subscription capacity
    • The Apache Beam SDK PipelineOptions
    • The BigQuery streaming buffer

    Answer: The Dataflow Service autoscaler. The Dataflow Service includes an autoscaler that dynamically adjusts worker counts. Pub/Sub (B) is an input source, the SDK (C) is for configuration, and BigQuery (D) is an output destination; none of these manage Dataflow compute resources.

    From lesson: Dataflow β€” Apache Beam on GCP

  38. Why should you use the 'setup()' method instead of the class constructor in a DoFn?

    • It improves the readability of the pipeline code
    • It forces the DoFn to run in a single-threaded environment
    • It allows for resource initialization once per worker instance rather than per element
    • It automatically optimizes the memory usage of the DoFn

    Answer: It allows for resource initialization once per worker instance rather than per element. Setup is called when a worker initializes the instance, making it perfect for expensive operations like creating database clients. Constructors (A) are inefficient, and (B) and (D) are incorrect because setup does not control concurrency or memory management.

    From lesson: Dataflow β€” Apache Beam on GCP

  39. What is the primary difference between Fixed Windows and Sliding Windows in Dataflow?

    • Fixed windows allow overlapping data segments, while sliding windows do not
    • Fixed windows are used for batch jobs, and sliding windows are for streaming jobs
    • Fixed windows create non-overlapping segments, while sliding windows create overlapping segments
    • Fixed windows are automatically handled by the system, while sliding windows require manual triggers

    Answer: Fixed windows create non-overlapping segments, while sliding windows create overlapping segments. Fixed windows (tumbling) partition data into distinct, non-overlapping intervals, while sliding windows allow for periods of overlap to analyze trends across specific time durations. (A) is the reverse, (B) is a misunderstanding, and (D) is incorrect as both are fully managed.

    From lesson: Dataflow β€” Apache Beam on GCP

  40. When building a pipeline that writes to BigQuery, which mode should be chosen to ensure Dataflow doesn't block while waiting for BigQuery streaming inserts?

    • WriteToBigQuery with default settings
    • Use Storage Write API for high-throughput streaming
    • Use a Custom IO connector to write files to GCS first
    • Disable all triggers on the PCollection

    Answer: Use Storage Write API for high-throughput streaming. The Storage Write API is designed to handle high-throughput, low-latency streaming inserts into BigQuery without the bottlenecks associated with older legacy methods. (A) is slower, (C) adds unnecessary steps, and (D) does not impact how data is written to BigQuery.

    From lesson: Dataflow β€” Apache Beam on GCP

  41. When migrating an existing Hadoop/Spark workload to Google Cloud, what is the primary benefit of choosing Dataproc over a self-managed cluster on Compute Engine?

    • It eliminates the need to pay for underlying virtual machine instances.
    • It provides managed orchestration, automated scaling, and integration with GCP monitoring tools.
    • It automatically converts all Java-based Spark jobs into native Google Cloud Functions.
    • It guarantees that all data processed is automatically encrypted with customer-managed keys by default.

    Answer: It provides managed orchestration, automated scaling, and integration with GCP monitoring tools.. Option 2 is correct because Dataproc is a managed service that handles cluster lifecycle and monitoring. Option 1 is false as you still pay for VMs. Option 3 is false as code conversion does not happen. Option 4 is false as encryption requires explicit configuration.

    From lesson: Dataproc β€” Managed Spark and Hadoop

  42. A data engineer needs to run a periodic batch process that takes 30 minutes to complete once per day. Which Dataproc cluster strategy is most cost-effective?

    • Create a persistent cluster that runs 24/7 to minimize startup latency.
    • Create a single-node cluster to reduce the number of instances running.
    • Use ephemeral clusters that are created specifically for the job and deleted immediately after completion.
    • Use a high-memory machine type and disable auto-scaling to avoid overhead.

    Answer: Use ephemeral clusters that are created specifically for the job and deleted immediately after completion.. Option 3 is the most cost-effective as you only pay for the 30 minutes of compute. Option 1 wastes money on idle time. Option 2 does not provide distributed processing. Option 4 ignores the benefit of dynamic scaling for short bursts.

    From lesson: Dataproc β€” Managed Spark and Hadoop

  43. Why is the Dataproc 'Connector for Cloud Storage' critical for modern data architectures?

    • It converts GCS buckets into HDFS-compatible file systems to allow decoupling compute and storage.
    • It allows Dataproc to run Spark jobs without needing an internet connection.
    • It forces all data to be loaded into the memory of the master node before processing.
    • It provides a faster alternative to SSD storage for local temporary shuffle data.

    Answer: It converts GCS buckets into HDFS-compatible file systems to allow decoupling compute and storage.. Option 0 is correct as it enables the use of GCS as the primary data store instead of local HDFS. Option 1 is incorrect as GCS requires network access. Option 2 is incorrect as this would crash the master. Option 3 is incorrect as it is for object storage, not local shuffle disk.

    From lesson: Dataproc β€” Managed Spark and Hadoop

  44. If a Dataproc job is failing due to 'Out of Memory' errors during a shuffle operation, what is the best first step to resolve it?

    • Increase the number of master nodes.
    • Switch the entire cluster to use preemptible instances.
    • Adjust Spark configuration properties like 'spark.executor.memory' or partition counts.
    • Change the cluster region to one closer to the data source.

    Answer: Adjust Spark configuration properties like 'spark.executor.memory' or partition counts.. Option 2 is the standard technical fix for Spark memory issues. Increasing master nodes (Option 0) does not help worker memory. Preemptible instances (Option 1) actually increase failure risk. Changing regions (Option 3) affects latency, not memory allocation.

    From lesson: Dataproc β€” Managed Spark and Hadoop

  45. Which of the following describes the purpose of using Preemptible/Spot VMs in a Dataproc cluster?

    • To ensure the cluster is never interrupted during long-running tasks.
    • To provide a permanent storage layer for critical HDFS data.
    • To reduce costs by using excess compute capacity that can be reclaimed by GCP.
    • To provide a dedicated node for the YARN ResourceManager.

    Answer: To reduce costs by using excess compute capacity that can be reclaimed by GCP.. Option 2 is the definition of Preemptible/Spot VMs. Option 0 is false as these VMs can be reclaimed. Option 1 is false as these VMs are not meant for permanent storage. Option 3 is false as they are not dedicated to the ResourceManager.

    From lesson: Dataproc β€” Managed Spark and Hadoop

  46. An application requires that messages published with the same 'user_id' are processed in the order they were published. What must be configured?

    • Set the delivery type to synchronous
    • Enable ordering keys on the topic and include the user_id
    • Use a FIFO-enabled Cloud Function trigger
    • Set the acknowledgement deadline to zero

    Answer: Enable ordering keys on the topic and include the user_id. Ordering keys are required for message sequencing within a partition. Option 0 is not a standard Pub/Sub configuration, Option 2 is not a built-in feature of Cloud Functions, and Option 3 would cause immediate redelivery, not ordering.

    From lesson: Pub/Sub β€” Event Messaging

  47. A system is experiencing high costs due to repeated message redelivery. What is the most effective way to resolve this?

    • Increase the max retention duration of the topic
    • Use push subscriptions instead of pull
    • Ensure the consumer acknowledges the message before the ack deadline expires
    • Reduce the batch size of incoming publishers

    Answer: Ensure the consumer acknowledges the message before the ack deadline expires. Redelivery happens if the consumer fails to acknowledge in time. Increasing retention (Option 0) keeps messages longer but does not solve redelivery. Push vs Pull (Option 1) doesn't change the need for acknowledgement, and batch size (Option 3) affects throughput, not the acknowledgement lifecycle.

    From lesson: Pub/Sub β€” Event Messaging

  48. When should you prefer a 'Push' subscription over a 'Pull' subscription?

    • When the subscriber is a serverless application like Cloud Run
    • When you need to control the exact flow of incoming traffic
    • When the subscriber is not accessible via a public HTTPS endpoint
    • When you require the highest possible throughput and manual batching

    Answer: When the subscriber is a serverless application like Cloud Run. Push subscriptions are ideal for webhooks and serverless endpoints. Pull is better for controlling flow (Option 1) and high throughput (Option 3). Push requires a reachable endpoint (Option 2).

    From lesson: Pub/Sub β€” Event Messaging

  49. What is the primary function of a Dead Letter Topic (DLT) in Pub/Sub?

    • To archive all messages for long-term audit purposes
    • To hold messages that have failed to be processed after multiple attempts
    • To store messages that have exceeded their 7-day retention period
    • To act as a load balancer for primary topics

    Answer: To hold messages that have failed to be processed after multiple attempts. DLTs are specifically for handling 'poison pills' or failed messages. They are not for archiving (Option 0), standard retention expiry (Option 2), or load balancing (Option 3).

    From lesson: Pub/Sub β€” Event Messaging

  50. If your application logic is idempotent, which delivery configuration provides the best performance?

    • Exactly-once delivery
    • At-least-once delivery
    • Synchronous batch delivery
    • Ordered delivery

    Answer: At-least-once delivery. At-least-once is the default and most performant. Exactly-once (Option 0) requires extra overhead, Synchronous (Option 2) isn't a performance optimization, and Ordered delivery (Option 3) limits parallelism.

    From lesson: Pub/Sub β€” Event Messaging

  51. An application requires high availability and strong consistency across multiple regions with a global footprint. Which service is the most appropriate choice?

    • Cloud SQL with Read Replicas
    • Cloud Spanner
    • Cloud SQL with Failover Replica
    • Cloud Storage with database drivers

    Answer: Cloud Spanner. Cloud Spanner provides global consistency and high availability across regions. Cloud SQL is regional; while read replicas provide global read-only access, they do not support synchronous multi-region writes or global strong consistency.

    From lesson: Cloud SQL and Cloud Spanner

  52. Why is primary key design critical in Cloud Spanner compared to traditional relational databases like Cloud SQL?

    • Cloud Spanner requires keys to be in integer format only
    • Primary keys in Spanner cannot be modified after table creation
    • Poorly designed keys can lead to write hotspots in the distributed architecture
    • Cloud SQL does not support primary keys, while Spanner does

    Answer: Poorly designed keys can lead to write hotspots in the distributed architecture. Spanner shards data across nodes based on primary keys. Sequential keys create hotspots on a single node. Cloud SQL runs on a single node, so key order does not impact distribution performance. Spanner supports various key types, and keys can be managed.

    From lesson: Cloud SQL and Cloud Spanner

  53. Your team needs to migrate an existing MySQL application to Google Cloud with minimal code changes. Which service should you choose?

    • Cloud Spanner
    • Cloud SQL for MySQL
    • BigQuery
    • Firestore

    Answer: Cloud SQL for MySQL. Cloud SQL for MySQL is a fully managed service designed to support existing MySQL applications with minimal configuration changes. Spanner uses a different SQL dialect and requires significant schema refactoring, while BigQuery and Firestore are not relational databases.

    From lesson: Cloud SQL and Cloud Spanner

  54. What is the primary benefit of using the Cloud SQL Auth Proxy when connecting to a Cloud SQL instance?

    • It automatically upgrades the database version
    • It provides secure, encrypted connections without requiring SSL certificates to be managed manually
    • It increases the storage capacity of the database automatically
    • It allows the database to be accessed without a GCP service account

    Answer: It provides secure, encrypted connections without requiring SSL certificates to be managed manually. The Cloud SQL Auth Proxy secures connections by wrapping them in an encrypted tunnel and handling IAM-based authentication, removing the complexity of managing SSL certificates. It does not handle version upgrades, storage scaling, or bypass IAM requirements.

    From lesson: Cloud SQL and Cloud Spanner

  55. A global application expects varying traffic patterns and needs to scale compute resources horizontally without downtime. Which architecture is best?

    • Cloud SQL with vertical scaling (upgrading machine type)
    • Cloud SQL with multiple read replicas in different regions
    • Cloud Spanner with node count adjustment
    • Cloud SQL on a single large instance to avoid replica latency

    Answer: Cloud Spanner with node count adjustment. Cloud Spanner allows for seamless horizontal scaling by adding nodes without downtime. Cloud SQL generally requires vertical scaling (changing instance size), which often involves a brief restart. Read replicas add read capacity but do not address write scaling or horizontal compute expansion.

    From lesson: Cloud SQL and Cloud Spanner

  56. When configuring a custom training job in Vertex AI, why is it recommended to use a Docker container rather than a direct script upload?

    • It is the only way to run Python code on Google Cloud.
    • Containers allow you to package specific dependencies and environment configurations, ensuring reproducibility.
    • Containers are required to access Cloud Storage buckets.
    • It reduces the cost of the training job by skipping the virtual machine provisioning phase.

    Answer: Containers allow you to package specific dependencies and environment configurations, ensuring reproducibility.. Option 2 is correct because containers ensure the environment is identical across runs, avoiding dependency conflicts. Option 1 is wrong because you can use pre-built containers. Option 3 is wrong because access is controlled by IAM, not packaging. Option 4 is wrong because provisioning occurs regardless of the code source.

    From lesson: Vertex AI β€” Training Pipelines

  57. What is the purpose of the AIP_MODEL_DIR environment variable in a Vertex AI training container?

    • It defines the directory where the input training dataset is located.
    • It specifies where the training logs should be exported for monitoring.
    • It points to the Cloud Storage URI where the model artifacts should be saved.
    • It serves as a path to install missing Python libraries during runtime.

    Answer: It points to the Cloud Storage URI where the model artifacts should be saved.. Option 3 is correct because Vertex AI automatically injects this path for saving model binaries. Option 1 is wrong as it is for saving, not reading data. Option 2 is wrong because logs are handled by Cloud Logging. Option 4 is wrong because dependencies should be pre-installed in the image.

    From lesson: Vertex AI β€” Training Pipelines

  58. You have a large training job that needs to run on specialized hardware. How should you scale the training infrastructure in Vertex AI?

    • Manually create a Managed Instance Group and register it with the pipeline.
    • Specify the machine type and number of replicas in the training pipeline definition.
    • Update the Python script to utilize multi-threading for CPU management.
    • Deploy the training job to an App Engine flexible environment.

    Answer: Specify the machine type and number of replicas in the training pipeline definition.. Option 2 is correct as Vertex AI abstracts infrastructure scaling via the configuration object. Option 1 is unnecessary as Vertex AI handles provisioning. Option 3 is wrong because it doesn't change the hardware. Option 4 is inappropriate as App Engine is for serving, not model training.

    From lesson: Vertex AI β€” Training Pipelines

  59. A developer wants to trigger a training pipeline based on new data arriving in a bucket. Which approach is most effective within the GCP ecosystem?

    • Write a local script that polls the bucket every hour.
    • Use a Cloud Function triggered by a Storage event to launch the Vertex AI pipeline.
    • Manually run the training pipeline through the Google Cloud Console dashboard.
    • Use a cron job on a persistent virtual machine.

    Answer: Use a Cloud Function triggered by a Storage event to launch the Vertex AI pipeline.. Option 2 is correct as it creates an event-driven serverless architecture. Option 1 is inefficient and error-prone. Option 3 lacks automation. Option 4 introduces unnecessary management overhead compared to serverless triggers.

    From lesson: Vertex AI β€” Training Pipelines

  60. Why would you choose to use a pre-built container provided by Vertex AI instead of creating a custom one?

    • Pre-built containers are the only way to enable hyperparameter tuning.
    • They offer pre-configured environments for popular machine learning frameworks like TensorFlow or Scikit-learn.
    • They automatically optimize the model's accuracy without code changes.
    • They allow for the deployment of models on-premises without an internet connection.

    Answer: They offer pre-configured environments for popular machine learning frameworks like TensorFlow or Scikit-learn.. Option 2 is correct as these containers come with optimized framework versions. Option 1 is wrong because custom containers support tuning too. Option 3 is wrong because model accuracy is code-dependent, not container-dependent. Option 4 is wrong because Vertex AI is a cloud-native managed service.

    From lesson: Vertex AI β€” Training Pipelines

  61. When updating a model on an existing Vertex AI Endpoint, what is the safest approach to ensure zero downtime?

    • Delete the existing model from the endpoint and deploy the new one immediately.
    • Create a new endpoint and point DNS to the new service.
    • Use traffic splitting to route a small percentage of requests to the new model version before shifting all traffic.
    • Update the endpoint configuration to overwrite the current model file path.

    Answer: Use traffic splitting to route a small percentage of requests to the new model version before shifting all traffic.. Traffic splitting allows for canary deployments, which is the standard for zero downtime. Deleting the model first causes downtime, creating a new endpoint is unnecessary overhead, and overwriting files is not how the Registry handles immutable versions.

    From lesson: Vertex AI β€” Model Registry and Endpoints

  62. Why is it recommended to register a model in the Vertex AI Model Registry before deploying it to an endpoint?

    • To ensure the model files are compressed automatically for faster inference.
    • To manage model lineage, versioning, and simplify the deployment workflow across environments.
    • To allow Vertex AI to automatically retrain the model when data drifts.
    • To bypass the need for containerization of the model serving logic.

    Answer: To manage model lineage, versioning, and simplify the deployment workflow across environments.. The Registry serves as a catalog that tracks versions and metadata, facilitating reproducible deployments. Compression, retraining, and skipping containerization are not the primary functions or benefits of the Registry.

    From lesson: Vertex AI β€” Model Registry and Endpoints

  63. You have a model deployed to an endpoint that is experiencing intermittent latency spikes during high traffic. What is the most cost-effective way to address this using Vertex AI features?

    • Upgrade the machine type to the most expensive GPU available.
    • Set the minimum replica count to a very high number to handle peak traffic at all times.
    • Configure auto-scaling with a specific CPU or request-per-second utilization target.
    • Disable auto-scaling and rely on manual intervention.

    Answer: Configure auto-scaling with a specific CPU or request-per-second utilization target.. Auto-scaling is designed to handle spikes efficiently by adding nodes only when necessary. Higher machine types or high minimum replicas increase base costs, and manual intervention is not scalable.

    From lesson: Vertex AI β€” Model Registry and Endpoints

  64. Which of the following scenarios is best handled by creating a new version in the Model Registry rather than just updating the existing model artifact?

    • Correcting a typo in the model's display name.
    • Re-deploying the exact same model after a temporary endpoint failure.
    • Deploying a model trained on a new dataset to compare its performance against the current production model.
    • Updating the tag for the model description.

    Answer: Deploying a model trained on a new dataset to compare its performance against the current production model.. Registry versions are intended for tracking model changes resulting from training experiments. Typos and metadata changes don't require new versions, and re-deploying the same model is unnecessary.

    From lesson: Vertex AI β€” Model Registry and Endpoints

  65. What is the primary function of a Vertex AI Endpoint?

    • To provide a managed service environment for serving predictions from models.
    • To act as a storage bucket for training datasets.
    • To automatically generate feature engineering pipelines for raw data.
    • To execute distributed hyperparameter tuning jobs.

    Answer: To provide a managed service environment for serving predictions from models.. Endpoints provide the serving infrastructure (HTTP/REST interface). Storage buckets, feature pipelines, and tuning jobs are separate components of the Vertex AI stack.

    From lesson: Vertex AI β€” Model Registry and Endpoints

  66. When building an application on GCP that requires consistent, reproducible outputs for data extraction, which configuration is most appropriate?

    • Setting temperature to 1.0 to maximize creativity
    • Setting temperature to 0.0 to minimize randomness
    • Enabling top-p sampling without a temperature change
    • Increasing the max output tokens to the highest limit

    Answer: Setting temperature to 0.0 to minimize randomness. Setting temperature to 0.0 makes the model deterministic, ensuring identical inputs yield identical outputs. Option 0 increases randomness, Option 2 doesn't control temperature directly, and Option 3 relates to length, not precision.

    From lesson: Gemini API and Vertex AI Generative AI

  67. Which service should you use to securely store and retrieve Gemini API credentials without embedding them in your application code?

    • Cloud Storage
    • Compute Engine Metadata
    • Secret Manager
    • Cloud SQL

    Answer: Secret Manager. Secret Manager is the GCP-native service designed for storing sensitive secrets. Cloud Storage and Cloud SQL are for data storage, and Metadata is for instance-specific information, not secure secret retrieval.

    From lesson: Gemini API and Vertex AI Generative AI

  68. Your application using Vertex AI Generative AI is intermittently failing with 429 errors. What is the recommended approach to resolve this?

    • Hardcode a sleep function in every loop iteration
    • Switch to a different Google Cloud region without checking quotas
    • Implement an exponential backoff retry strategy
    • Disable all safety filters to increase throughput

    Answer: Implement an exponential backoff retry strategy. Exponential backoff is the standard architectural pattern for handling rate limits (429). Hardcoding sleep is inefficient, switching regions doesn't change project-wide quotas, and disabling safety filters is a violation of security best practices.

    From lesson: Gemini API and Vertex AI Generative AI

  69. In a multi-turn chat application on Vertex AI, how does the model 'remember' previous parts of the conversation?

    • The model maintains a permanent stateful memory of all users
    • The developer must append the dialogue history to each new request
    • Vertex AI automatically caches all historical user interactions
    • The model uses the underlying database connection to recall context

    Answer: The developer must append the dialogue history to each new request. Vertex AI models are stateless; they do not remember context automatically. Developers are responsible for passing the conversation history back to the API in each turn. The other options describe non-existent automatic behaviors.

    From lesson: Gemini API and Vertex AI Generative AI

  70. What is the primary purpose of 'Safety Settings' in Vertex AI?

    • To improve the latency of API calls
    • To prevent the model from generating harmful or inappropriate content
    • To force the model to provide more creative responses
    • To ensure the model output is always in a specific file format

    Answer: To prevent the model from generating harmful or inappropriate content. Safety settings define thresholds for content categories like hate speech or harassment. They do not affect speed, creativity (that is temperature), or output formatting.

    From lesson: Gemini API and Vertex AI Generative AI

  71. When creating a model in BigQuery ML, why is the TRANSFORM clause considered a best practice?

    • It forces the model to run faster on larger datasets.
    • It automatically ensures that preprocessing steps applied during training are also applied during inference.
    • It is the only way to perform SQL-based data transformations in BigQuery.
    • It changes the underlying algorithm to a more complex architecture.

    Answer: It automatically ensures that preprocessing steps applied during training are also applied during inference.. The TRANSFORM clause ensures that feature engineering logic is stored with the model. Option 0 is incorrect as it affects inference consistency, not speed. Option 2 is false as SQL works outside the clause too. Option 3 is unrelated to the clause's purpose.

    From lesson: BigQuery ML

  72. If you are building a model to predict a continuous numerical value, which configuration should be prioritized in your CREATE MODEL statement?

    • Set the model_type to LOGISTIC_REG。.C
    • Ensure the target column is categorical and string-based.
    • Set the model_type to LINEAR_REGRESSION.
    • Include all columns in the dataset to avoid data loss.

    Answer: Set the model_type to LINEAR_REGRESSION.. LINEAR_REGRESSION is for continuous values. Option 0 is for classification. Option 1 is incorrect because regression requires numeric targets. Option 3 is bad practice as it includes noise or high-cardinality identifiers.

    From lesson: BigQuery ML

  73. What is the primary benefit of using ML.PREDICT versus exporting a model to a cloud storage bucket?

    • ML.PREDICT allows for predictions directly within the SQL interface without moving data.
    • ML.PREDICT creates a more accurate model than external alternatives.
    • ML.PREDICT eliminates the need for data preprocessing.
    • ML.PREDICT is the only way to evaluate model performance.

    Answer: ML.PREDICT allows for predictions directly within the SQL interface without moving data.. ML.PREDICT enables in-database inference, minimizing data movement. Options 1, 2, and 3 are incorrect as they do not accurately describe the role of the inference function in the BQML workflow.

    From lesson: BigQuery ML

  74. How does using ML.EVALUATE help a developer during the model development lifecycle?

    • It automatically retrains the model to improve its metrics.
    • It compares the predicted values against the actual values to produce performance metrics.
    • It converts the model into a standard SQL script for deployment.
    • It generates a visualization of the data distribution.

    Answer: It compares the predicted values against the actual values to produce performance metrics.. ML.EVALUATE computes metrics like precision, recall, or RMSE based on ground truth. The other options describe actions (retraining, code conversion, visualization) that ML.EVALUATE does not perform.

    From lesson: BigQuery ML

  75. Why might a user choose to use K-MEANS in BigQuery ML?

    • To perform supervised classification of structured data.
    • To predict future time-series values.
    • To group similar observations together without predefined labels.
    • To optimize the SQL query performance of a specific table.

    Answer: To group similar observations together without predefined labels.. K-MEANS is an unsupervised algorithm for clustering. Option 0 describes classification. Option 1 describes time-series models. Option 3 is incorrect as K-MEANS is not a query optimizer.

    From lesson: BigQuery ML

  76. An architect needs to connect two VPCs in different projects to share services. Which mechanism provides the most performant, low-latency connection without needing a VPN or public internet?

    • VPC Peering
    • Cloud Interconnect
    • External IP access
    • Cloud VPN

    Answer: VPC Peering. VPC Peering allows internal IP connectivity between networks. Cloud Interconnect is for on-premises connectivity, VPN uses the internet, and external IPs are insecure for internal traffic.

    From lesson: VPC β€” Virtual Private Cloud

  77. A team requires a subnet with a specific CIDR range to adhere to corporate compliance. Which VPC configuration should they select?

    • Auto-mode VPC
    • Custom-mode VPC
    • Global VPC
    • Shared VPC

    Answer: Custom-mode VPC. Custom-mode VPCs allow you to define the exact CIDR ranges. Auto-mode creates default subnets in all regions, which lacks the required precision.

    From lesson: VPC β€” Virtual Private Cloud

  78. Your security policy mandates that instances should only communicate with instances labeled as 'web-server'. How should you configure your firewall rules?

    • Specify the internal IP address of every web server in the rule
    • Use network tags on the instances and reference the tag in the firewall rule
    • Create a subnet for each web server
    • Open all ports globally and filter traffic at the application level

    Answer: Use network tags on the instances and reference the tag in the firewall rule. Network tags provide identity-based security, which is easier to maintain than IP-based rules. Subnets are for network topology, and opening ports globally is a major security risk.

    From lesson: VPC β€” Virtual Private Cloud

  79. You have a VPC network that spans multiple regions. If you have an instance in us-central1 and an instance in europe-west1, how do they communicate using private IPs?

    • They require a Cloud Router to connect the regions
    • They require a VPN tunnel between the regions
    • They communicate natively over Google's internal global network
    • They cannot communicate because they are in different regions

    Answer: They communicate natively over Google's internal global network. Google Cloud VPCs are global, meaning instances across regions are on the same network and route traffic over Google's global backbone. No extra routers or VPNs are needed.

    From lesson: VPC β€” Virtual Private Cloud

  80. Why would an administrator choose to use a Shared VPC instead of VPC Peering?

    • To increase the speed of network traffic
    • To centralize network management across multiple projects under a single host project
    • To bypass the need for firewall rules
    • To allow communication with on-premises hardware only

    Answer: To centralize network management across multiple projects under a single host project. Shared VPC is designed for organizational structure where a central admin team manages the network, while service teams consume subnets. It simplifies management compared to managing multiple peerings.

    From lesson: VPC β€” Virtual Private Cloud

  81. An application generates logs that contain PII. How can you ensure these logs are not stored in their original form while maintaining observability?

    • Use a Log Router sink with a exclusion filter for specific log types
    • Enable Log Anonymization in the Cloud Logging console
    • Apply a Log Router sink with a filter that uses transformation logic to redact sensitive fields
    • Configure the application to write logs directly to a BigQuery dataset instead of Cloud Logging

    Answer: Apply a Log Router sink with a filter that uses transformation logic to redact sensitive fields. Option 2 is correct because Log Sinks allow for the transformation of log entries before storage, enabling redaction. Option 0 only excludes logs entirely, losing observability. Option 1 is not a native feature for PII redaction. Option 3 bypasses the Logging infrastructure, complicating centralized log management.

    From lesson: Cloud Monitoring and Cloud Logging

  82. You need to monitor the health of a custom application running on Compute Engine. What is the recommended way to collect application-specific metrics?

    • Use the default system metrics collected by the Guest Environment
    • Install the Ops Agent on the VM and configure it to scrape metrics from the application
    • Create a Log-based metric to count occurrences of 'success' logs
    • Export all system logs to Cloud Storage and use Dataflow for metric aggregation

    Answer: Install the Ops Agent on the VM and configure it to scrape metrics from the application. Option 1 is correct as the Ops Agent is designed to collect application-level metrics and system logs. Option 0 only provides infrastructure metrics (CPU/RAM). Option 2 is inefficient and inaccurate for high-frequency metrics. Option 3 is overkill and adds significant architectural complexity.

    From lesson: Cloud Monitoring and Cloud Logging

  83. An alert policy is firing too frequently during minor traffic spikes. What is the most effective way to tune the alert without losing visibility into actual issues?

    • Increase the duration of the 'rolling window' for the metric-based alert
    • Change the alert condition to trigger only when the resource utilization reaches 100%
    • Disable the alert policy during peak traffic hours
    • Reduce the polling frequency of the Cloud Monitoring agent

    Answer: Increase the duration of the 'rolling window' for the metric-based alert. Option 0 allows for a sustained condition over time, filtering out transient spikes. Option 1 is dangerous as it ignores trends before failure. Option 2 is an anti-pattern. Option 3 does not resolve the underlying sensitivity issue.

    From lesson: Cloud Monitoring and Cloud Logging

  84. You want to troubleshoot an intermittent latency issue in a microservice. Which tool allows you to inspect the lifecycle of a single request across multiple services?

    • Cloud Logging Query Language
    • Cloud Trace
    • Cloud Profiler
    • Cloud Monitoring Dashboards

    Answer: Cloud Trace. Option 1 is correct as Cloud Trace provides distributed tracing for requests. Option 0 is for searching logs, not request flow. Option 2 analyzes code performance. Option 3 displays aggregated metrics, not individual request lifecycles.

    From lesson: Cloud Monitoring and Cloud Logging

  85. What is the primary difference between logs-based metrics and standard metrics in Cloud Monitoring?

    • Logs-based metrics are only available for App Engine, while standard metrics work for all services
    • Standard metrics are pre-defined by GCP, whereas logs-based metrics are derived from the content of log entries
    • Logs-based metrics are free, while standard metrics are charged by volume
    • Standard metrics provide granular request-level metadata, while logs-based metrics do not

    Answer: Standard metrics are pre-defined by GCP, whereas logs-based metrics are derived from the content of log entries. Option 1 is the definition of logs-based metrics, which allow for metric creation from unstructured log data. Option 0 is false as logs-based metrics are service-agnostic. Option 2 is false as both can incur costs. Option 3 is incorrect as logs-based metrics are limited to the information extracted from the log entry string.

    From lesson: Cloud Monitoring and Cloud Logging

  86. An administrator needs to restrict access to a web application based on the user's geographic location. Which feature of Cloud Armor should be used?

    • VPC Firewall Rules
    • Geo-based restriction rules within a Cloud Armor security policy
    • Identity-Aware Proxy (IAP) access levels
    • Cloud DNS response policies

    Answer: Geo-based restriction rules within a Cloud Armor security policy. Cloud Armor natively supports geo-based blocking or allowing using rule conditions. VPC Firewalls do not handle geo-data. IAP is for authentication, not geo-filtering. Cloud DNS policies manage name resolution, not traffic content filtering.

    From lesson: Cloud Armor and Security Policies

  87. When a security policy rule is set to 'Preview' mode, what is the impact on actual incoming traffic?

    • The traffic is logged but no action is taken based on the rule.
    • The traffic is automatically blocked if it matches the rule.
    • The traffic is re-routed to a sandboxed environment for analysis.
    • The rule is applied only to non-HTTPS traffic.

    Answer: The traffic is logged but no action is taken based on the rule.. Preview mode logs match events so administrators can evaluate rule effectiveness without actually affecting traffic flow. Blocking occurs only in 'Enforce' mode.

    From lesson: Cloud Armor and Security Policies

  88. A Cloud Armor security policy has a rule with priority 500 set to 'Deny' and a rule with priority 1000 set to 'Allow'. What happens to traffic that matches both rules?

    • The traffic is allowed because 1000 is a higher priority number.
    • The traffic is denied because Cloud Armor uses the lowest integer as the highest priority.
    • The traffic is allowed because the most specific rule takes precedence.
    • The traffic is denied due to an automatic rule conflict error.

    Answer: The traffic is denied because Cloud Armor uses the lowest integer as the highest priority.. Cloud Armor evaluates rules in ascending order of priority, where the lowest number has the highest precedence. Therefore, priority 500 is evaluated before priority 1000.

    From lesson: Cloud Armor and Security Policies

  89. Why is it recommended to use a default 'Deny' rule in a Cloud Armor policy?

    • It improves the performance of the Load Balancer by reducing state lookups.
    • It prevents accidental exposure of backend services to unauthorized traffic.
    • It is required by Google Cloud compliance standards for all deployments.
    • It forces users to authenticate before they can see the website.

    Answer: It prevents accidental exposure of backend services to unauthorized traffic.. A default 'Deny' rule implements a 'least privilege' security model, ensuring that only explicitly permitted traffic is allowed, which prevents accidental exposure. Performance, compliance, and authentication are separate concerns.

    From lesson: Cloud Armor and Security Policies

  90. Which type of traffic can be protected by a Cloud Armor security policy?

    • Traffic sent to a Compute Engine instance via an internal IP address.
    • Traffic flowing between two microservices within the same GKE cluster.
    • External HTTP(S) traffic destined for a Global External Application Load Balancer.
    • Traffic passing through a Cloud VPN tunnel to an on-premises network.

    Answer: External HTTP(S) traffic destined for a Global External Application Load Balancer.. Cloud Armor is an edge security service designed specifically to protect applications behind Google Cloud Load Balancers. Internal IP traffic, inter-service traffic, and VPN traffic are managed by other VPC-level controls.

    From lesson: Cloud Armor and Security Policies

  91. An application requires sub-millisecond latency for stateful operations between microservices. Which GCP service provides the most performant shared-memory-like experience?

    • Cloud Spanner
    • Memorystore for Redis
    • Cloud Storage
    • Persistent Disk

    Answer: Memorystore for Redis. Memorystore provides in-memory data storage, essential for sub-millisecond latency. Cloud Spanner and Persistent Disk involve network or disk I/O latency, while Cloud Storage is object storage unsuitable for microservice state.

    From lesson: GCP Interview Questions

  92. You need to run a batch processing job that can be interrupted at any time without data loss. Which Compute Engine configuration is most cost-effective?

    • Preemptible VMs with Managed Instance Groups
    • Standard VMs with Committed Use Discounts
    • Sole-tenant nodes
    • High-CPU machine types

    Answer: Preemptible VMs with Managed Instance Groups. Preemptible VMs (or Spot VMs) are designed for fault-tolerant, interruptible workloads at a fraction of the cost. Standard VMs and Sole-tenants are significantly more expensive, and machine types do not address the interruption capability.

    From lesson: GCP Interview Questions

  93. A global application serves users in Asia, Europe, and North America. You must ensure the lowest possible latency for static assets. Which configuration should you choose?

    • Regional Storage buckets in each continent
    • A Multi-regional Cloud Storage bucket
    • Cloud Storage with a Global External HTTP(S) Load Balancer using Cloud CDN
    • A standard bucket with a regional load balancer

    Answer: Cloud Storage with a Global External HTTP(S) Load Balancer using Cloud CDN. Cloud CDN integrated with a global load balancer caches content at the edge, closest to the user. Simply using a Multi-regional bucket is insufficient because it doesn't provide edge caching, and regional approaches lack the global reach required.

    From lesson: GCP Interview Questions

  94. You are migrating a relational database that requires horizontal scaling and global consistency. Which service is the correct choice?

    • Cloud SQL
    • Cloud Spanner
    • Bigtable
    • Firestore

    Answer: Cloud Spanner. Cloud Spanner is designed for global scale and strong consistency. Cloud SQL does not scale horizontally for writes, Bigtable is a NoSQL wide-column store, and Firestore is a NoSQL document database that lacks the relational capabilities of Spanner.

    From lesson: GCP Interview Questions

  95. How do you best implement a 'defense-in-depth' strategy for a Cloud Run service accessing a Cloud SQL database?

    • Use a public IP for the database and open the firewall for the Cloud Run range
    • Use the Cloud SQL Auth Proxy with a private IP address and IAM-based authentication
    • Hardcode database credentials in an environment variable
    • Grant the Cloud Run service account the 'Project Owner' role

    Answer: Use the Cloud SQL Auth Proxy with a private IP address and IAM-based authentication. The Cloud SQL Auth Proxy combined with private IP ensures traffic stays within the Google network and uses IAM, which is secure. Public IPs, hardcoded credentials, and excessive IAM roles violate security best practices and increase the attack surface.

    From lesson: GCP Interview Questions

  96. An application requires sub-millisecond latency for real-time analytics. Which storage option provides the highest throughput and lowest latency on GCP?

    • Cloud Storage Regional bucket
    • Persistent Disk SSD (pd-ssd)
    • Cloud Memorystore for Redis
    • Cloud Spanner

    Answer: Cloud Memorystore for Redis. Memorystore is an in-memory data store, providing sub-millisecond latency. Cloud Spanner is for relational consistency, Persistent Disk is block storage, and Cloud Storage is object storage, all of which have higher latency than memory.

    From lesson: GCP Architecture Design Questions

  97. You need to host a global web application that requires HTTPS load balancing and static content distribution. What is the most cost-effective and performant architecture?

    • Single regional VM running Nginx
    • Global HTTP(S) Load Balancer with Cloud CDN and Cloud Storage
    • Cloud SQL with Compute Engine in every region
    • Standard Load Balancer with Cloud Storage

    Answer: Global HTTP(S) Load Balancer with Cloud CDN and Cloud Storage. The Global HTTP(S) Load Balancer enables traffic to be routed to the nearest instance, while Cloud CDN caches static content at the edge. A single VM is not global, Cloud SQL is for databases, and Standard Load Balancers lack the global features required.

    From lesson: GCP Architecture Design Questions

  98. A microservices application on GKE needs to communicate securely without exposing services to the public internet. What is the best networking approach?

    • Use Public IPs with IP whitelisting
    • Use Internal Load Balancers and Private GKE Clusters
    • Use standard Cloud NAT on all nodes
    • Use External Load Balancers with Cloud Armor

    Answer: Use Internal Load Balancers and Private GKE Clusters. Private GKE clusters ensure nodes do not have public IPs, and Internal Load Balancers restrict traffic to the VPC. Public IPs expose the service to the internet, and Cloud NAT/Armor do not provide the internal-only isolation required.

    From lesson: GCP Architecture Design Questions

  99. When designing a disaster recovery plan for a mission-critical database, what is the primary benefit of using Cloud Spanner over a standard MySQL setup on Compute Engine?

    • It supports higher total storage capacity
    • It provides synchronous replication and automatic failover across regions
    • It allows for direct OS-level configuration
    • It is compatible with more legacy SQL drivers

    Answer: It provides synchronous replication and automatic failover across regions. Spanner offers multi-region synchronous replication, ensuring high availability and zero-RPO failover. A MySQL setup requires manual management for replication and failover, whereas Spanner handles it as a managed service.

    From lesson: GCP Architecture Design Questions

  100. Which IAM design pattern follows the principle of least privilege for a developer needing to deploy code to Cloud Functions?

    • Granting the 'Owner' role on the project
    • Granting 'Cloud Functions Developer' and 'Service Account User' roles
    • Granting 'Editor' role at the folder level
    • Granting 'Admin' role on the specific Cloud Function

    Answer: Granting 'Cloud Functions Developer' and 'Service Account User' roles. Cloud Functions Developer allows the deployment of code, and Service Account User is necessary to attach an identity to the function. Granting Owner or Editor roles provides far too much access, violating security best practices.

    From lesson: GCP Architecture Design Questions