⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
← Back to All AWS & Cloud Architecture Interview Questions Scenario 107 of 179 in AWS & Cloud Architecture
Senior DevOps / SRE [L2] AWS Cost & Architecture Production Scenario [L2]
🎯 Target Role / Context: AWS Scenario #109 (L2) · Cost & Architecture

Q: You have an SQS queue triggering a Lambda function to encode massive video files. Sometimes a video takes 8 minutes to encode. You randomly notice the exact same video being encoded simultaneously by two different Lambda functions. Why?

The SQS Visibility Timeout is misconfigured.

#AWS #Cost & Architecture #L2 #Cloud #Infrastructure
🎙️ Candidate Opening & Architectural Context
""In our AWS cloud environment, we managed high-traffic microservices where this exact scenario occurred. The interviewer is testing: SQS Visibility Timeout.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third.""
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? Stephane Maarek's AWS Certified DevOps Engineer Professional Masterclass on Udemy covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

Direct Answer: "In our AWS cloud environment, we managed high-traffic microservices where this exact scenario occurred. The interviewer is testing: SQS Visibility Timeout.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third."

1️⃣

Production Solution & Architecture

The SQS Visibility Timeout is misconfigured. When a Lambda polls SQS, the message doesn't delete immediately; it becomes "invisible" to other consumers for the duration of the Visibility Timeout (default 30 seconds). Because the video encode takes 8 minutes, the 30-second timeout expires mid-encode. SQS assumes the first Lambda quietly crashed, making the message instantly visible again. A second Lambda picks up the identical message and starts encoding it. *Fix:* You must increase the SQS Visibility Timeout to be strictly greater than the maximum theoretical runtime of the Lambda function (e.g., set it to 10 minutes, or 600 seconds).

💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: The SQS Visibility Timeout is misconfigured.."
⚡ 60-Second Elevator Pitch Talking Points
  • Immediate Triage: The SQS Visibility Timeout is misconfigured.
  • Run targeted verification commands before modifying configuration.
  • Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Subscribing an Amazon SQS queue to an SNS topic without attaching an explicit queue access policy when configuring queue triggering Lambda SNS lacks permission to write to SQS by default; without an IAM resource policy granting sqs:SendMessage to the topic ARN, messages drop silently.
  2. Confusing standard SQS queues with FIFO queues regarding strict ordering and deduplication when configuring queue triggering Lambda Standard SQS provides at-least-once delivery with best-effort ordering; strict FIFO ordering requires MessageGroupId and deduplication IDs.
  3. Using short polling instead of SQS long polling (WaitTimeSeconds: 20) in high-volume consumers when configuring queue triggering Lambda Short polling queries single partition subsets and returns empty responses, dramatically inflating AWS API billing and consumer CPU usage.
  4. Failing to monitor ApproximateNumberOfMessagesVisible and ApproximateAgeOfOldestMessage in CloudWatch when configuring queue triggering Lambda Queue depth and message age are primary SLI signals for consumer backlog saturation, far superior to consumer CPU utilization.
Advertisement
Want more AWS & Cloud Architecture scenarios?
Explore our complete collection of scenario-based AWS & Cloud Architecture interview runbooks.
Browse All AWS & Cloud Architecture Questions →