HomeInterview QuestionsWhen a file is uploaded, an event triggers a secon…

When a file is uploaded, an event triggers a second function. How can we design this event‑driven flow in AWS?

🟢 Easy Conceptual Fresher level
1Times asked
May 2026Last seen
May 2026First seen

💡 Model Answer

Use S3 event notifications to trigger the first Lambda when an object is created. Inside that Lambda, publish a message to an SNS topic or send the event to an SQS queue. The second Lambda subscribes to that SNS topic or polls the SQS queue, ensuring decoupling and retry logic. Alternatively, use EventBridge to route the S3 event directly to the second Lambda, which simplifies the architecture if you need filtering or cross‑account routing. For more complex workflows, chain the two Lambdas via Step Functions, where the first Lambda passes its output as input to the next state. This pattern provides visibility, error handling, and the ability to add additional steps (e.g., data transformation, database writes) without tightly coupling the functions.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.

Get Assisting AI — Starts at ₹500