Microservice Design and Architecture :Reliable Google Cloud Infrastructure: Design and Process (Preparing for Google Cloud Certification: Cloud Architect Professional Certificate) Answers 2025
Question 1
Youβre building a RESTful microservice. Which would be a valid data format for returning data to the client?
β JSON
π© All options are correct.
β HTML
β XML
Explanation:
REST APIs commonly return JSON, but XML and HTML are also valid depending on the use case. Therefore, all options are valid formats.
Question 2
Client sends invalid data. What should your service return?
β 200
β 500
π© 400
β XML exception
Explanation:
HTTP 400 Bad Request indicates the client sent invalid or malformed data.
500 is for server errors, not client mistakes.
Question 3
Which violates 12-factor app best practices?
π© Store configuration information in your source repository for easy versioning.
β Keep dev/test/prod similar
β Explicitly declare dependencies
β Treat logs as event streams
Explanation:
12-factor apps require config to be stored in environment variables, not in source control.
Question 4
Session state moved to DB β slow performance. Best fix?
β Move sessions back to servers with sticky sessions
π© Use a caching service like Memorystore for Redis.
β Put all servers in same zone
β Increase DB CPUs
Explanation:
Session data is read frequently β caching in Redis drastically improves performance.
Putting state back on servers breaks scalability and resilience.
π§Ύ Summary Table
| Q# | Correct Answer | Key Concept |
|---|---|---|
| 1 | All options are correct | REST APIs can return JSON, XML, HTML |
| 2 | 400 error | Invalid client data β Bad Request |
| 3 | Storing config in source repo | Violates 12-factor config principle |
| 4 | Use Redis cache | Best practice for fast session retrieval |