0
0
GCPcloud~20 mins

Deploying workloads in GCP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
πŸŽ–οΈ
Cloud Workload Deployment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate
2:00remaining
Understanding GKE Pod Scheduling Behavior

You deploy a Kubernetes Pod on Google Kubernetes Engine (GKE) with a node selector that matches no nodes. What will happen to the Pod?

GCP
apiVersion: v1
kind: Pod
metadata:
  name: test-pod
spec:
  containers:
  - name: nginx
    image: nginx
  nodeSelector:
    disktype: ssd
AThe Pod will remain in Pending state indefinitely because no nodes match the selector.
BThe Pod will be scheduled on any available node ignoring the nodeSelector.
CThe Pod will be deleted automatically by GKE after 5 minutes.
DThe Pod will start running on the master node.
Attempts:
2 left
πŸ’‘ Hint

Think about how Kubernetes schedules Pods with node selectors.

❓ Architecture
intermediate
2:00remaining
Choosing the Right Compute Service for a Stateless Web App

You want to deploy a stateless web application that must scale automatically based on HTTP traffic. Which Google Cloud service is the best choice?

AGoogle App Engine Standard Environment with automatic scaling.
BGoogle Compute Engine with manual instance group scaling.
CGoogle Kubernetes Engine with a single node cluster.
DCloud Functions triggered by HTTP requests.
Attempts:
2 left
πŸ’‘ Hint

Consider which service offers automatic scaling for web apps without managing infrastructure.

❓ security
advanced
2:00remaining
Securing Workloads with Service Accounts

You deploy a workload on Google Cloud Run that needs to access a Cloud Storage bucket securely. What is the best practice to grant access?

AUse a user’s personal credentials to access the bucket from the Cloud Run service.
BAssign the Cloud Run service's default service account the Storage Object Viewer role on the bucket.
CEmbed the Cloud Storage credentials as environment variables in the Cloud Run service.
DMake the Cloud Storage bucket public so Cloud Run can access it without credentials.
Attempts:
2 left
πŸ’‘ Hint

Think about the principle of least privilege and secure identity management.

❓ Configuration
advanced
2:00remaining
Configuring Autoscaling for a GKE Deployment

You want to configure Horizontal Pod Autoscaling (HPA) for a GKE Deployment based on CPU usage. Which YAML snippet correctly defines the HPA?

A
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: webapp-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: webapp
  minReplicas: 2
  maxReplicas: 10
  metrics:
  - type: Pods
    pods:
      metric:
        name: cpu
      target:
        type: AverageValue
        averageValue: 50m
B
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: webapp-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: webapp
  minReplicas: 2
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 50
C
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: webapp-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: webapp
  minReplicas: 2
  maxReplicas: 10
  targetMemoryUtilizationPercentage: 50
D
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: webapp-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: webapp
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilizationPercentage: 50
Attempts:
2 left
πŸ’‘ Hint

Look for the correct apiVersion and field names for CPU-based autoscaling.

βœ… Best Practice
expert
2:00remaining
Designing a Multi-Region Deployment for High Availability

You need to deploy a web application on Google Cloud to achieve high availability across multiple regions. Which architecture follows best practices?

ADeploy the application in multiple zones within a single region and rely on client-side retries for failover.
BDeploy the application in multiple regions with independent databases and use DNS round-robin to distribute traffic.
CDeploy the application in multiple regions with a global HTTP(S) Load Balancer and a multi-region managed database with replication.
DDeploy the application in a single region with multiple zones and use a global HTTP(S) Load Balancer with Cloud CDN.
Attempts:
2 left
πŸ’‘ Hint

Consider global load balancing and data consistency across regions.