
Answer-first summary for fast verification
Answer: Create a Pub/Sub topic for timesheet submissions. Create a subscription for each downstream development team to subscribe to the topic.
The question requires a scalable, decoupled solution where independent steps can be handled asynchronously with separate error handling. Option C uses a single Pub/Sub topic for timesheet submissions, allowing each downstream team to subscribe to the same topic via their own subscription. This ensures that all steps receive the event without dependencies, and new steps can be added by creating new subscriptions without modifying the publisher. Other options either introduce tight coupling (A, D) or require per-step topics (B), which complicates extensibility. Pub/Sub's fan-out pattern in C aligns best with the requirements.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
As a developer building a payroll processing application, you need to design a component for submitting employee timesheets that triggers multiple independent steps:
These steps can execute in any order, and future steps may be added by other teams, each handling their own error management. What is the best approach to implement this?
A
Deploy a Cloud Function for each step that calls the corresponding downstream system to complete the required action.
B
Create a Pub/Sub topic for each step. Create a subscription for each downstream development team to subscribe to their step's topic.
C
Create a Pub/Sub topic for timesheet submissions. Create a subscription for each downstream development team to subscribe to the topic.
D
Create a timesheet microservice deployed to Google Kubernetes Engine. The microservice calls each downstream step and waits for a successful response before calling the next step.
No comments yet.