A Python job reads millions of customer files in Cloud Storage; regulatory requirement: delete customer data immediately when the job finishes. Minimize total completion time. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Add a final job step that deletes all objects in the bucket in bulk using batch requests to the Cloud Storage API..
Why this is the answer
The most efficient way to delete millions of objects immediately after a job finishes is to use batch requests to the Cloud Storage API. This method allows you to send multiple delete requests in a single HTTP call, significantly reducing network overhead and improving deletion speed. Object Lifecycle Management rules are for automated, policy-based deletions over time, not immediate, on-demand deletion at job completion. Removing the bucket from the Google Cloud console is not a programmatic solution and doesn't directly address the immediate deletion of objects within the bucket. While gcloud storage rm --recursive can delete objects, using the Cloud Storage API directly with batch requests offers finer control and often better performance for very large-scale, programmatic deletions.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed