Bird
Raised Fist0
GCPcloud~20 mins

Backend services and backend buckets in GCP - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Backend Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate
2:00remaining
How does a backend bucket serve content in GCP?

In Google Cloud Platform, a backend bucket is used with a load balancer to serve static content. What happens when a user requests a file that does not exist in the backend bucket?

AThe load balancer returns a 404 Not Found error to the user.
BThe load balancer redirects the user to the homepage of the backend bucket.
CThe load balancer automatically creates the missing file with default content.
DThe load balancer retries the request to other backend buckets automatically.
Attempts:
2 left
💡 Hint

Think about what happens when a file is missing in a static content server.

❓ Architecture
intermediate
2:00remaining
Choosing backend services vs backend buckets for a web app

You are designing a web application on GCP that serves both dynamic content from Compute Engine instances and static content like images and CSS files. Which architecture best uses backend services and backend buckets?

AUse separate load balancers for backend services and backend buckets without combining them.
BUse a backend service for Compute Engine instances to serve dynamic content and a backend bucket for static content, both behind the same HTTP(S) load balancer.
CUse backend services for static content and backend buckets for dynamic content.
DUse only backend buckets for all content because they are simpler to manage.
Attempts:
2 left
💡 Hint

Think about which backend type is optimized for dynamic vs static content.

❓ security
advanced
2:00remaining
Securing access to backend buckets

You want to restrict access to a backend bucket so only requests coming through your load balancer are allowed. Which method achieves this?

ADisable authentication on the load balancer to allow direct access to the bucket.
BSet the backend bucket to public so anyone can access it without restrictions.
CConfigure signed URLs or signed cookies on the backend bucket and require the load balancer to use them.
DUse firewall rules on the backend bucket to block all IP addresses except the load balancer.
Attempts:
2 left
💡 Hint

Think about how Cloud Storage controls access to objects.

❓ Configuration
advanced
2:00remaining
Configuring a backend service with health checks

You have a backend service with multiple Compute Engine instances. You want to ensure traffic is only sent to healthy instances. Which configuration is required?

ASet the backend service to use a static IP address for all instances.
BDisable health checks and rely on instance auto-healing only.
CConfigure the backend service to ignore instance health and send traffic to all instances equally.
DAttach a health check to the backend service that periodically probes each instance's health endpoint.
Attempts:
2 left
💡 Hint

Think about how load balancers detect unhealthy instances.

✅ Best Practice
expert
3:00remaining
Optimizing cache behavior for backend buckets in GCP

You want to optimize performance and reduce costs by caching static content served from a backend bucket behind a global HTTP(S) load balancer. Which approach follows best practices?

ASet Cache-Control headers on objects in the Cloud Storage bucket and enable Cloud CDN on the backend bucket.
BDisable caching on the backend bucket to always serve fresh content.
CConfigure the load balancer to bypass Cloud CDN and fetch directly from the backend bucket every time.
DUse backend services instead of backend buckets to enable caching automatically.
Attempts:
2 left
💡 Hint

Consider how HTTP caching works with Cloud CDN and backend buckets.

Practice

(1/5)
1. What is the main purpose of a backend service in Google Cloud Load Balancing?
easy
A. To manage user authentication and authorization
B. To connect the load balancer to server groups for dynamic content
C. To monitor network traffic between regions
D. To store static files like images and videos

Solution

  1. Step 1: Understand backend service role

    A backend service connects the load balancer to server groups that handle dynamic content like web apps.
  2. Step 2: Differentiate from backend bucket

    Backend buckets connect to Cloud Storage for static content, not dynamic server groups.
  3. Final Answer:

    To connect the load balancer to server groups for dynamic content -> Option B
  4. Quick Check:

    Backend service = dynamic content connection [OK]
Hint: Backend service = dynamic servers, backend bucket = static storage [OK]
Common Mistakes:
  • Confusing backend service with backend bucket
  • Thinking backend service stores static files
  • Assuming backend service manages authentication
2. Which of the following is the correct way to specify a backend bucket in a Google Cloud Load Balancer configuration?
easy
A. "backendService": "projects/my-project/global/backendBuckets/my-bucket"
B. "backendService": "projects/my-project/global/backendServices/my-service"
C. "backendBucket": "projects/my-project/global/backendServices/my-service"
D. "backendBucket": "projects/my-project/global/backendBuckets/my-bucket"

Solution

  1. Step 1: Identify correct field for backend bucket

    The field to specify a backend bucket is "backendBucket" with the bucket's full path.
  2. Step 2: Verify resource path matches backend bucket

    The resource path must include "backendBuckets" for a bucket, not "backendServices".
  3. Final Answer:

    "backendBucket": "projects/my-project/global/backendBuckets/my-bucket" -> Option D
  4. Quick Check:

    backendBucket field + backendBuckets path = correct [OK]
Hint: backendBucket key + backendBuckets path = backend bucket config [OK]
Common Mistakes:
  • Using backendService key for backend bucket
  • Mixing backendServices and backendBuckets in path
  • Incorrect resource path format
3. Given this backend service configuration snippet, what will happen if the health check fails for all instances in the backend?
{
  "name": "my-backend-service",
  "healthChecks": ["projects/my-project/global/healthChecks/my-check"],
  "backends": [{"group": "projects/my-project/zones/us-central1-a/instanceGroups/my-group"}]
}
medium
A. The load balancer will stop sending traffic to this backend service
B. The load balancer will continue sending traffic to the backend service regardless
C. The load balancer will delete the backend service automatically
D. The load balancer will redirect traffic to the backend bucket

Solution

  1. Step 1: Understand health check role

    Health checks monitor backend instances. If all fail, the backend is unhealthy.
  2. Step 2: Effect on load balancer traffic

    Load balancer stops sending traffic to unhealthy backends to avoid errors.
  3. Final Answer:

    The load balancer will stop sending traffic to this backend service -> Option A
  4. Quick Check:

    Health check fail = no traffic sent [OK]
Hint: Failed health checks stop traffic to backend service [OK]
Common Mistakes:
  • Assuming traffic continues despite health check failure
  • Thinking backend service is deleted automatically
  • Confusing backend service with backend bucket behavior
4. You configured a backend bucket for your load balancer but users report 403 errors when accessing static content. What is the most likely cause?
medium
A. The load balancer is not attached to any instance group
B. The backend service health check is failing
C. The backend bucket is missing the correct Cloud Storage permissions
D. The backend bucket name is misspelled in the load balancer config

Solution

  1. Step 1: Check backend bucket access

    Backend buckets serve static content from Cloud Storage, which requires proper permissions.
  2. Step 2: Identify cause of 403 errors

    Missing or incorrect permissions cause 403 errors because content cannot be accessed.
  3. Final Answer:

    The backend bucket is missing the correct Cloud Storage permissions -> Option C
  4. Quick Check:

    Missing permissions cause 403 on static content [OK]
Hint: 403 on static content usually means permission issues [OK]
Common Mistakes:
  • Confusing backend bucket with backend service health checks
  • Assuming instance groups affect backend buckets
  • Overlooking spelling errors as cause
5. You want to serve a website with both dynamic content from Compute Engine instances and static content from Cloud Storage using a single HTTP(S) load balancer. How should you configure the backend services and backend buckets?
hard
A. Create a backend service for the instance group and a backend bucket for the Cloud Storage bucket, then configure URL map to route requests accordingly
B. Create only a backend bucket and upload dynamic content to Cloud Storage
C. Create multiple backend services for both static and dynamic content and ignore backend buckets
D. Use a backend service for static content and a backend bucket for dynamic content

Solution

  1. Step 1: Understand content types and backends

    Dynamic content requires backend services connected to instance groups; static content uses backend buckets linked to Cloud Storage.
  2. Step 2: Configure URL map routing

    Use URL map rules to route requests to backend service or backend bucket based on URL paths.
  3. Final Answer:

    Create a backend service for the instance group and a backend bucket for the Cloud Storage bucket, then configure URL map to route requests accordingly -> Option A
  4. Quick Check:

    Dynamic = backend service, static = backend bucket, route with URL map [OK]
Hint: Use URL map to route dynamic to backend service, static to backend bucket [OK]
Common Mistakes:
  • Trying to serve dynamic content from backend bucket
  • Ignoring URL map routing configuration
  • Using backend service for static content
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