A team is writing an application that calls Google Cloud APIs. Which two practices follow Google's recommendations? (Select TWO.)
- Exam domain
- Managing implementation~12.5% of the exam
- Difficulty
- Medium
- In this mock
- 8 questions on this domainPractise this domain
Why the exam asks this
Interacting with Google Cloud programmatically.
Objective in the exam guide: Accessing Google API best practices.
Secure, reliable API access is basic engineering.
Why A and E are the answers
A multiple-response question. Choose two. There is no credit for picking only some of them.
Use Application Default Credentials so the library finds credentials from the environment
Use Cloud Client Libraries rather than hand-written HTTP calls
Cloud Client Libraries are the recommended option, and ADC finds credentials automatically based on the environment.
How it works
Cloud Client Libraries are the recommended way to call Cloud APIs.
They provide idiomatic code in each language.
Application Default Credentials find credentials automatically from the environment.
Clues in the question
The words that point to the answer, and what each one tells you.
- Calls Google Cloud APIs
- Client libraries and ADC.
In detail
- Client libraries handle details such as authentication and retries.
- ADC works locally and on Google Cloud without code changes.
Side by side with look-alikes
| Practice | Recommended? |
|---|---|
| Cloud Client Libraries | Yes |
| Application Default Credentials | Yes |
| Key in code | No |
| No retries | No |
| One API key for all | No |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Use Application Default Credentials so the library finds credentials from the environmentRight
Cloud Client Libraries are the recommended option, and ADC finds credentials automatically based on the environment.
B. Embed a service account key in the source codeWrongMost tempting
Keys in code leak.
Why it tempts: It works everywhere. But anyone with the code has the key.
C. Call REST endpoints with no retriesWrong
Transient errors need retries with backoff.
D. Use one API key for all services and usersWrong
API keys do not identify users or grant IAM permissions.
E. Use Cloud Client Libraries rather than hand-written HTTP callsRight
Cloud Client Libraries are the recommended option, and ADC finds credentials automatically based on the environment.
In practice
- Attach a service account to the runtime instead of using keys.