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.
Design a way to detect, investigate, and remediate suspicious data exfiltration attempts out of Cloud Storage and BigQuery. What role would log sinks, Cloud DLP, and alerting thresholds play, and what would an automated quarantine step look like?
Sample Answer
Direct answer
Exfiltration detection here is a log-based anomaly problem, not something Sensitive Data Protection (formerly Cloud DLP, Data Loss Prevention) can solve on its own: Sensitive Data Protection tells you what data is sensitive, Cloud Audit Logs tell you who touched it and how much, and the combination, an unusual volume of access against data already classified as sensitive, is the actual signal worth alerting and automatically remediating on.
Detection and response flow
flowchart LR
GCS[Cloud Storage data access] --> LOGS[Data Access audit logs]
BQ[BigQuery data access] --> LOGS
LOGS --> SINK[Log sink to Pub/Sub]
SINK --> DETECT[Log-based alerting policy]
DLP[Sensitive Data Protection scan] --> DETECT
DETECT -->|threshold breached| ALERT[Page on-call]
DETECT -->|threshold breached| FUNC[Cloud Function: auto-remediate]
FUNC --> REVOKE[Revoke IAM binding or key]
FUNC --> QUAR[Move object to quarantine bucket]
- Log sinks. Cloud Storage and BigQuery Data Access audit logs, which are off by default and must be explicitly enabled, feed a log sink into Pub/Sub (a managed publish/subscribe service for routing streams of events between systems), or directly into log-based metrics for simple threshold cases.
- Sensitive Data Protection. Runs on a schedule, or on write, to classify what a given bucket or table actually contains, so the detection logic can treat a large read from a table with no sensitive columns very differently from an equally large read against a table already flagged as containing sensitive identifiers.
- Alerting thresholds. Combine volume, an identity reading or exporting an unusually large fraction of a table or bucket relative to that identity's own baseline, with destination, an export or copy operation heading outside the organization, a public bucket or an external project, which VPC Service Controls (a perimeter around in-scope APIs) should already be blocking at the network boundary; the alert exists to catch whatever the perimeter's initial rules did not anticipate.
- Automated quarantine. On a high-confidence match, for example a public-facing IAM (Identity and Access Management) binding was just added to a bucket Sensitive Data Protection has flagged as sensitive, correlated from the audit log entry for that IAM change itself, not just the data access, a Cloud Function triggered off that log entry immediately revokes the added binding or disables the service account's key involved, moves the affected object or objects into a quarantine bucket with tightly restricted access, and pages on-call in parallel, rather than waiting for a human to act first.
Worked example
Illustratively: a service account with a historical baseline of reading roughly a few hundred rows a day from a customer table suddenly reads and exports the entire table, ninety thousand rows, in one call. Volume alone (a large multiple of that account's baseline) combined with the table's Sensitive Data Protection classification (flagged for containing personal identifiers) crosses the alerting threshold; the export destination check finds the target is an external project outside the organization, which pushes this from "investigate" to "auto-remediate now."
Trade-offs and pitfalls
An automated quarantine tuned too aggressively becomes a self-inflicted denial of service: a nightly batch job that reads an entire table for a legitimate ETL (extract, transform, load) run looks identical to exfiltration on volume alone without the identity and destination context, so thresholds need to be tuned per known-good pipeline identity rather than set as one global number. A common wrong turn is alerting only on Sensitive Data Protection findings and ignoring plain audit-log volume anomalies; Sensitive Data Protection's built-in categories do not cover every sensitive data type a specific business actually has, so anything not covered by a custom category it was never configured to recognize would exfiltrate without ever tripping that half of the detection. Quarantine actions should move and restrict, never delete, since deleting the affected data destroys the forensic evidence needed to actually investigate what happened.
You need to scale a GKE cluster to handle a seasonal peak that's 20 times the baseline traffic, then scale back down to control cost during the off-peak period. What would you do with node auto-provisioning, cluster autoscaler tuning, and surge upgrades, and how would you validate the scaling behavior ahead of the actual peak?
Sample Answer
Direct answer
Treat this as a steady-state problem with a seasonal problem layered on top, not one problem. First get the steady-state autoscaling right, a cluster comfortably serving a baseline load, say 1,000 requests per second per service at a 99.9 percent availability target, with pod disruption budgets protecting that availability during any voluntary disruption. Only then layer on the seasonal challenge: pre-provisioning enough headroom that the autoscaler isn't fighting a 20x step function on its own, using node auto-provisioning for capacity, careful cluster autoscaler tuning for how fast that capacity actually shows up, and surge upgrades so a routine node upgrade during the ramp doesn't compete with the scaling event for resources.
Building the plan
The steady-state foundation
A pod disruption budget (PDB, a policy that caps how many replicas of a service can be voluntarily taken down at once, for example during a node drain or cluster upgrade) protects the 99.9 percent availability target from your own maintenance actions, not just from traffic. At 1,000 requests per second with, say, 3 replicas required to stay available at all times, the PDB stops the cluster autoscaler or an upgrade from draining nodes in a way that would drop below that floor. Get this right before even thinking about the seasonal event, otherwise the 20x scale-up's own node churn can trip the exact availability floor you're trying to protect.
Node auto-provisioning
Node auto-provisioning (NAP) lets the cluster create entirely new node pools automatically, matching whatever machine shapes pending pods actually need, instead of forcing you to pre-create every node pool shape you might need for peak. At 20x scale, demand doesn't necessarily just mean "more of the same machine type," a spiky season might shift the mix toward, say, more memory-heavy replicas, and NAP adapts the node pool mix instead of forcing everything through pools sized for baseline.
Cluster autoscaler tuning
The default autoscaler reacts to pending pods, it does not anticipate them. For a 20x step function, tune scale-up responsiveness and consider a scheduled or metrics-driven pre-scale ahead of the known peak window rather than relying purely on reactive scale-up, because provisioning new nodes and pulling container images onto them takes real time that a purely reactive autoscaler spends after demand has already arrived. On the way down, tune scale-down delay and utilization thresholds conservatively enough that the cluster doesn't thrash, scaling down right before a secondary demand wave, then scaling back up, during a seasonal tail that doesn't drop instantly back to baseline.
Surge upgrades
A surge upgrade creates extra nodes before draining old ones during a cluster or node pool upgrade, so capacity never dips during the upgrade itself. During a scaling event this matters because a routine upgrade should never compete with the autoscaler for capacity right when every bit of it is needed, either avoid scheduling upgrades inside the peak window entirely, or size the surge generously enough that the upgrade adds temporary capacity instead of borrowing it from an already-stretched cluster.
Validating ahead of the actual peak
Load-test against a replica of the intended peak shape, not just the peak volume: the full 20x request rate, with the same request mix and downstream dependency call patterns as the real event, run far enough ahead of the actual peak that a discovered bottleneck can genuinely be fixed in time. Specifically test the scale-down behavior in this drill too, a cluster that scales up beautifully but flaps or drops capacity too early on the way back to baseline is still a production incident, just one that happens after everyone has stopped watching the dashboards as closely.
Worked example
A retail service running steady state at 1,000 requests per second across 3 baseline replicas per service needs to absorb a 20,000 requests-per-second seasonal peak, 20 times baseline. A drill 3 weeks out replays production-shaped traffic ramping from 1,000 to 20,000 requests per second over 30 minutes, matching the real event's expected ramp rate rather than an instant step, against a staging cluster running the same autoscaler and node auto-provisioning configuration as production. The drill surfaces that a downstream payment-processing dependency's connection pool caps out well before 20,000 requests per second is reached, a bottleneck that has nothing to do with GKE's autoscaler and would have caused an outage at the real peak regardless of how well the cluster itself scaled. Because this was caught 3 weeks ahead of the real event, the team had time to raise the connection pool limit, something no amount of cluster-autoscaler tuning would have fixed.
Trade-offs and pitfalls
Tuning the autoscaler and node auto-provisioning for the seasonal event while never revisiting the steady-state pod disruption budget is a common pitfall, teams then discover during the ramp-down that the availability floor was violated by the cluster's own scale-down actions, not by traffic. Load-testing raw request volume without matching request mix or ramp shape is another, a flat 20x step test can pass while a realistic 30-minute ramp with a different traffic mix fails, because real bottlenecks often live in a specific dependency the flat test never exercised. A third pitfall is leaving scale-down thresholds as aggressive as they'd be for a low-variance steady-state workload, which causes capacity flapping during a seasonal tail that doesn't taper cleanly. It's worth naming the cost trade-off explicitly: pre-provisioning ahead of a known peak costs real money for capacity that sits partly idle during the ramp-in window, that is the price of not discovering the autoscaler's reaction lag during the actual event instead.
Design a Zero Trust architecture for an enterprise that spans multiple clouds, using Identity-Aware Proxy, BeyondCorp principles, VPC Service Controls, and Private Service Connect. How would authentication, service-to-service communication, and short-lived credentials work together, and what would a pilot with a single application team look like?
Sample Answer
Direct answer
This is the perimeter-and-identity layer of zero trust, distinct from a service mesh's job of securing service-to-service traffic inside a single compute platform like GKE or Cloud Run. BeyondCorp is Google's underlying philosophy, access decisions based on device and user context rather than network location. Identity-Aware Proxy (IAP) is the enforcement point implementing that philosophy for human access to applications. VPC Service Controls draws a data-exfiltration perimeter around managed GCP services regardless of identity or IAM (Identity and Access Management) permissions. Private Service Connect gives services in different networks, including a different cloud, private connectivity to each other without that traffic ever traversing the public internet.
How the four pieces fit together
BeyondCorp and IAP: human access, replacing the VPN model
BeyondCorp's core claim is that being on the corporate network should grant zero implicit trust, every access decision is made per request based on who the user is, what device they're on, and other context, not on network location. IAP is the practical enforcement point specific to application access, it sits in front of an application and checks identity, device, and context against policy before the request is allowed through, replacing "connect to the VPN, then you're trusted" with a per-request check that works the same whether the user is in an office or on a coffee-shop network.
VPC Service Controls: the data-exfiltration perimeter
Where IAM answers "does this identity have permission," VPC Service Controls answers a different question entirely: "even with valid credentials, can data cross this boundary at all." It creates a perimeter around a set of GCP services such that data cannot be copied out to a resource outside the perimeter, even by someone with legitimate IAM permissions on both sides, which specifically defends against a stolen or overly broad credential being used to exfiltrate data, something IAM policy alone cannot stop since IAM can only say yes or no to an action, not "yes, but only within this boundary."
Private Service Connect: private cross-network connectivity
Lets a service in one network reach a service in another network, a different VPC, a different cloud, via a private internal address rather than the public internet or a full network peering that would expose more of each network to the other than necessary. For a multi-cloud enterprise, this is what lets a service on GCP privately reach a service hosted on another cloud, or vice versa via that cloud's own equivalent feature, without opening the traffic to the public internet.
Authentication, service-to-service, and short-lived credentials together
Human authentication runs through IAP plus the organization's identity provider via single sign-on, enforced per request, with no standing VPN trust. Service-to-service authentication uses Workload Identity for GCP-hosted services and Workload Identity Federation for services on another cloud calling GCP APIs, or that cloud's own equivalent mechanism for the reverse direction, all short-lived and scoped, with no long-lived credential ever copied between environments. Short-lived credentials are the common thread across all of it, whether it's a human's IAP-mediated session, a service's Workload Identity token, or a cross-cloud federated token, none of them remains valid and unrevoked for weeks or months, which is what makes "zero trust" more than a label, a compromised credential in this design has a short, bounded window of usefulness.
Piloting with a single application team
Pick one team with real cross-boundary access needs, calling another team's service, touching a sensitive data store, or serving both internal and external users, a team with a trivial access pattern won't exercise these mechanisms meaningfully. Put IAP in front of just that team's application first to confirm legitimate users aren't locked out, configure a VPC Service Controls perimeter scoped to just that team's sensitive services rather than organization-wide, so a misconfiguration has a contained blast radius (a small, bounded scope of what breaks, not an organization-wide outage), and set up Private Service Connect only for the specific cross-network dependency that team actually has. Measure the pilot on two things: did access break for anyone who should have had it, and can a deliberate attempt to move data across the new perimeter with valid but out-of-scope credentials be shown to fail.
Worked example
A finance application team needs employees to access sensitive financial reports, human access, IAP's job, while the application's backend also needs to privately call an analytics service hosted on a partner's account on another cloud, cross-cloud service-to-service, Private Service Connect's job, and the whole system must not let anyone, even with valid access, copy the underlying financial dataset out to an external storage bucket, VPC Service Controls' job. The pilot stands up IAP in front of the reporting application, a VPC Service Controls perimeter around the project holding the financial dataset, and Private Service Connect for the specific path to the partner's analytics service, all scoped to this one team. A test where a team member with legitimate IAM read access on the dataset attempts to export it to a personal storage bucket outside the perimeter fails as intended, concrete, checkable proof the pilot needs before expanding beyond one team, not just an absence of complaints so far.
Trade-offs and pitfalls
Rolling out VPC Service Controls organization-wide before understanding which legitimate data flows currently cross what will become perimeter boundaries is the most common way such a rollout causes an unplanned outage, some legitimate integration nobody inventoried gets blocked. Treating IAP as sufficient zero-trust coverage on its own is another mistake, IAP only covers human access to the applications it fronts, service-to-service traffic and data-exfiltration risk still need the other two mechanisms. A third pitfall is picking a pilot team with a simple, low-boundary-crossing access pattern because it's easier, that produces a pilot that "succeeds" without ever really testing the parts of the design that matter.
Design a secure GKE cluster for an enterprise with many teams sharing it. Cover network policies, RBAC, namespace isolation, Workload Identity, and how you'd enforce that only scanned, trusted images get admitted. How would you explain this design to a security team without making developers' lives miserable?
Sample Answer
Direct answer
Four independent layers, each closing a different attack surface: network policies restrict pod-to-pod traffic to only what's declared necessary, containing lateral movement; role-based access control (RBAC) and namespace isolation restrict who or what can act on the Kubernetes API itself; Workload Identity replaces long-lived service account keys inside pods with short-lived, per-workload credentials; and image admission control ensures only scanned, trusted images get scheduled at all. To a security team, these map onto four plain questions, can an attacker move sideways, can an attacker escalate privilege through the API, can a leaked credential be used broadly, and can untrusted code run here in the first place, which is a much stronger pitch than a bare feature list.
The four layers
Network policies, for lateral movement
Kubernetes NetworkPolicy objects are deny-by-default once any policy exists in a namespace, define exactly which pods can talk to which other pods, on which ports, instead of the flat, fully-open pod network GKE (Google Kubernetes Engine) gives you by default. This stops a compromised pod in one namespace from freely reaching a database-tier pod in another namespace just because they share the same cluster network.
RBAC and namespace isolation, for API-level control
RBAC governs who, or which service account, can perform which verbs on which API resource types, scoped to a namespace via RoleBindings rather than cluster-wide via ClusterRoleBindings wherever possible. Combined with namespace isolation, each team or environment in its own namespace with its own RBAC bindings, this stops a developer or a compromised CI/CD identity in one team's namespace from reading secrets or modifying deployments in another team's namespace.
Workload Identity, for credential exposure
Workload Identity binds a Kubernetes service account to a Google Cloud service account, so a pod authenticates to Google Cloud APIs with short-lived, automatically rotated credentials tied to its specific Kubernetes service account, with no downloaded key living inside the pod or the container image. This closes the same leaked-key risk that makes downloaded service account keys dangerous in general, applied specifically to workloads running inside the cluster.
Admission control, for image trust
An admission controller, Policy Controller for general policy or Binary Authorization specifically for image provenance, enforces that a pod can only be scheduled if its image passes policy: signed by a trusted build pipeline, scanned with no unresolved critical vulnerabilities, sourced from an approved registry. This answers "how do we know nothing untrusted is even running," independent of how well-behaved that code turns out to be once it is running.
Presenting this without making developers miserable
Frame each control around what it does not require developers to do manually: Workload Identity means developers stop thinking about service account keys at all, strictly less toil, not more. Image scanning happens in the CI pipeline before a developer's normal merge and deploy flow, so a failure surfaces as a familiar pipeline check, not a mysterious runtime rejection. Network policies should ship with a sensible default, allow within your own namespace, deny cross-namespace unless declared, so most teams never need to hand-write one. The one place friction is real, and should be named honestly, is a new cross-namespace dependency: a team that legitimately needs to call another team's service now has to explicitly request that network policy, a deliberate, reviewable speed bump, not an accident, and it's worth saying that out loud rather than pretending there's zero cost anywhere in this design.
Worked example
A developer's pod is compromised through an application-level vulnerability, unrelated to any of these four controls, they don't prevent the initial compromise, only what happens next. Network policy stops the compromised pod from reaching the database tier in a different namespace it was never declared to talk to. Even if it could reach something, RBAC means the pod's own service account has no permission to read Secrets or list workloads outside its own namespace. If the attacker tries to pivot to Google Cloud resources, Workload Identity means there's no downloaded key to steal, only a scoped, short-lived credential tied to that workload's narrow IAM grant. And the image that was compromised had already passed Binary Authorization, meaning the vulnerability was likely a runtime or application flaw rather than a known catalogued vulnerability (a CVE, a publicly documented security issue) the scan should have caught, a useful, honest thing to tell a security team, these controls narrow the blast radius of a compromise, they don't claim to prevent one.
Trade-offs and pitfalls
Rolling out NetworkPolicy cluster-wide with a default-deny stance and no migration plan is a common pitfall, it breaks every existing cross-namespace dependency at once and is exactly the kind of change that gives security controls a reputation for breaking things, roll it out namespace by namespace with existing traffic mapped first. Using ClusterRoleBindings out of convenience, because scoping every binding to a namespace is more setup work, quietly reintroduces the cross-team blast radius these controls exist to eliminate. Binary Authorization policies that are so strict any dependency update blocks a deploy, with no fast, reviewable exception path, teach teams to route around the control entirely, which defeats it. Being honest with the security team about the real, small, controlled friction this design does introduce buys credibility for the large amount of protection that costs developers nothing.
How would you explain the difference between GKE Standard and GKE Autopilot to a customer? Cover who's responsible for what, the cost model, and where each one is actually the better fit.
Sample Answer
Direct answer
GKE (Google Kubernetes Engine) Standard gives you the nodes: you choose machine types, size and manage node pools, and pay for those virtual machines whether or not they're fully utilized. GKE Autopilot removes the node layer from what you manage entirely, Google provisions, scales, and secures the underlying compute behind the scenes, and bills per pod based on the CPU and memory each pod actually requests, not for whole machines. The practical dividing line: pick Autopilot when you want the Kubernetes API without owning infrastructure operations, pick Standard when you need control over node-level specifics Autopilot restricts, particular hardware, custom node configuration, or workloads that don't fit neatly into per-pod billing.
Comparing responsibility, cost, and fit
Who's responsible for what
| Responsibility | GKE Standard | GKE Autopilot |
|---|---|---|
| Node provisioning and sizing | You choose machine types and manage node pools | |
| Node OS patching and upgrades | You schedule it (with optional automation) | Google, automatically |
| Pod scheduling and bin-packing (fitting many pods' resource needs efficiently onto a fixed set of nodes) | You reason about it across nodes | Google, you just declare requests |
| Security defaults (for example, disallowing privileged containers) | Your choice to configure | Enforced by default |
The cost model
On Standard, you pay for every node-hour of every virtual machine in your node pools regardless of whether pods are using 30 percent or 95 percent of that capacity, cost efficiency is on you, a bin-packing and autoscaler-tuning problem. On Autopilot, you pay per pod for the CPU and memory it actually requests, plus a modest per-pod premium over the equivalent raw compute price, which is the cost of Google handling bin-packing and node management for you. There's no "half-empty node" waste baked into the bill, but you also can't out-bin-pack Google's allocator the way a Standard user with a well-tuned autoscaler sometimes can. The one exception is a pod that requests a GPU, a TPU, or a specific Compute Engine machine series: those bill under a node-based model instead, the underlying hardware price plus a node management premium, not the per-pod-request price used for general-purpose pods.
Where each is the better fit
Autopilot fits teams without dedicated platform engineers, workloads with fairly standard resource shapes, and anyone whose priority is minimizing operational surface area even at the cost of some fine-grained hardware control. Standard fits a GPU or TPU (Tensor Processing Units, Google's custom AI accelerator chips) workload that needs something Autopilot's managed accelerator support doesn't expose, a pinned driver version rather than Autopilot's choice between "default" or "latest", an older or unusually-shaped multi-GPU topology, or an accelerator generation not yet certified on the cluster's Autopilot version, since Autopilot itself now runs most current-generation GPUs (T4 through the newest data-center chips) and TPUs directly rather than blocking accelerator workloads outright. Standard also fits DaemonSets (a Kubernetes object that automatically runs one copy of a pod on every node, used for node-level agents like log collectors) doing node-level work, very large or unusually shaped clusters where a dedicated platform team can genuinely out-tune the autoscaler, or any requirement that conflicts with Autopilot's mandatory security defaults.
Worked example
A team running a moderately bursty web API on Standard, with nodes averaging around 40 percent CPU utilization most of the day, is effectively paying for roughly 60 percent idle node capacity. Moving that workload to Autopilot, which bills per pod request rather than per whole node, means that structurally idle capacity is no longer paid for at all, the trade is Autopilot's per-pod premium over raw compute pricing, but for this team the eliminated waste from imperfect bin-packing outweighs that premium. A team running GPU-backed batch training with carefully tuned node pools and a platform engineer actively managing utilization may already be close to full node utilization on Standard, where Autopilot's node-based billing for GPU pods, the same underlying hardware price plus a management premium, would be a straightforward net cost increase with little offsetting benefit, since that team's own tuning is already capturing the bin-packing efficiency the premium exists to buy back.
Trade-offs and pitfalls
Assuming Autopilot is always cheaper is a common pitfall, it removes waste from poor bin-packing, it does not remove the underlying compute cost, and a team already running lean on Standard may pay more per unit of actual work on Autopilot. Choosing Standard by default "for control," without a workload that actually needs that control, means paying an operations team's time to manage node pools that add no value over what Autopilot would have handled automatically. It's also worth naming that cluster mode is set at creation, migrating between Standard and Autopilot means standing up a new cluster, so this deserves real evaluation up front rather than "we'll switch later if it doesn't work out." A second, dated assumption worth retiring: treating "needs a GPU or TPU" as an automatic reason to pick Standard. Autopilot now runs most current-generation accelerators directly, under the node-based billing described above, so the real question for an accelerator workload is whether it needs driver pinning, an exotic topology, or a generation Autopilot hasn't certified yet, not whether accelerators work on Autopilot at all.
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.