Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your team manages a regional Cloud Storage bucket with Object Versioning enabled to store application media assets. You need to configure Object Lifecycle Management rules in a JSON configuration file to meet the following requirements:
5242880 bytes) and older than 90 days must transition to Nearline storage.2024-01-01 in Nearline storage must transition to Coldline storage.Which lifecycle configuration should you apply to the bucket?
Configure four rules:
SetStorageClass (NEARLINE) with age: 90, isLive: true, sizeAboveBytes: 5242880, and matchesStorageClass: ["STANDARD", "REGIONAL", "DURABLE_REDUCED_AVAILABILITY"].SetStorageClass (COLDLINE) with customTimeBefore: "2024-01-01" and matchesStorageClass: ["NEARLINE"].Delete with numNewerVersions: 3 and isLive: false.Delete with daysSinceCustomTime: 30 and isLive: false.This configuration correctly structures four separate rules and uses valid regional storage classes, but it substitutes customTimeBefore and daysSinceCustomTime in place of createdBefore and daysSinceNoncurrentTime.
Custom-Time metadata: Both customTimeBefore and daysSinceCustomTime evaluate the user-defined Custom-Time metadata field on each object rather than system-managed timestamps. Unless applications explicitly populate Custom-Time on every upload, these rules will not match any objects.2024-01-01, which requires createdBefore (evaluated against upload completion time), not customTimeBefore.daysSinceCustomTime measures days elapsed since the Custom-Time metadata value, not days elapsed since a live object was overwritten or deleted into a noncurrent state (daysSinceNoncurrentTime).Custom-Time independence: An object's Custom-Time metadata is set by the client (for example, at upload start) and does not automatically update when an object becomes noncurrent.createdBefore and age always reflect the object's upload completion timestamp, while daysSinceNoncurrentTime and noncurrentTimeBefore track versioning transitions automatically.This configuration would be appropriate if your media processing pipeline explicitly wrote a business-specific Custom-Time metadata timestamp (such as original media capture date) on every object and retention policies were governed by that custom timestamp rather than bucket creation and versioning times.
Confusing Custom-Time conditions with built-in object creation or versioning lifecycle timestamps is a frequent pitfall when designing automated Cloud Storage governance policies.
Configure four rules:
SetStorageClass (NEARLINE) with age: 90, isLive: true, sizeAboveBytes: 5242880, and matchesStorageClass: ["STANDARD", "REGIONAL", "DURABLE_REDUCED_AVAILABILITY"].SetStorageClass (COLDLINE) with createdBefore: "2024-01-01" and matchesStorageClass: ["NEARLINE"].Delete with numNewerVersions: 3 and isLive: false.Delete with daysSinceNoncurrentTime: 30 and isLive: false.This configuration uses Cloud Storage Object Lifecycle Management with four independent rules that combine storage class transition actions (SetStorageClass) and automated deletion actions (Delete). Separating the deletion conditions into distinct rules ensures that each rule operates with logical OR evaluation across rules while preserving logical AND evaluation within each individual rule.
SetStorageClass to NEARLINE only when all four conditions are satisfied simultaneously: the object is live (isLive: true), older than 90 days (age: 90), larger than 5 MiB (sizeAboveBytes: 5242880), and stored in STANDARD, REGIONAL, or DURABLE_REDUCED_AVAILABILITY. Including REGIONAL and DURABLE_REDUCED_AVAILABILITY covers legacy regional objects without triggering the error caused by specifying MULTI_REGIONAL on a regional bucket.createdBefore: "2024-01-01" alongside matchesStorageClass: ["NEARLINE"], transitioning qualifying objects to COLDLINE.numNewerVersions: 3) and Rule 4 (daysSinceNoncurrentTime: 30) separately deletes a noncurrent version as soon as either threshold is reached.isLive: false on both Delete rules explicitly restricts deletion to noncurrent object versions, protecting live objects.sizeAboveBytes so Class A operation transition fees do not outweigh storage savings.SetStorageClass transitions preserve existing time spent in the original class toward minimum storage durations without retrieval charges.Only this configuration accurately models all regional storage classes, size thresholds, creation dates, and OR-based noncurrent cleanup criteria without risking accidental deletion of live objects or configuration validation errors.
Configure four rules:
SetStorageClass (NEARLINE) with age: 90, isLive: true, sizeAboveBytes: 5242880, and matchesStorageClass: ["STANDARD", "MULTI_REGIONAL"].SetStorageClass (COLDLINE) with createdBefore: "2024-01-01" and matchesStorageClass: ["NEARLINE"].Delete with numNewerVersions: 3 and isLive: false.Delete with age: 30.This configuration attempts to transition objects using matchesStorageClass: ["STANDARD", "MULTI_REGIONAL"] and deletes older objects using a Delete rule based solely on age: 30 without an isLive filter.
MULTI_REGIONAL inside matchesStorageClass on a regional bucket causes Cloud Storage to reject the configuration with an error (400 Bad Request) when you attempt to apply it.age: 30 without isLive: false. Because age is measured from the object's original creation time, any live object older than 30 days matches Rule 4 and is deleted (moving it to a noncurrent state).age measures days since initial upload completion rather than days since becoming noncurrent (daysSinceNoncurrentTime), which violates the 30-day noncurrent retention window.Delete takes precedence over SetStorageClass when conditions are satisfied simultaneously, live objects older than 90 days would be deleted rather than transitioned to Nearline.REGIONAL and DURABLE_REDUCED_AVAILABILITY, never MULTI_REGIONAL.age applies to total object lifetime from upload completion, whereas daysSinceNoncurrentTime tracks time elapsed since replacement or deletion.Delete always overrides SetStorageClass.Using MULTI_REGIONAL would only be valid on a multi-region or dual-region bucket, and age: 30 without isLive: false would only be suitable if you intentionally wanted to delete live objects 30 days after creation.
Configure three rules:
SetStorageClass (NEARLINE) with age: 90, isLive: true, sizeAboveBytes: 5242880, and matchesStorageClass: ["STANDARD", "REGIONAL", "DURABLE_REDUCED_AVAILABILITY"].SetStorageClass (COLDLINE) with createdBefore: "2024-01-01" and matchesStorageClass: ["NEARLINE"].Delete rule combining numNewerVersions: 3, daysSinceNoncurrentTime: 30, and isLive: false.This configuration correctly sets up the two SetStorageClass transition rules for NEARLINE and COLDLINE, but merges both noncurrent cleanup conditions (numNewerVersions and daysSinceNoncurrentTime) into a single Delete rule.
numNewerVersions: 3 and daysSinceNoncurrentTime: 30 in the same Delete rule, Cloud Storage treats them as an AND condition.Delete action.This configuration would be appropriate if the retention policy required keeping every noncurrent version for at least 30 days and ensuring at least 3 newer versions existed before permanent deletion.
A common misconception when writing lifecycle JSON rules is assuming multiple conditions inside one condition object act as independent triggers. Always split independent deletion triggers into separate rule blocks.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated