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.
A media processing platform allows external partners without Google accounts to upload video files directly to a private Cloud Storage bucket using a single HTTP request per file. Your team is implementing a custom V4 signed URL generator with the following requirements:
https://storage.googleapis.com/media-ingest/uploads/clip.mp4172800 seconds) from issuancecontent-type set to video/mp4 along with the host headerWhich configuration of HTTP verb, expiration parameters, and canonical request structure correctly constructs the V4 signed URL?
PUT, set X-Goog-Date as a Unix epoch timestamp with X-Goog-Expires set to the future Unix epoch expiration timestamp, sort query parameters lexicographically (excluding X-Goog-Signature), format canonical headers in lowercase sorted order without spaces around colons (content-type:video/mp4 and host:storage.googleapis.com), and set X-Goog-SignedHeaders=content-type;host.This option correctly selects PUT and formats the canonical headers and query string sorting, but it uses Unix epoch timestamps (seconds since January 1, 1970 UTC) for X-Goog-Date and X-Goog-Expires instead of the required V4 date and duration formats.
X-Goog-Date format: V4 signing strictly requires X-Goog-Date to use the ISO 8601 basic format (YYYYMMDD'T'HHMMSS'Z', such as 20250115T120000Z). Passing a Unix epoch integer causes Cloud Storage to reject the request as malformed.X-Goog-Expires value: In V4 signed URLs, X-Goog-Expires does not represent an absolute point in time; it specifies a relative lifetime in seconds measured from X-Goog-Date, with an upper bound of 604800 seconds (7 days). Providing a current Unix epoch timestamp (over 1.7 billion seconds) exceeds the 604,800-second maximum.X-Goog-Date must match the date used in the X-Goog-Credential credential scope.X-Goog-Date to account for clock skew and remain valid for X-Goog-Expires seconds.X-Goog-Expires value greater than 604800 is invalid in V4 signing.No valid V4 signed URL uses Unix epoch timestamps for X-Goog-Date or X-Goog-Expires; Unix epoch Expires timestamps were used in the legacy V2 signing process and in Cloud CDN signed URLs.
Confusing V2's absolute Unix epoch Expires parameter with V4's relative X-Goog-Expires duration is a frequent migration pitfall when moving from legacy signing implementations to V4.
POST, configure X-Goog-Date in YYYYMMDD'T'HHMMSS'Z' format with X-Goog-Expires=172800, sort query parameters lexicographically (excluding X-Goog-Signature), format canonical headers in lowercase sorted order without spaces around colons (content-type:video/mp4 and host:storage.googleapis.com), and set X-Goog-SignedHeaders=content-type;host.This option correctly formats the V4 canonical headers, signed headers list, ISO 8601 timestamp, and lexicographically sorted query parameters, but it specifies POST as the HTTP verb in the canonical request for a single-request file upload.
POST HTTP verb is strictly restricted to initiating a resumable upload session, not performing a direct single-request object upload.PUT against a URL signed with POST, Cloud Storage computes a different canonical request and rejects the request with a signature mismatch error.DELETE, GET, HEAD, POST, and PUT.PUT is the designated verb for uploading an object in a single HTTP request.POST signed URLs require an x-goog-resumable:start header or resumable upload initiation workflow, followed by subsequent chunk uploads.POST form uploads use a Base64-encoded JSON policy document rather than a standard V4 signed URL canonical request.The upload architecture required partners to initiate a multi-step resumable upload session via POST (typically paired with x-goog-resumable:start) rather than uploading the entire video file in a single HTTP request.
Many developers associate HTTP POST with creating resources in REST APIs, which leads to confusion when working with Cloud Storage XML API signed URLs where single-request object creation uses PUT.
PUT, configure X-Goog-Date in YYYYMMDD'T'HHMMSS'Z' format with X-Goog-Expires=172800, sort query parameters lexicographically (excluding X-Goog-Signature), format canonical headers in lowercase sorted order without spaces around colons (content-type:video/mp4 and host:storage.googleapis.com), and set X-Goog-SignedHeaders=content-type;host.A Cloud Storage V4 signed URL grants time-limited, delegated access to a specific bucket or object over XML API endpoints without requiring the requester to have a Google Cloud identity. To authenticate the request, the signing application constructs a deterministic canonical request, hashes it with SHA-256 into a string-to-sign, and signs that string using an RSA private key or HMAC secret.
PUT HTTP verb in the canonical request authorizes a single HTTP request to write the object data directly to /media-ingest/uploads/clip.mp4.X-Goog-Date in ISO 8601 basic format (YYYYMMDD'T'HHMMSS'Z') establishes the start of the active window, while X-Goog-Expires=172800 sets the lifetime to 48 hours (172,800 seconds), well within the V4 maximum limit of 604,800 seconds (7 days).content-type before host), and removing whitespace after the colon (content-type:video/mp4 and host:storage.googleapis.com) guarantees the server reproduces the exact same canonical hash.X-Goog-Signature ensures the signature validates cleanly when appended to the final URL.content-type: video/mp4.X-Goog-SignedHeaders, with host properly included.GOOG4-RSA-SHA256 or GOOG4-HMAC-SHA256.This configuration is the only option that simultaneously uses the correct HTTP method for single-request uploads, applies V4-compliant ISO 8601 and relative-second expiration fields, and adheres to canonical formatting rules so Cloud Storage computes an identical signature.
PUT, configure X-Goog-Date in YYYYMMDD'T'HHMMSS'Z' format with X-Goog-Expires=172800, include X-Goog-Signature in the sorted canonical query string, preserve standard HTTP header spacing in canonical headers (host: storage.googleapis.com and content-type: video/mp4), and set X-Goog-SignedHeaders=host;content-type.This option uses the correct PUT verb and valid V4 expiration parameters (X-Goog-Date and X-Goog-Expires), but it breaks three fundamental rules when constructing the canonical request string.
X-Goog-Signature in the canonical query string: The canonical request is the input used to generate the signature itself. Therefore, X-Goog-Signature must be excluded from the canonical query string and appended only after signing the string-to-sign.host: storage.googleapis.com) causes Cloud Storage to compute a different canonical request hash than the client, resulting in a 403 Forbidden signature mismatch error.X-Goog-SignedHeaders must be sorted lexicographically by code point value. Placing host before content-type violates alphabetical sorting (c precedes h).A configuration with these formatting errors would never produce a valid V4 signed URL; it would only match Cloud Storage validation if X-Goog-Signature were excluded from the canonical query string, colons had no surrounding spaces, and headers were sorted as content-type followed by host.
Standard HTTP libraries often serialize headers with a space after the colon, so custom V4 signers must explicitly trim whitespace around colons and sort headers before hashing.
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