Google Professional Cloud Developer exam dumps

Google Professional Cloud Developer practice question 325 of 481

Professional Cloud Developer. Professional level, Google Cloud. Free question with the correct answer and a full explanation.

Google Professional Cloud Developer Question 325

Select 3Google Cloud Platform

You are developing a RESTful API for a financial application and need to implement API versioning to ensure backward compatibility while rolling out new features. You decide to use Apigee to manage your API. Which of the following practices should you follow to properly implement API versioning?

  1. A

    Include the version number in the URL path, such as '/v1/accounts'.

  2. B

    Use a custom HTTP header to specify the API version, such as 'X-Api-Version'.

  3. C

    Embed the version number in the query string, such as '?version=1'.

  4. D

    Deprecate older API versions immediately after releasing a new version.

  5. E

    Document each API version comprehensively and provide clear migration guides.

Show answer and explanation

Correct answers: A, B, E

Explanation

API versioning is critical for maintaining backward compatibility and ensuring a smooth transition when introducing new features. Including the version in the URL path or using HTTP headers are established best practices for versioning with tools like Apigee. Comprehensive documentation and migration guides further enhance developer experience and adoption. However, embedding the version in the query string is less preferred, and immediate deprecation of older versions is not advisable as it can disrupt existing users.

  • A. Correct.

    Including the version number in the URL path is one of the most common and widely accepted best practices for API versioning, as it is explicit and easy to manage.

  • B. Correct.

    Using a custom HTTP header like 'X-Api-Version' is another valid approach, especially for scenarios where you want to keep the URL clean and versioning logic separate.

  • C. Incorrect.

    Embedding the version number in the query string is generally not recommended because it can make versioning less explicit and may lead to confusion, especially in complex APIs.

  • D. Incorrect.

    Deprecating older API versions immediately is not a best practice. Instead, a proper deprecation policy with a timeline should be established to give clients enough time to migrate.

  • E. Correct.

    Documenting each API version and providing migration guides is crucial for developer adoption and smooth transitions between versions.

Timed practice exam

Take a Google Professional Cloud Developer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam