Q: A service has an internal queue. Would you alert on the number of items in the queue being high, or the age of the oldest item in the queue?
Alerting on the age of the oldest item is significantly better.
Want to master this scenario in a live sandbox? The Linux Foundation's Prometheus Certified Associate (PCA) & Monitoring Labs covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: "During a high-traffic production event, our observability stack proved essential in isolating this latency surge. The interviewer is testing: Alerting philosophy, latency vs. saturation.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third."
Production Solution & Architecture
Alerting on the age of the oldest item is significantly better. A queue with 10,000 items might be processed in 2 seconds if the workers are fast, resulting in no customer impact. Alerting purely on count will trigger false positives during harmless traffic spikes. However, if the oldest item in the queue is 5 minutes old, you *know* a user has been waiting 5 minutes. This violates latency SLOs regardless of whether the queue contains 10 items or 10,000 items, and indicates either frozen workers or severe backpressure.
- Immediate Triage: Alerting on the age of the oldest item is significantly better.
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
-
Subscribing an Amazon SQS queue to an SNS topic without attaching an explicit queue access policy
SNS lacks permission to write to SQS by default; without an IAM resource policy granting
sqs:SendMessageto the topic ARN, messages drop silently. -
Confusing standard SQS queues with FIFO queues regarding strict ordering and deduplication when addressing monitoring
Standard SQS provides at-least-once delivery with best-effort ordering; strict FIFO ordering requires
MessageGroupIdand deduplication IDs. -
Using short polling instead of SQS long polling (
WaitTimeSeconds: 20) in high-volume consumers Short polling queries single partition subsets and returns empty responses, dramatically inflating AWS API billing and consumer CPU usage. -
Failing to monitor
ApproximateNumberOfMessagesVisibleandApproximateAgeOfOldestMessagein CloudWatch Queue depth and message age are primary SLI signals for consumer backlog saturation, far superior to consumer CPU utilization.