Google Cloud Platform Services and Architecture Questions
Google Cloud Platform's core services and architecture: Compute Engine, Cloud Run, GKE, Cloud Storage, VPC, managed databases (Cloud SQL, Spanner, Firestore, Bigtable), and BigQuery-adjacent data services. Covers GCP service selection, networking, IAM and security specifics, cost and quota management, and reference patterns for building on the platform. For provider-agnostic compute, storage, or networking concepts, see the cross-cloud entries.
A healthcare customer subject to HIPAA wants to run workloads on Cloud Storage, BigQuery, and GKE. Design a compliant architecture: encryption at rest and in transit, CMEK, audit logging, VPC Service Controls, and DLP scanning. What documentation or attestation would you expect the customer to maintain?
Sample Answer
Direct answer
HIPAA (the Health Insurance Portability and Accountability Act, the US law governing protected health information, PHI) is not something Google certifies you compliant with by using a service. Google signs a Business Associate Agreement (BAA) covering in-scope services, and Cloud Storage, BigQuery, and GKE (Google Kubernetes Engine) are all BAA-eligible, but the customer remains the party responsible for how those services are actually configured and used. So the architecture has to make the compliant configuration the only reachable one, not merely a possible one.
Architecture
flowchart LR
U[Clinician application] -->|TLS| LB[HTTPS load balancer]
LB --> APP[GKE workload: private cluster]
APP -->|CMEK encrypted| GCS[Cloud Storage: PHI documents]
APP --> DLP[Sensitive Data Protection: de-identify]
DLP -->|CMEK encrypted| BQ[BigQuery: de-identified analytics]
APP --> LOG[Cloud Audit Logs]
GCS --> LOG
BQ --> LOG
- Encryption at rest and in transit. All three services encrypt at rest by default, but PHI-holding buckets and BigQuery datasets get CMEK (customer-managed encryption keys, via Cloud KMS, Cloud Key Management Service) so the customer controls the key's lifecycle and can revoke access to the underlying data by disabling the key, something a HIPAA audit typically expects specifically for PHI. In transit, TLS end to end, terminated at the load balancer and, if a service mesh is in play, mutual TLS between GKE pods internally.
- Audit logging. Cloud Audit Logs' Data Access logs on Cloud Storage and BigQuery are off by default and have to be explicitly enabled; this is the single most commonly missed HIPAA control on this stack. Export them to a separate, access-restricted logging project so the audit trail cannot be altered by whoever has access to the workload itself.
- VPC (Virtual Private Cloud) Service Controls. A perimeter drawn around the Cloud Storage, BigQuery, and GKE-adjacent APIs that handle PHI, so that even a correctly-authenticated request headed somewhere it should not go, copying data out to a personal bucket outside the organization, for instance, is blocked at the network and API boundary, not left to IAM (Identity and Access Management) alone to catch.
- Sensitive Data Protection (formerly known as Cloud DLP, Data Loss Prevention). Used two ways here: to classify what data actually is PHI on ingest, and to de-identify or tokenize it before it lands in any lower-sensitivity copy, such as an analytics dataset a broader set of staff can query.
Documentation and attestation to expect from the customer
The signed BAA itself, and Google's published compliance documentation showing why the specific in-scope services are permissible for PHI. On the customer's side: a completed risk analysis or security risk assessment, which the HIPAA Security Rule requires independent of which cloud provider is used; an inventory of exactly which systems and data flows actually touch PHI, since that inventory is what justifies where the VPC Service Controls perimeter boundary is drawn; and access review records showing least-privilege IAM grants are actually audited on an ongoing basis, not merely configured once and left alone.
Trade-offs and pitfalls
VPC Service Controls perimeters are disruptive if drawn too tightly, legitimate cross-project data flows fail silently with denials that look like generic permission errors rather than perimeter violations; start in dry-run mode and widen the perimeter's ingress (inbound) and egress (outbound) rules deliberately, rather than iterating against a fully enforced perimeter. CMEK adds an availability dependency: if the key is disabled or its IAM revoked, every read against that data fails immediately, so changes to a CMEK key's IAM need the same change-control rigor as a production deploy, not an ad hoc edit. The most common wrong turn is treating "HIPAA compliant" as a property of which services were chosen rather than how they are configured: the exact same three services can be either compliant or a serious violation depending entirely on whether Data Access logging, CMEK, and the VPC Service Controls perimeter are actually turned on and correctly scoped.
A gaming customer needs low-latency user-profile reads around 100ms, high-throughput time-series metrics, and large-scale analytics on historical data. Which managed GCP databases would you use for each need, Firestore, Bigtable, BigQuery, or something else, and how would you explain the combined architecture and its trade-offs to their CTO?
Sample Answer
Direct answer
Three different access patterns here call for three different databases, not one database stretched to do all three jobs: Firestore for the low-latency user-profile reads, Bigtable for the high-throughput time-series metrics, and BigQuery for large-scale historical analytics. Each one is genuinely the strongest fit for its own workload, and none of them is a reasonable substitute for either of the others.
| Need | Store | Why it fits |
|---|---|---|
| Player profile read, around 100ms | Firestore | Millisecond-scale indexed document reads, flexible per-player schema, low operational overhead |
| Time-series metrics, high write throughput | Bigtable | Wide-column store built for sustained high-throughput writes keyed by entity and time |
| Historical analytics at scale | BigQuery | Columnar SQL engine built for scanning large datasets, not for single-row low-latency lookups |
How to explain the combined architecture to a CTO
Frame it as "each store does the one thing it's best at, and data flows one direction." Bigtable ingests the live metrics stream (match results, in-game events, latency samples) at high write volume, keyed by something like playerId#reversedTimestamp (subtracting the actual timestamp from a fixed large number before appending it, so that within one player's rows, Bigtable's ordinary ascending key order lands the most recent record first instead of last) so recent data for a given player is efficiently scannable without a slower reverse scan. Firestore holds the small, frequently-read player profile (level, inventory, settings) as a separate store from the high-volume metrics, so a profile read never contends with metrics write traffic on the same system. A scheduled or streaming export moves data from both operational stores into BigQuery, so the historical analytics that product and data teams actually query against never sits on the critical path of a live game request.
Worked example
The 100ms constraint is the concrete reason Firestore, not BigQuery, serves the profile read: a Firestore point read on an indexed document is a small, fixed number of network round trips plus a lookup, comfortably inside a 100 millisecond budget even accounting for typical inter-region latency. BigQuery, in contrast, is built for scanning, its query planning and execution overhead makes it a poor fit for a single-row lookup on a strict latency budget regardless of how little data that one query actually touches, so the mismatch is architectural, not something better indexing on the BigQuery side would fix.
Trade-offs and pitfalls
Bigtable has a real minimum cluster cost, nodes are billed whether or not they are fully utilized, so it is the wrong choice below a certain sustained write-throughput floor; if metrics volume turns out to be modest, Firestore or even BigQuery streaming inserts might be simpler and cheaper, and Bigtable should not be reached for by default just because it is the "throughput" answer on paper. A common wrong turn is serving the low-latency profile read directly out of BigQuery "since the data is already there for analytics"; that both disappoints on latency and gets expensive under a per-query pricing model if hit at request-rate frequency. Keeping Firestore and Bigtable as separate systems also means BigQuery's view of "this player's history" is eventually consistent with whatever is currently in the two operational stores, acceptable for analytics, but not something to build a live gameplay decision on.
Design a least-privilege IAM model for an enterprise where developers can deploy to development projects but only the operations team can deploy to production. How would you handle the service accounts used by CI/CD, group and grant roles to teams, use IAM Conditions, and set up an audit process to make sure it's actually being followed?
Sample Answer
Direct answer
The core mechanism is a project structure that separates environments, dev projects grouped under one folder, production under another, so environment boundaries are actual project boundaries, not just role names inside one shared project. Then map every deploy path, human or CI/CD, to a principal whose IAM (Identity and Access Management) grant is scoped to exactly the projects it should reach: developers and their CI/CD service account get deploy roles on dev projects only, and a separate, tightly controlled CI/CD service account, used only by the production-promotion stage and gated by a human approval, is the only principal with a deploy role on the production project.
Designing the model
Project and folder structure
Group dev projects under one folder and production under another, granting IAM roles at the folder level for the common case (developers get a deploy role across the whole dev folder) rather than repeating identical grants project by project. This same folder pattern is exactly how you onboard a new team across multiple projects too, grant the team's group a role at the folder covering their projects once, rather than hand-granting per project per person, so the design that solves "dev versus prod" also solves "add a fifth team next quarter" without new plumbing.
CI/CD service accounts
Use a distinct service account per pipeline stage: a "deploy-to-dev" service account scoped to dev projects, and a separate "deploy-to-prod" service account scoped only to the production project, invoked exclusively from the production-promotion pipeline stage, ideally gated by a required approval in the CI/CD tool itself. Even if the general dev-facing pipeline is compromised, the attacker does not inherit production deploy rights, that identity simply isn't reachable from there.
Grouping and granting to teams
Grant roles to Google Groups mapped to team membership, a "developers" group, an "ops" group, not to individuals. Adding or removing someone from a team becomes a group-membership change, which is also what makes an audit tractable later, checking group membership against a team roster instead of diffing raw IAM bindings.
IAM Conditions
IAM Conditions attach an expression to a role binding so it only applies under specific circumstances, for example limiting a broad deploy role to a defined change window, or restricting it to resources matching a naming pattern as an extra guardrail on top of the project split itself. Use Conditions as a second layer of defense, not a substitute for the project boundary, a condition is an expression that can have a bug, a project boundary is a hard wall.
Audit process
Two different audits matter here: a periodic IAM policy review comparing who has what role on which project or folder against the intended model, and a review of Cloud Audit Logs for actual deploy actions against production, confirming who really deployed and when, and specifically whether anyone bypassed CI/CD and deployed to production directly with a human credential, which the model above should make structurally difficult, and the log audit confirms it's actually rare rather than just theoretically rare.
Worked example
A developer's laptop credentials get phished. Because that developer's IAM grant is scoped to the dev folder only, the attacker can deploy garbage to a dev project, annoying but contained, and cannot reach production because there is no binding anywhere granting that identity, or any service account it normally uses, a role on the production project. The audit trail confirms the containment: Cloud Audit Logs show deploy activity in dev projects from that identity and nothing in production's logs, exactly the evidence an incident review needs to prove the blast radius stayed contained.
Trade-offs and pitfalls
A common pitfall is granting a "just in case" broad role to the general CI/CD service account so it can deploy anywhere, which collapses the entire design back into one shared, powerful identity. A second pitfall is relying on IAM Conditions as the only control instead of a project boundary, conditions can be written incorrectly and are harder to audit at a glance than "which project is this role bound to." A third pitfall is auditing IAM policy bindings but never cross-checking against actual deploy logs, a clean-looking policy tells you nothing about whether someone found a side door, a personal token, a break-glass account, that bypasses it entirely. Separate service accounts and a folder structure add real setup overhead up front, but retrofitting isolation after a real incident forces the redesign under far worse conditions.
Compare Cloud SQL, Cloud Spanner, Firestore, and Bigtable as managed database options on GCP: data model, consistency guarantees, scalability, and typical use case. Can you map four different application patterns to the service that fits each best?
Sample Answer
Direct answer
The four sit on two axes: relational versus non-relational, and single-region-scale versus horizontally-distributed-scale. Cloud SQL is a single-region relational database for standard transactional applications. Cloud Spanner is a globally-distributed relational database for applications that need both strong consistency and horizontal write scale beyond what one machine can do. Firestore is a document database for applications built around flexible, hierarchical JSON-like records with real-time sync to clients. Bigtable is a wide-column store for massive-scale, high-throughput workloads with simple, known access patterns (look up by key, or scan a key range).
Structured elaboration
| Service | Data model | Consistency | Scalability | Typical use case |
|---|---|---|---|---|
| Cloud SQL | Relational (MySQL, PostgreSQL, SQL Server) | Strong (ACID: atomicity, consistency, isolation, durability) within a region | Vertical, plus read replicas; a single primary handles all writes | Standard application backend: orders, accounts, CMS content |
| Cloud Spanner | Relational, but horizontally partitioned (sharded) across nodes | Strong, globally (external consistency) | Horizontal, across regions if needed; scales writes, not just reads | Global financial ledgers, inventory systems needing both scale and strict consistency |
| Firestore | Document (collections of JSON-like documents) | Strong within a database instance; supports real-time listeners | Automatic horizontal scaling, serverless | Mobile/web apps needing real-time sync, offline support, flexible schema |
| Bigtable | Wide-column (sparse, sorted key-value rows with column families) | Strong per-row only (no multi-row transactions) | Massive horizontal scale, linear with node count | Time-series, IoT telemetry, ad-tech clickstreams, ML feature stores |
Four application patterns mapped to a fit:
- A subscription billing system needing foreign keys between customers, invoices, and payments, with standard SQL joins and moderate write volume: Cloud SQL. The relational model and ACID transactions match the domain directly, and the write volume doesn't need horizontal sharding.
- A global multiplayer game's inventory and matchmaking ledger, needing strict consistency (an item can't be duplicated by a race condition) at a write volume no single machine could sustain, across players worldwide: Cloud Spanner. This is the case that specifically needs both properties Cloud SQL doesn't offer together: horizontal write scale and strong consistency.
- A collaborative note-taking or task app with a mobile client that needs to work offline and sync automatically when reconnected, with a flexible per-document schema (some notes have attachments, some have checklists): Firestore. The document model and built-in real-time listener/offline-sync support solve exactly that client-facing problem.
- An IoT platform ingesting sensor telemetry from millions of devices, where the access pattern is almost entirely "write a new reading" and "scan a device's recent readings by time range," with no need for joins or multi-row transactions: Bigtable. Its wide-column model and linear scaling handle this write-heavy, simple-access-pattern workload far more cheaply per unit of throughput than a relational engine would.
Worked example
Take the same underlying entity, a "user session," across two of these services to show the model actually drives the choice, not habit. In Cloud SQL, a sessions table with a foreign key to users, queried with a JOIN to fetch session plus user profile in one round trip, fits naturally because the access pattern is relational (session belongs to exactly one user, and you often want both together). In Bigtable, the same conceptual data modeled as row_key = user_id#reverse_timestamp, with columns for session metadata, fits a workload that instead needs "give me this user's most recent 50 sessions, fast, at massive scale, with no joins," because the reverse-timestamp suffix keeps a user's most recent sessions physically adjacent for fast range scans without needing a secondary index. The same "session" concept, modeled two structurally different ways, because the question being asked of the data differs.
Trade-offs & pitfalls
- Reaching for Spanner as a default "just in case we need to scale" choice when Cloud SQL would comfortably handle the actual write volume adds real operational and cost overhead (Spanner's minimum viable footprint costs more than a modest Cloud SQL instance) for a scale problem you don't have yet.
- Using Firestore for data that's genuinely relational (heavy cross-collection joins simulated via multiple reads and client-side merging) fights the model; Firestore has no server-side join, so relational-shaped data forces either denormalization (duplicating data across documents, with the consistency risk that implies) or multiple round trips.
- Using Bigtable for anything needing multi-row transactions or ad hoc query flexibility is a common mismatch; Bigtable's atomicity guarantee stops at a single row, and its query model is fundamentally "scan by key or key range," not "filter by an arbitrary non-key column" without a design decision baked into the row key up front.
Design a CI/CD pipeline for container images that enforces supply-chain security before anything reaches GKE: vulnerability scanning, image signing, and blocking anything that fails policy at admission time using something like Binary Authorization. How would you prove provenance for an image that does get deployed?
Sample Answer
Direct answer
Build the image once, scan it, sign it with an attestor at each gate it clears, and promote that exact signed digest across environments (never rebuild between them). Binary Authorization (a GKE, Google Kubernetes Engine, admission controller that only lets a workload run if its image carries the attestations a policy requires) denies anything missing the right signatures at deploy time, on every cluster, not just the ones you remember to check by hand. Provenance for a deployed image comes from independently verifying the build metadata Cloud Build attaches to that image, not from trusting whoever tells you it's safe.
Pipeline stages
- Build. Cloud Build (GCP's managed continuous integration and continuous delivery, CI/CD, service) runs in a locked builder image with no arbitrary network egress, builds the container, and pushes it to Artifact Registry (GCP's managed image and package registry) addressed by its content digest (
sha256:...), never by a mutable tag alone. - Vulnerability scan. Artifact Analysis (Artifact Registry's built-in scanning service, formerly Container Analysis) scans the pushed digest. The pipeline fails above a defined severity threshold, for example any CRITICAL finding, or any HIGH finding with a published fix.
- Sign. Two distinct Binary Authorization attestors sign the same digest at different points: a
vuln-scan-passedattestor signs right after step 2 clears, and aqa-passedattestor signs only after smoke tests pass in staging (step 4). Each attestation is a cryptographic signature, backed by a Cloud KMS (Cloud Key Management Service) key, over that specific digest plus a note identifying which check ran. - Promote across environments. The identical digest moves dev to staging to prod. Each promotion re-runs smoke tests against that same digest in the next environment; passing adds an environment-scoped attestation. Rebuilding "just to bump a label" between environments breaks the whole chain, since the digest that gets attested is no longer the digest that gets deployed.
- Admission. Each GKE cluster enforces a Binary Authorization policy naming which attestations it requires: staging requires
vuln-scan-passedandqa-passed; prod additionally requires aprod-smoke-passedattestation from that environment's own smoke run. Anything missing one is denied and logged. An emergency bypass needs a scoped, time-boxed policy exception on record, not a manual click-through, or the control gets disabled the first time it's inconvenient.
flowchart LR
A[Source push] --> B[Cloud Build: unit test]
B --> C[Vulnerability scan: Artifact Analysis]
C -->|clean| D[Sign image: Binary Authorization attestor]
C -->|CVEs above threshold| X[Block build]
D --> E[Push to Artifact Registry]
E --> F[Deploy request to GKE]
F --> G{Admission check: Binary Authorization policy}
G -->|attestations present| H[Pod scheduled]
G -->|missing attestation| X
Proving provenance
Cloud Build generates build provenance metadata, in the SLSA (Supply-chain Levels for Software Artifacts) sense, alongside the image: the exact source commit, the builder identity, and the build steps that ran. For a deployed image, pull that digest's provenance (via the Artifact Registry image metadata or the Container Analysis Occurrence API) and confirm the source repository, commit, and builder service account match what you expect, then check that the same digest carries the Binary Authorization attestations your policy requires. Because every check keys off the immutable digest rather than a tag, an attacker who repoints a tag in the registry cannot silently change what a "trusted" reference actually points to.
Trade-offs and pitfalls
Binary Authorization only guards the GKE admission path. It does nothing if someone gets a shell on a node or a pod's service account is over-privileged, so it has to sit alongside node and workload hardening, not replace it. The real trust boundary is who can produce a valid signature: if the same CI service account that builds the image also holds signing rights for every attestor, a compromised pipeline can attest its own bad image, so the qa-passed attestor's signing identity should be separate from the one that runs the build and scan. The most common way this design gets quietly defeated is attesting to a tag instead of a digest, or rebuilding between staging and prod for a trivial reason, both erase the chain of custody the whole pipeline exists to create.
Unlock Full Question Bank
Get access to all Google Cloud Platform Services and Architecture interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.