Gcp Compute¶
51 cards — 🟢 9 easy | 🟡 18 medium | 🔴 13 hard
🟢 Easy (9)¶
1. What are sheilded VMs ?
Show answer
Shielded VMs in Google Cloud Platform provide a higher level of protection against various threats to the integrity of your VMs. They're hardened virtual machines that offer a defense against boot and kernel-level attacks.Key aspects of Shielded VMs:
2. True or False? All GCP services are available in all regions zones
Show answer
False. You can see [here](https://cloud.google.com/about/locations) which products/services available in each region.Gotcha: Before deploying, always verify service availability in your target region at cloud.google.com/about/locations.
Example: GPUs, Cloud SQL for SQL Server, and certain AI services are only in select regions.
3. List the labels of an instance called "instance-1"
Show answer
`gcloud compute instances describe instance-1 --format "yaml(labels)"`Remember: Use --format to control output: yaml, json, table, csv, value. Example: --format='value(labels)' for plain text.
Gotcha: Labels are case-sensitive. 'Env' and 'env' are different labels.
4. How to list all regions?
Show answer
`gcloud compute regions list`Remember: Regions contain zones. Use `gcloud compute zones list` for zones. Format: region-zone (e.g., us-central1-a).
Fun fact: GCP has 40+ regions across 6 continents as of 2025.
5. True or False? A resource has to be associated with at least one project
Show answer
True. You can't have resources associate with no projects.Remember: GCP hierarchy: Organization > Folder > Project > Resources. Every resource must live in a project.
Gotcha: Deleting a project deletes ALL resources in it — VMs, databases, everything. Use with extreme caution.
6. True or False? In a project, you can have one or more organizations
Show answer
False. It's quite the opposite. First there is an organization and under organization you can have one or more folder with one or more projects.Remember: GCP hierarchy: Organization > Folders > Projects > Resources. One org contains many projects, never the reverse.
Analogy: Think of it like a company (org) > departments (folders) > teams (projects) > tools (resources).
7. True or False? Each GCP region is designed to be completely isolated from the other GCP regions
Show answer
True. GCP regions are isolated from each other. Each region has independent infrastructure, and data doesn't replicate across regions unless explicitly configured.Under the hood: Each region has independent power, cooling, and networking. Cross-region data transfer costs money.
Gotcha: While regions are isolated, multi-region services (like GCS multi-regional buckets) replicate across them.
8. True or False? Project name has to be globally unique
Show answer
True. GCP project names must be globally unique across all of Google Cloud. Project IDs (used in APIs) are also globally unique.Gotcha: Project IDs are also globally unique and immutable once created. Choose carefully — you cannot change the ID later.
Remember: Project names can be changed; project IDs cannot. Project number is auto-assigned.
9. What are GCP's strategies for Disaster Recovery (DR)?
Show answer
GCP provides redundancy, backup, and geo-distribution features to ensure DR.* Regional Redundancy: GCP's infrastructure is designed for data redundancy across multiple regions, ensuring availability even in case of regional outages.
🟡 Medium (18)¶
1. Remove the label "env" from an instance called "instance-1"
Show answer
`gcloud compute instances update instance-1 --remove-labels env`Remember: Labels are key-value metadata for organizing resources. Remove with --remove-labels, add with --update-labels.
Gotcha: Labels are different from network tags. Labels are for billing/organization; tags affect firewall rules and routes.
2. What is Cloud IoT Core in GCP?
Show answer
Cloud IoT Core is a fully managed service for securely connecting, managing, and ingesting data from globally dispersed devices. Cloud IoT Core is a fully managed service that allows you to securely connect, manage, and ingest data from globally dispersed IoT devices. It offers a robust infrastructure to handle IoT device management and enables easy integration with other GCP services for data analysis and insights.3. What are Committed Use Discounts (CUDs) on GCP?
Show answer
CUDs are cost-saving commitments for specified compute resources over a term. When committing to use specific virtual machine instances or other resources for a one- or three-year term, Google offers discounted pricing compared to pay-as-you-go pricing. These discounts are beneficial for workloads that have predictable and steady resource consumption.4. What is Google Compute Engine (GCE)?
Show answer
GCE is an Infrastructure as a Service (IaaS) offering by GCP, providing scalable virtual machines to run workloads. Users can select configurations for CPUs, memory, and storage, and have full control over the software running on these VMs. GCE allows users to create, start, stop, and manage instances, providing a flexible and on-demand computing infrastructure within Google Cloud.5. What is Cloud Run in GCP?
Show answer
Cloud Run is a fully managed serverless platform for building and running containerized applications. Notable features include:* Portability: Supports containerized applications built on any language or framework.
* Automatic Scaling: Scales up or down in response to traffic.
* Pay-for-Usage Model: Charges are based on actual resource usage.
6. What is Cloud Spanner, and how is it different from other databases?
Show answer
Cloud Spanner is a globally distributed, horizontally scalable database designed for mission-critical applications with strong consistency and SQL support. It combines the benefits of relational databases with the scalability of NoSQL databases. It can automatically scale both storage and compute resources. The Data is replicated across multiple regions for high availability and low latency. It also maintains strong consistency with ACID properties for transactions.7. Explain Multi-Regional Storage in GCP.
Show answer
Multi-Regional Storage offers high availability and low latency access to frequently accessed data across multiple regions. It is suitable for workloads requiring quick and reliable access to data, providing redundancy and fast access to data across different geographic regions.8. What considerations to take when choosing an GCP region for running a new application?
Show answer
* Services Availability: not all service (and all their features) are available in every region* Reduced latency: deploy application in a region that is close to customers
Remember: Three factors for region selection: latency (proximity to users), compliance (data residency laws), and service availability.
Gotcha: Some services like Cloud Spanner multi-region require specific region configurations.
9. Create an instance with the following properties:
Show answer
`gcloud compute instances create instance-1 --labels app=web,env=dev --machine-type=e2-micro`Remember: --labels at creation time. --update-labels after creation. Two different flags for the same metadata.
Gotcha: e2-micro is part of the free tier (1 per billing account, in select regions).
10. What is Cloud Functions?
Show answer
It's a serverless platform for building and deploying event-driven, scalable functions.Key Features:
* Event-Based Triggers: Executes code in response to various events from GCP services or HTTP requests.
* Automatic Scaling: Automatically scales based on the load and triggers, ensuring cost efficiency.
Use Cases:
It's ideal for building lightweight applications, handling microservices, and automating workflows that react to specific events or triggers.
11. Tell me what do you know about GCP networking
Show answer
Virtual Private Cloud(VPC) network is a virtual version of physical network, implemented in Google's internal Network. VPC is a global resource in GCP.Subnetworks(subnets) are regional resources, ie., subnets can be created withinin regions.
VPC are created in 2 modes,
12. What is cloud function ?
Show answer
Cloud Functions is Google Cloud's serverless execution environment, allowing developers to deploy individual functions that automatically scale based on the triggered events. It enables the execution of code in response to various events within GCP or external triggers without managing the underlying infrastructure. Developers can write functions in Node.js, Python, Go, and other supported languages, making it ideal for event-driven, lightweight applications, and microservices.13. What network tags are used for?
Show answer
Network tags allow you to apply firewall rules and routes to a specific instance or set of instances: You make a firewall rule applicable to specific instances by using target tags and source tags.14. Update a label to "app=db" for the instance called "instance-1"
Show answer
`gcloud compute instances update instance-1 --update-labels app=db`Remember: --update-labels adds or changes labels. --remove-labels removes them. --clear-labels removes all labels.
Gotcha: Updating one label does not affect others — it is a merge operation, not a replace.
15. Explain Google Cloud Storage classes and their use cases.
Show answer
Storage classes include Standard, Nearline, Coldline, and Archive, each optimized for different access frequencies and costs.* Standard: General-purpose storage for frequently accessed data.
* Nearline: Low-cost storage for data accessed less frequently, with a 30-day minimum storage duration.
16. How do Organisation Policies differ from OS Policies ?
Show answer
Organization Policies: Focus on defining and enforcing rules and constraints across an entire organization's GCP resources. They are applied at the organizational level, controlling behaviors and settings at a broad scale. These are applied at Org Level i.e the scope is Organisation and Projects.17. Can you provide some examples to labels usage in GCP?
Show answer
* Location (cost center)* Project (or environment, folder, etc.)
* Service type
* Service owner
* Application type
* Application owner
Remember: Labels help with cost allocation in billing reports. Filter by label in Cloud Billing to see per-team costs.
Gotcha: Labels have limits: max 64 per resource, key max 63 chars, value max 63 chars. Lowercase only.
18. What Compute metadata key allows you to run code at startup?
Show answer
`startup-script` — a Compute Engine metadata key whose value is a shell script that runs automatically when the VM boots. Set it via `--metadata startup-script='#!/bin/bash ...'` or point to a Cloud Storage file with `startup-script-url`.🔴 Hard (13)¶
1. Explain Google Cloud Billing Catalog.
Show answer
It's a catalog that enables Google Cloud customers to access and download detailed billing data. It's a comprehensive, detailed breakdown of charges and costs incurred while using GCP services. This catalog is accessible through the GCP Billing Console and includes information on the usage and pricing of all services utilized by an organization. It helps users track and analyze their spending across various GCP products and services, allowing for better cost management and planning.2. Describe Google Cloud Dataflow.
Show answer
Cloud Dataflow is a fully managed service for stream and batch processing. It enables users to create data pipelines for transforming and enriching data, supporting real-time processing as well as processing of large datasets. It integrates with various data sources and other GCP services, providing a flexible and scalable data processing platform.3. Explain each of the following
Show answer
GCP regions are data centers hosted across different geographical locations worldwide.Within each region, there are multiple isolated locations known as Zones. Each zone is one or more data-centers with redundant network and connectivity and power supply. Multiple zones ensure high availability in case one of them goes down
4. Differentiate between Preemptible VMs and Standard VMs.
Show answer
Standard VMs:* These are regular, long-lived virtual machine instances.
* Offered at standard pricing.
* Ideal for workloads requiring continuous availability without interruption.
* Guaranteed to run until manually stopped or terminated by the user.
Preemptible VMs:
* Short-lived and cost-effective instances.
5. Explain Cloud Functions
Show answer
Google Cloud Functions is a serverless execution environment for building and connecting cloud services. With Cloud Functions you write simple, single-purpose functions that are attached to events emitted from your cloud infrastructure and services. Your function is triggered when an event being watched is fired.6. Describe GCP Cost Explorer.
Show answer
Cost Explorer is a tool to visualize, understand, and manage GCP spending.* Cost Tracking: Users can track and analyze their spending based on different GCP services, projects, and timeframes.
* Forecasting: It offers the ability to forecast future spending based on historical data and trends.
* Budget Management: Users can set budgets and receive alerts when spending exceeds defined thresholds.
7. How does GCP provide cost management and optimization?
Show answer
GCP offers cost management tools like Cost Explorer, Budgets, and Rightsizing Recommendations for cost monitoring and optimization. Moreover, budgeting tools enable setting spending limits and alerts. GCP also offers sustained use discounts and committed use discounts for predictable workloads. Additionally, organizations can leverage predefined cost-saving recommendations and custom reports for better insights and decisions regarding resource allocation and usage.8. Explain resources hierarchy in GCP
Show answer
OrganizationFolder
Project
Resources
* Organizations - Company
* Folder - usually for departments, teams, products, etc.
* Project - can be different projects or same project but different environments (dev, staging, production)
* Resources - actual GCP services (Compute, App engine, Storage, etc.)
9. Describe Google Cloud Functions.
Show answer
Cloud Functions is a serverless execution environment for building and connecting cloud services.Key aspects include:
* Event-Driven Computing: Executes code in response to events from various GCP services.
* Pay-as-You-Go Model: Users are charged only for the time their functions run.
* Support for Multiple Languages: Allows development in languages like Node.js, Python, and Go.
10. What is Google BigQuery and when would you use it for analytics?
Show answer
BigQuery is a serverless, highly scalable, and cost-effective data warehouse for analyzing big data.Key Aspects:
* Performance: Offers fast query execution on large datasets with high concurrency.
* Managed Service: No infrastructure management required; Google handles scaling and maintenance.
Use Cases:
BigQuery is ideal for interactive analysis, ad-hoc querying, and generating insights from large and complex datasets.
11. Describe Cloud Spanner in GCP.
Show answer
Cloud Spanner is a globally distributed, horizontally scalable database designed for global applications. It combines the benefits of relational databases with horizontal scalability and global distribution, making it suitable for mission-critical applications requiring high consistency and scalability.12. When do you use CloudRun ?
Show answer
Cloud Run is a fully managed compute platform that enables developers to deploy containerized applications quickly. It's ideal in scenarios where you have containerized applications or microservices and need a serverless architecture. Cloud Run abstracts infrastructure management and automatically scales based on incoming traffic.13. Explain Google Cloud Backup.