Google Cloud Professional Cloud Developer — Question 198

You are developing an application that needs to store files belonging to users in Cloud Storage. You want each user to have their own subdirectory in Cloud Storage. When a new user is created, the corresponding empty subdirectory should also be created. What should you do?

Answer options

Correct answer: A

Explanation

The correct answer is A because creating an object with a name that ends in a trailing slash ('/') effectively creates a folder in Cloud Storage. The other options either do not create the desired folder structure or involve unnecessary steps that do not achieve the requirement of creating an empty subdirectory.