Bird
Raised Fist0
GCPcloud~20 mins

GKE vs Cloud Run decision in GCP - Practice Questions

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
GKE vs Cloud Run Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
When to choose GKE over Cloud Run?

You have a containerized application that requires fine-grained control over networking, persistent storage, and custom scheduling. Which platform is the best choice?

AUse GKE because it allows detailed control over networking, storage, and scheduling of containers.
BUse Cloud Run because it automatically scales and manages infrastructure without user control.
CUse Cloud Run because it supports stateful applications with persistent disks natively.
DUse GKE only if you want serverless deployment without managing clusters.
Attempts:
2 left
💡 Hint

Think about which platform gives you more control over infrastructure details.

❓ service_behavior
intermediate
2:00remaining
How does Cloud Run scale compared to GKE?

Consider a web service deployed on both Cloud Run and GKE. Which statement correctly describes their scaling behavior?

AGKE scales automatically without any configuration, Cloud Run requires manual scaling settings.
BBoth Cloud Run and GKE scale only when manually triggered by the user.
CCloud Run scales automatically based on incoming requests, while GKE requires manual or configured autoscaling.
DCloud Run cannot scale beyond one instance, GKE can scale to many nodes automatically.
Attempts:
2 left
💡 Hint

Think about which platform is fully managed and serverless.

❓ Architecture
advanced
3:00remaining
Designing a hybrid app with GKE and Cloud Run

You want to build an app where the backend API needs custom networking and persistent storage, but the frontend is a stateless service with unpredictable traffic. Which architecture is best?

ADeploy both backend and frontend on Cloud Run for simplicity and automatic scaling.
BDeploy backend on Cloud Run with persistent disks, frontend on GKE for better traffic handling.
CDeploy both backend and frontend on GKE to keep all services in one cluster.
DDeploy backend on GKE for control and persistent storage, frontend on Cloud Run for serverless scaling.
Attempts:
2 left
💡 Hint

Consider which platform supports persistent storage and which supports serverless scaling best.

❓ security
advanced
3:00remaining
Security differences between GKE and Cloud Run

Which statement correctly describes a key security difference between GKE and Cloud Run?

AGKE automatically isolates containers with sandboxing, Cloud Run runs containers directly on host OS.
BCloud Run runs containers in isolated sandboxes managed by Google, reducing attack surface compared to GKE nodes.
CBoth GKE and Cloud Run require manual patching of the underlying OS for security updates.
DCloud Run requires users to manage Kubernetes RBAC policies, GKE does not.
Attempts:
2 left
💡 Hint

Think about who manages the infrastructure and isolation in each platform.

✅ Best Practice
expert
4:00remaining
Cost optimization when choosing between GKE and Cloud Run

Your team wants to minimize costs for a microservices app with variable traffic and some stateful components. Which approach best optimizes cost?

ARun stateless microservices on Cloud Run to pay per use, and stateful components on GKE with autoscaling.
BRun all microservices on GKE with a large cluster to handle peak load at all times.
CRun all microservices on Cloud Run to avoid cluster management and fixed costs.
DRun stateful components on Cloud Run with persistent disks and stateless on GKE for better control.
Attempts:
2 left
💡 Hint

Consider which platform charges you only when used and which is better for stateful workloads.

Practice

(1/5)
1. Which service should you choose if you want to avoid managing servers and focus only on deploying containers?
easy
A. Compute Engine
B. Google Kubernetes Engine (GKE)
C. App Engine Standard
D. Cloud Run

Solution

  1. Step 1: Understand server management needs

    Cloud Run is serverless, so it handles server management automatically.
  2. Step 2: Compare with GKE

    GKE requires managing Kubernetes clusters and nodes, which means more management effort.
  3. Final Answer:

    Cloud Run -> Option D
  4. Quick Check:

    Serverless = Cloud Run [OK]
Hint: Serverless means no server management needed [OK]
Common Mistakes:
  • Confusing GKE as serverless
  • Choosing Compute Engine which is VM-based
  • Thinking App Engine Standard is container-focused
2. Which of the following is the correct way to deploy a container image to Cloud Run using gcloud CLI?
easy
A. gcloud run deploy SERVICE --image IMAGE_URL --platform managed
B. gcloud container clusters create SERVICE --image IMAGE_URL
C. gcloud compute instances create SERVICE --image IMAGE_URL
D. gcloud app deploy --image IMAGE_URL

Solution

  1. Step 1: Identify Cloud Run deployment command

    The correct command uses gcloud run deploy with the service name and image URL.
  2. Step 2: Eliminate other commands

    Other options relate to Kubernetes clusters, VM instances, or App Engine, which are incorrect for Cloud Run.
  3. Final Answer:

    gcloud run deploy SERVICE --image IMAGE_URL --platform managed -> Option A
  4. Quick Check:

    Cloud Run deploy uses gcloud run deploy [OK]
Hint: Cloud Run deploy always uses 'gcloud run deploy' [OK]
Common Mistakes:
  • Using 'gcloud container clusters create' for Cloud Run
  • Confusing Compute Engine commands with Cloud Run
  • Using App Engine deploy command for Cloud Run
3. You deploy a containerized app to GKE with autoscaling enabled. What happens when traffic suddenly spikes?
medium
A. Cloud Run automatically pauses the service until traffic decreases.
B. GKE automatically adds more pods to handle the increased load.
C. GKE shuts down pods to save resources during high traffic.
D. Cloud Run requires manual scaling to handle traffic spikes.

Solution

  1. Step 1: Understand GKE autoscaling behavior

    GKE uses Horizontal Pod Autoscaler to add pods automatically when traffic increases.
  2. Step 2: Compare with Cloud Run behavior

    Cloud Run scales automatically but does not pause services; manual scaling is not required.
  3. Final Answer:

    GKE automatically adds more pods to handle the increased load. -> Option B
  4. Quick Check:

    GKE autoscaling adds pods on traffic spike [OK]
Hint: GKE autoscaling adds pods automatically on load [OK]
Common Mistakes:
  • Thinking Cloud Run pauses services on high traffic
  • Believing GKE shuts down pods during spikes
  • Assuming Cloud Run needs manual scaling
4. You tried deploying a container to Cloud Run but got an error about missing CPU allocation. What is the likely cause?
medium
A. You did not specify the CPU limit in the deployment command.
B. Cloud Run does not support containers with CPU requirements.
C. You deployed to GKE instead of Cloud Run by mistake.
D. The container image is not compatible with Cloud Run.

Solution

  1. Step 1: Understand Cloud Run CPU allocation

    Cloud Run requires CPU allocation settings; missing these can cause errors.
  2. Step 2: Check deployment command

    If CPU limits are not specified, Cloud Run deployment fails with CPU allocation errors.
  3. Final Answer:

    You did not specify the CPU limit in the deployment command. -> Option A
  4. Quick Check:

    Missing CPU limit causes deployment error [OK]
Hint: Always specify CPU limits when deploying to Cloud Run [OK]
Common Mistakes:
  • Assuming Cloud Run ignores CPU settings
  • Confusing GKE deployment with Cloud Run
  • Blaming container image compatibility without checking CPU
5. Your team needs to run a complex microservices app with custom networking, persistent storage, and fine-grained control over scaling. Which service is best?
hard
A. Cloud Run because it handles all scaling automatically
B. Cloud Functions because it runs code without servers
C. GKE because it supports complex orchestration and custom setups
D. App Engine because it is fully managed and simple

Solution

  1. Step 1: Analyze app requirements

    The app needs complex orchestration, custom networking, persistent storage, and detailed scaling control.
  2. Step 2: Match requirements to services

    GKE supports Kubernetes features for complex setups, while Cloud Run is simpler and serverless but less customizable.
  3. Final Answer:

    GKE because it supports complex orchestration and custom setups -> Option C
  4. Quick Check:

    Complex control needs = GKE [OK]
Hint: Complex apps with custom needs use GKE [OK]
Common Mistakes:
  • Choosing Cloud Run for complex networking
  • Confusing App Engine with container orchestration
  • Using Cloud Functions for microservices orchestration
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard