Bird
Raised Fist0
GCPcloud~20 mins

Requester pays configuration in GCP - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Requester Pays Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Requester Pays buckets in GCP

What is the main purpose of enabling the Requester Pays feature on a Google Cloud Storage bucket?

ATo automatically encrypt all data in the bucket using requester-provided keys.
BTo prevent any charges for data access by making the bucket free for all users.
CTo make the bucket owner pay for all data access costs regardless of who accesses the data.
DTo require users accessing the bucket to pay for the data access costs instead of the bucket owner.
Attempts:
2 left
💡 Hint

Think about who is billed for data access when Requester Pays is enabled.

Configuration
intermediate
2:00remaining
Enabling Requester Pays on a GCP bucket

Which of the following gcloud commands correctly enables Requester Pays on a bucket named my-data-bucket?

Agcloud storage buckets update my-data-bucket --requester-pays
Bgcloud storage buckets update my-data-bucket --billing requesterPays=true
Cgcloud storage buckets update my-data-bucket --enable-requester-pays
Dgcloud storage buckets update my-data-bucket --billing requester-pays
Attempts:
2 left
💡 Hint

Check the exact flag name used to enable Requester Pays in gcloud commands.

service_behavior
advanced
2:00remaining
Accessing a Requester Pays bucket without billing project

What happens if a user tries to list objects in a Requester Pays bucket without specifying a billing project?

AThe request succeeds and the bucket owner is billed for the access.
BThe request fails with a 400 Bad Request error indicating billing project is required.
CThe request succeeds but the user is billed for the access automatically.
DThe request is queued until a billing project is specified.
Attempts:
2 left
💡 Hint

Requester Pays requires a billing project to be specified by the requester.

security
advanced
2:00remaining
Security implications of Requester Pays buckets

Which security consideration is most important when enabling Requester Pays on a bucket?

AUsers must have permission to specify a billing project, which can expose billing information if misconfigured.
BEnabling Requester Pays restricts access only to users with billing accounts.
CRequester Pays buckets automatically encrypt data with customer-managed keys.
DRequester Pays disables all public access to the bucket.
Attempts:
2 left
💡 Hint

Think about what permissions users need to access Requester Pays buckets.

Architecture
expert
3:00remaining
Designing a multi-tenant data sharing architecture with Requester Pays

You manage a GCP bucket shared by multiple external teams. You want each team to pay only for their own data access costs. Which architecture best achieves this using Requester Pays?

AEnable Requester Pays and share a single billing project with all teams to simplify billing.
BDisable Requester Pays and have the bucket owner pay all access costs, then invoice teams manually.
CEnable Requester Pays on the bucket and require each team to use their own billing project when accessing data.
DUse separate buckets for each team without Requester Pays to isolate billing.
Attempts:
2 left
💡 Hint

Requester Pays is designed to shift billing to the requester. How can you leverage this for multiple teams?

Practice

(1/5)
1. What does enabling Requester Pays on a Google Cloud Storage bucket do?
easy
A. It makes the bucket owner pay for all data access costs.
B. It disables public access to the bucket.
C. It makes the user accessing the data pay for the access costs.
D. It encrypts the data in the bucket automatically.

Solution

  1. Step 1: Understand Requester Pays concept

    Requester Pays shifts the cost of data access from the bucket owner to the user who requests the data.
  2. Step 2: Identify the cost responsibility

    When enabled, the user accessing the bucket pays for network and operation costs, not the owner.
  3. Final Answer:

    It makes the user accessing the data pay for the access costs. -> Option C
  4. Quick Check:

    Requester Pays = user pays [OK]
Hint: Requester Pays means user pays for data access costs [OK]
Common Mistakes:
  • Thinking bucket owner always pays
  • Confusing with access permissions
  • Assuming it encrypts data
2. Which command correctly enables Requester Pays on a bucket named my-data-bucket?
easy
A. gsutil set requesterpay gs://my-data-bucket on
B. gsutil requester-pays enable gs://my-data-bucket
C. gsutil enable requester-pays gs://my-data-bucket
D. gsutil requesterpay set on gs://my-data-bucket

Solution

  1. Step 1: Recall the correct gsutil syntax

    The correct command to enable Requester Pays is gsutil requesterpay set on followed by the bucket URL.
  2. Step 2: Match the command with the bucket name

    gsutil requesterpay set on gs://my-data-bucket uses the exact syntax and bucket name correctly.
  3. Final Answer:

    gsutil requesterpay set on gs://my-data-bucket -> Option D
  4. Quick Check:

    Correct gsutil syntax = gsutil requesterpay set on gs://my-data-bucket [OK]
Hint: Use 'gsutil requesterpay set on' to enable Requester Pays [OK]
Common Mistakes:
  • Using incorrect command verbs like 'enable'
  • Misplacing 'requesterpay' keyword
  • Wrong order of command arguments
3. Given a bucket with Requester Pays enabled, which gsutil command will successfully copy a file named data.csv from the bucket gs://example-bucket to your local machine?
medium
A. gsutil cp --requester-pays gs://example-bucket/data.csv ./
B. gsutil cp gs://example-bucket/data.csv ./
C. gsutil cp --enable-requester-pays gs://example-bucket/data.csv ./
D. gsutil cp --requesterpay gs://example-bucket/data.csv ./

Solution

  1. Step 1: Understand Requester Pays access requirement

    When accessing a Requester Pays bucket, the user must include the --requester-pays flag in the gsutil command.
  2. Step 2: Identify the correct flag usage

    gsutil cp --requester-pays gs://example-bucket/data.csv ./ uses the correct flag --requester-pays with the copy command.
  3. Final Answer:

    gsutil cp --requester-pays gs://example-bucket/data.csv ./ -> Option A
  4. Quick Check:

    Use --requester-pays flag to access Requester Pays buckets [OK]
Hint: Add --requester-pays flag to gsutil commands for Requester Pays buckets [OK]
Common Mistakes:
  • Omitting the --requester-pays flag
  • Using incorrect flag names
  • Assuming normal commands work without flags
4. You try to download a file from a Requester Pays bucket without the --requester-pays flag and get an error. What is the most likely fix?
medium
A. Use a different gsutil version.
B. Add the --requester-pays flag to your gsutil command.
C. Change the bucket permissions to public.
D. Disable Requester Pays on the bucket.

Solution

  1. Step 1: Identify cause of error

    Accessing a Requester Pays bucket without the --requester-pays flag causes permission errors because the user is not accepting cost responsibility.
  2. Step 2: Apply the correct fix

    Adding the --requester-pays flag tells Google Cloud you accept the charges, fixing the error.
  3. Final Answer:

    Add the --requester-pays flag to your gsutil command. -> Option B
  4. Quick Check:

    Missing --requester-pays flag causes errors [OK]
Hint: Add --requester-pays flag to fix access errors [OK]
Common Mistakes:
  • Trying to disable Requester Pays without permission
  • Changing bucket permissions unnecessarily
  • Assuming gsutil version causes this error
5. You manage a public dataset bucket with Requester Pays enabled. A user complains they cannot access data using the Google Cloud Console UI. What is the best advice to help them access the data?
hard
A. Tell them to use gsutil with the --requester-pays flag for data access.
B. Advise them to disable Requester Pays on the bucket.
C. Instruct them to request access permissions from the bucket owner.
D. Suggest they use the Cloud Console without any special flags.

Solution

  1. Step 1: Understand Requester Pays impact on access methods

    Requester Pays requires users to explicitly accept cost responsibility, usually via command flags like --requester-pays or a confirmation prompt in the UI.
  2. Step 2: Identify supported access methods

    While the Cloud Console UI supports Requester Pays with a billing-enabled project and charge acceptance prompt, recommend gsutil with the --requester-pays flag as a reliable alternative when facing UI access issues.
  3. Final Answer:

    Tell them to use gsutil with the --requester-pays flag for data access. -> Option A
  4. Quick Check:

    Use gsutil + --requester-pays for Requester Pays buckets [OK]
Hint: Use gsutil with --requester-pays for reliable access to Requester Pays buckets [OK]
Common Mistakes:
  • Assuming Console UI works without project billing enabled
  • Telling users to disable Requester Pays
  • Confusing permissions with billing flags