Staff-Level Site Reliability Engineer Interview Preparation Guide for Amazon
Amazon's specific SRE interview process details (exact round structure, evaluation criteria, and interview formats) were not found in available search results. This guide is based on industry-standard Staff-level SRE interview patterns, the provided job description, and general SRE interview practices. For the most current and accurate information, consult Amazon's official careers website, Levels.fyi, Blind, or recent candidate experiences.
Amazon's SRE interview process for Staff-level positions consists of an initial recruiter screening, two technical phone screens, and four onsite interview rounds. The process evaluates technical mastery in distributed systems and infrastructure at scale, operational excellence and incident response leadership, system design expertise, infrastructure automation capabilities, and alignment with Amazon Leadership Principles. Staff-level candidates are assessed not only on individual technical excellence but also on their ability to influence teams, drive operational improvements, and lead initiatives that span multiple teams.
Interview Rounds
Recruiter Screening
What to Expect
Initial conversation with an Amazon recruiter to assess your background, verify Staff-level experience qualifications, gauge interest in the SRE role, and determine overall fit with Amazon. The recruiter will explore your career progression, explain the role and team, discuss compensation and logistics, and answer questions about the interview process and team structure. This round typically happens once before you move to technical interviews.
Tips & Advice
Prepare a compelling 2-3 minute summary of your SRE journey, emphasizing progression from earlier career roles to Staff-level responsibilities. Highlight the scale and complexity of systems you've operated (number of services, traffic volume, geographic regions, team influence). Quantify specific achievements: percent improvements in MTTR, automation projects that eliminated toil, systems designed to handle multi-region failover, mentoring of junior SREs. Research Amazon's SRE mission and culture beforehand. Be ready to articulate why you're interested in Amazon specifically and how this role aligns with your career goals. Discuss compensation expectations clearly and upfront. Ask thoughtful questions about the team structure, the systems you'd own, challenges the team is facing, and growth opportunities within Amazon.
Focus Topics
Amazon Leadership Principles Alignment
Familiarize yourself with Amazon's 16 Leadership Principles. Prepare brief examples showing how your work reflects these principles, especially: Ownership (taking accountability for outcomes), Customer Obsession (focusing on customer impact), Operational Excellence, and Have Backbone/Disagree and Commit.
Practice Interview
Study Questions
Scale and Systems Expertise
Concrete metrics about systems you've designed or operated: number of services/servers, traffic volume (requests per second, data processed), geographic footprint, uptime percentages achieved, team size managed or influenced, cost optimization realized.
Practice Interview
Study Questions
Career Progression to Staff Level
Clearly articulate your progression from individual contributor to Staff-level SRE, with specific roles, systems you owned, and increasing scope of influence. Explain how each position prepared you for Staff responsibilities. Emphasize organizational impact beyond individual technical contributions.
Practice Interview
Study Questions
Technical Phone Screen 1: Distributed Systems and Infrastructure Architecture
What to Expect
First technical phone screen conducted by a senior SRE or infrastructure engineer. The interviewer explores your deep understanding of distributed systems, large-scale infrastructure design, and architectural decision-making. Expect technical questions about system scalability, failure modes, resilience patterns, and how you've approached building reliable infrastructure in previous roles. The interviewer may ask you to explain a complex system you've designed, discuss architectural tradeoffs, or analyze a scenario involving infrastructure challenges.
Tips & Advice
Think through complex distributed system problems you've solved at your organization. Be prepared to explain architectural decisions and tradeoffs explicitly: consistency vs availability, latency vs durability, cost vs reliability, automated recovery vs manual intervention. Use specific technical terminology accurately. Draw diagrams (via whiteboard or shared document) to explain systems. When discussing infrastructure choices, explain your reasoning and what constraints you were optimizing for. If you don't know something, acknowledge it and discuss how you'd approach learning or solving it. Demonstrate architectural thinking, not just familiarity with tools. Be prepared to defend your design choices and consider alternative approaches the interviewer suggests.
Focus Topics
Resilience Patterns and Failure Mode Analysis
Implementing resilience patterns: circuit breakers, bulkheads/compartmentalization, retry logic with exponential backoff and jitter, graceful degradation, timeout strategies. Proactive failure mode analysis: understanding potential failure scenarios, designing mitigations, chaos engineering approaches.
Practice Interview
Study Questions
Load Balancing, Service Discovery, and Traffic Management
Load balancing strategies (round-robin, least connections, consistent hashing, weighted distribution), health checking mechanisms, session affinity and stateful service handling. Service discovery patterns, DNS architecture and considerations, dynamic service registration/deregistration at scale.
Practice Interview
Study Questions
AWS Services and Cloud Infrastructure Mastery
Deep proficiency with AWS services critical to SRE: EC2 and instance types, RDS and managed databases, S3 and data storage, ECS/EKS container orchestration, CloudWatch metrics and alarms, VPC networking and security, IAM and access control, Auto Scaling and load balancing, Lambda serverless compute.
Practice Interview
Study Questions
Distributed Systems Architecture and Design Patterns
Master-level understanding of building reliable distributed systems including service-oriented architecture, microservices trade-offs, identifying and mitigating single points of failure, request routing and service discovery, eventual consistency and distributed transactions, handling network partitions.
Practice Interview
Study Questions
Infrastructure Automation and Infrastructure as Code (IaC)
Deep expertise in automation frameworks and IaC tools (Terraform, CloudFormation, Ansible, Puppet, Chef). Understanding of declarative vs imperative approaches, state management and idempotency, testing infrastructure changes before production, managing infrastructure drift, version control for infrastructure.
Practice Interview
Study Questions
Technical Phone Screen 2: Observability, Monitoring, and Incident Response
What to Expect
Second technical phone screen with a senior SRE focused on observability, monitoring strategy, and incident response capabilities. The interviewer explores your philosophy on building observable systems, designing effective monitoring and alerting, handling production incidents, and conducting post-incident analysis. Expect deep discussions about metrics and KPIs, log aggregation and analysis, distributed tracing for complex debugging, alert design to avoid fatigue, incident management procedures, and learning from failures.
Tips & Advice
Prepare 2-3 detailed examples of significant incidents you've handled: what happened, how you diagnosed the root cause, how you resolved it, what you learned, and how you prevented recurrence. Discuss your philosophy on monitoring - what metrics matter most, how to design effective alerting, and how to avoid alert fatigue while maintaining visibility. Explain the difference between monitoring and observability. Be specific about tools and technologies you've used, but focus on the principles and strategies. Discuss how you've improved observability in previous organizations. Be prepared to explain your approach to designing monitoring for a new service. Share examples of insights you've gained from metrics that drove operational improvements.
Focus Topics
Logging, Log Analysis, and Centralized Logging Infrastructure
Structured logging practices and benefits, designing log aggregation and analysis systems, understanding common logging pitfalls, retention policies and cost management, correlating logs across services, using logs for debugging and root cause analysis.
Practice Interview
Study Questions
Distributed Tracing for Complex Systems
Distributed tracing concepts and trace sampling strategies, instrumenting applications for tracing, understanding request flows across microservices, identifying latency bottlenecks using traces, debugging issues across service boundaries.
Practice Interview
Study Questions
Observability and Monitoring Strategy Design
Principles of observability: collecting meaningful metrics, structured logs, and distributed traces. Designing comprehensive monitoring strategies that answer 'what failed and why?' Understanding RED metrics (Rate, Errors, Duration) and USE metrics (Utilization, Saturation, Errors). Instrumenting applications and infrastructure for observability. Dashboard design and visualization. Alerting strategy to catch issues while minimizing alert fatigue.
Practice Interview
Study Questions
Incident Response Framework and Management
Incident response procedures and escalation paths, incident commander role and communication protocols, severity classification and SLA management, on-call rotation design and optimization, post-incident review processes, action item tracking and verification.
Practice Interview
Study Questions
Error Budgets and Service Level Objectives (SLOs)
Defining meaningful SLOs and SLAs aligned with customer expectations and business needs. Understanding error budgets as a resource for balancing new feature development with reliability investments. Using error budgets to guide prioritization decisions and communicate tradeoffs to product teams. Monitoring SLO compliance and communicating violations.
Practice Interview
Study Questions
Onsite Round 1: System Design - Large-Scale Reliable Service
What to Expect
First onsite interview focused on system design expertise. You'll be presented with a real-world scenario requiring you to design a large-scale, highly available service from first principles. The interviewer will guide you through gathering requirements, identifying key challenges, proposing an initial architecture, and iterating based on constraints and feedback. You'll need to discuss infrastructure choices, data architecture decisions, failover and disaster recovery strategies, operational considerations, and how you'd monitor and operate the system. Expect deep dives into specific architectural components and explicit discussion of tradeoffs.
Tips & Advice
Use a structured approach throughout the interview: (1) Clarify requirements thoroughly - understand the scale, geographic distribution, consistency requirements, and latency requirements; (2) Identify key challenges - scalability bottlenecks, failure scenarios, operational complexity; (3) Propose initial architecture with clear diagrams showing major components; (4) Iterate based on interviewer feedback. Draw architecture diagrams showing services, databases, caching layers, load balancers, monitoring. Discuss tradeoffs explicitly and explain your reasoning - why this database over that one, why this failover strategy, what you're optimizing for. Consider multi-region deployment and cross-region failover scenarios. Discuss how you'd monitor this system and what metrics matter. Think about how your team would operate and understand this system. Be prepared to go deep on specific layers (storage tier, caching strategy, network design). Ask clarifying questions when requirements are ambiguous. It's fine to say 'there are multiple valid approaches' or 'I'd need more information.' Staff-level SREs think holistically about systems, not just the technical layer.
Focus Topics
Cost Optimization and Resource Efficiency
Making architectural decisions that optimize cost without sacrificing reliability, understanding AWS pricing models, right-sizing compute resources, choosing appropriate instance types, auto-scaling strategies for cost, spot instances and reserved instances, data storage optimization.
Practice Interview
Study Questions
Scalability, Capacity Planning, and Performance
Predicting system scalability based on load patterns, capacity planning for growth, identifying performance bottlenecks (CPU, memory, I/O, network), auto-scaling strategies, rate limiting and traffic shaping, caching strategies at various layers, CDN and edge caching usage.
Practice Interview
Study Questions
Operational Aspects of System Design
Designing systems for operational ease: monitoring instrumentation and observability hooks, debugging capabilities, configuration management, deployment and rollback procedures, graceful shutdown and connection draining, making systems understandable and operationable by humans.
Practice Interview
Study Questions
Data Architecture for Durability and Consistency
Database selection tradeoffs (SQL vs NoSQL, relational vs document vs key-value), consistency models and their implications, replication strategies, backup and recovery procedures, handling data durability across multiple regions, ensuring RPO and RTO targets.
Practice Interview
Study Questions
High-Availability System Architecture Design
Designing for availability across failure scenarios: redundancy patterns, active-active vs active-passive configurations, cross-region deployment strategies, eliminating single points of failure, quorum-based consensus decisions, automatic failover and health detection mechanisms.
Practice Interview
Study Questions
Onsite Round 2: Infrastructure Automation and Deployment Pipelines
What to Expect
Second onsite interview focused on infrastructure automation, Infrastructure as Code, and deployment automation. You may be asked to design an automation solution for a complex operational problem, discuss your approach to writing and testing infrastructure code, or design a CI/CD pipeline for safe deployments at scale. The interviewer assesses your ability to write quality infrastructure code, design scalable automation frameworks, and think about how automation scales across teams and organizations.
Tips & Advice
Be prepared to discuss and possibly write pseudocode or actual code for infrastructure automation. Discuss your testing philosophy for infrastructure - how do you validate IaC before production? Think about idempotency: infrastructure code should produce the same result whether run once or ten times. Discuss error handling and rollback strategies. When reviewing infrastructure code, point out both strengths and potential improvements. Discuss how you'd manage state in Terraform or CloudFormation. Talk about versioning infrastructure code and implementing CI/CD for infrastructure changes. Discuss how you scale automation across teams - standards, documentation, code reuse. Mention specific tools you've used (Terraform, Ansible, CloudFormation, etc.) but focus on concepts. Discuss testing strategies - unit tests for infrastructure code, integration tests, and validation in staging environments.
Focus Topics
Configuration Management and Avoiding Configuration Drift
Managing configuration across large fleets: configuration as code, secrets management and security, avoiding configuration drift between servers, handling configuration updates safely, immutable infrastructure vs mutable infrastructure approaches, tools like Puppet, Ansible for configuration management.
Practice Interview
Study Questions
Kubernetes and Container Orchestration at Scale
Operating Kubernetes clusters reliably: resource requests/limits and scheduling, pod lifecycle and health checks, networking and service discovery, persistent storage, multi-cluster management and cross-cluster communication, helm charts and operators for managing applications.
Practice Interview
Study Questions
Testing and Validation of Infrastructure Changes
Strategies for testing infrastructure before production: unit tests for IaC, integration testing, infrastructure as code linting and validation, staging environments that mirror production, chaos engineering, automated validation of deployments, detecting configuration drift.
Practice Interview
Study Questions
CI/CD Pipeline Design and Deployment Automation
Designing robust CI/CD systems: automated testing, security scanning, code quality checks, automated infrastructure provisioning. Deployment strategies: blue-green deployments, canary deployments, feature flags for progressive rollout, rollback procedures. Deployment validation and health checks. Pipeline orchestration and artifact management.
Practice Interview
Study Questions
Infrastructure as Code (IaC) Tools and Best Practices
Deep expertise with IaC tools (Terraform, CloudFormation, Ansible, Puppet, Chef). Declarative vs imperative approaches and their tradeoffs. State management and idempotency guarantees. Testing infrastructure code (unit tests, integration tests, linting). Version control strategies for infrastructure. Code organization and module design for reusability.
Practice Interview
Study Questions
Onsite Round 3: Complex Incident Response and Troubleshooting
What to Expect
Third onsite interview focused on incident response, troubleshooting complex production scenarios, and problem-solving under pressure. You'll be presented with a realistic production incident scenario involving multiple services and systems. Work through the diagnosis systematically, identify the root cause, propose resolution steps, and discuss prevention measures. The interviewer assesses your systematic approach to troubleshooting, knowledge of debugging techniques and tools, ability to communicate clearly during crisis situations, and how you extract learnings from incidents.
Tips & Advice
Approach the problem methodically rather than jumping to conclusions. Ask clarifying questions first - what's the impact, which services are affected, when did this start? Explain your thinking as you go through diagnosis. Discuss what data you'd collect: logs, metrics, traces, recent deployments, infrastructure changes. Walk through your troubleshooting hypothesis testing step-by-step. When you don't know something, say so and explain how you'd find the answer. Use diagrams to explain complex issues spanning multiple systems. Consider cascading failures and service dependencies. At the end, discuss how you'd prevent this issue in the future. Show that you stay calm, think logically through pressure, and communicate clearly about complex problems. Discuss post-incident review: what would you document, what action items would you create, how would you verify the fix?
Focus Topics
Communication, Documentation, and Post-Incident Learning
Communicating effectively during incidents: keeping stakeholders informed, clear escalation procedures, incident timelines. Post-incident documentation: timeline reconstruction, root cause analysis, prevention action items. Conducting blameless post-incident reviews and converting incident learnings into operational improvements.
Practice Interview
Study Questions
Performance Analysis and System Bottleneck Identification
Profiling applications and infrastructure to identify bottlenecks: CPU profiling, memory usage analysis, I/O and disk latency, network bandwidth and latency, database query performance, understanding cache hit rates, interpreting flame graphs and performance data.
Practice Interview
Study Questions
AWS-Specific Troubleshooting and Service Issues
Troubleshooting common AWS scenarios: RDS high CPU or connection count issues, EC2 instance connectivity and performance, network latency and routing issues, ECS/Kubernetes pod scheduling and resource issues, CloudWatch alarm misconfiguration. Understanding AWS service limits and their impact on systems.
Practice Interview
Study Questions
Debugging Distributed Systems and Microservices
Techniques for debugging issues across multiple services: distributed tracing and trace correlation, log aggregation and pattern matching, metric analysis and anomaly detection, understanding service dependencies and call graphs, reproducing issues reliably, isolating components, using debuggers when appropriate.
Practice Interview
Study Questions
Systematic Troubleshooting and Root Cause Analysis
Structured approach to identifying root causes: gathering logs, metrics, and traces; forming and testing hypotheses; understanding failure propagation in distributed systems; distinguishing symptoms from underlying causes; using timeline reconstruction; Five Whys and other RCA techniques.
Practice Interview
Study Questions
Onsite Round 4: Leadership, Influence, and Amazon Leadership Principles
What to Expect
Final onsite interview assessing leadership capabilities, organizational influence, and deep alignment with Amazon Leadership Principles. The interviewer focuses on your track record of driving technical and organizational change, mentoring and developing engineers, managing ambiguity in decision-making, and how your values align with Amazon. You'll discuss situations where you've influenced teams and organizations beyond your individual contribution, navigated difficult tradeoffs, and contributed to company success through technical leadership.
Tips & Advice
Prepare 4-5 well-structured examples using the STAR method (Situation, Task, Action, Result) that demonstrate Amazon's Leadership Principles in action. Focus especially on: Ownership (taking accountability for outcomes), Customer Obsession (prioritizing customer impact), Bias for Action (moving forward despite incomplete information), Have Backbone/Disagree and Commit (advocating for good ideas and executing once decided), and Operational Excellence. Quantify business impact when possible (cost saved, reliability improved, MTTR reduced, team velocity increased). Discuss situations where you've handled disagreement with management or peers - how did you present your case and what was the outcome? Show examples of how you've helped others succeed and grown engineers on your team. Discuss how you think about customers and the long-term implications of your decisions. Be authentic - don't try to force alignment with values you don't hold. Ask thoughtful questions about how the team embodies these principles and what challenges they're tackling.
Focus Topics
Handling Ambiguity, Making Decisions with Incomplete Information
Situations where you've operated effectively with unclear requirements or incomplete data, examples of pushing back on bad ideas or advocating for unpopular positions, balancing competing priorities and tradeoffs, learning from failures and course-correcting.
Practice Interview
Study Questions
Amazon Leadership Principle: Operational Excellence
Continuous focus on improving operational processes and practices: introducing monitoring and observability improvements, automating toil and repetitive work, improving incident response processes, implementing better change control and deployment practices, measuring and tracking operational metrics.
Practice Interview
Study Questions
Building, Mentoring, and Influencing Teams
Mentoring engineers at various levels, helping them grow careers and succeed, building trust and psychological safety, advocating for your team members, collaborating across teams to solve shared problems, influencing technical direction without direct authority, multiplying impact through others.
Practice Interview
Study Questions
Amazon Leadership Principle: Customer Obsession
Fundamental focus on customer needs and experience, not internal convenience. Gathering feedback from customers, understanding how your systems impact users, making decisions that prioritize customer value, thinking about long-term customer relationships.
Practice Interview
Study Questions
Amazon Leadership Principle: Ownership
Taking full accountability for outcomes, thinking and acting on behalf of the entire company, taking on hard problems with end-to-end ownership, thinking long-term and setting high standards, making decisions that benefit Amazon even when difficult or unpopular, delivering results regardless of obstacles.
Practice Interview
Study Questions
Frequently Asked Site Reliability Engineer (SRE) Interview Questions
You must size capacity for a distributed NoSQL store that must handle 1M reads/sec and 200k writes/sec. Describe how you would dimension nodes for CPU, memory, disk IOPS, and network, and how to account for background operations such as compaction, repair, and garbage collection. Explain how you would plan for read tail latency spikes and required replication bandwidth.
Sample Answer
Requirements & assumptions (clarify up-front):
- 1,000,000 reads/sec, 200,000 writes/sec steady-state.
- Replication factor RF=3, synchronous replicate to 2 followers.
- Average item size = 1 KB payload + 200B metadata = 1.2 KB.
- Read: mostly single-key point reads; 95% hits in cache assumed possible.
- Use SSD NVMe; nodes homogeneous.
Capacity math:
- Raw request bandwidth (payload only): (1,000,000+200,000) * 1.2KB ≈ 1.44 GB/s inbound+outbound combined.
- Replication network: each write must be sent to RF-1 = 2 replicas => write replication traffic = 200k 1.2KB2 ≈ 480 MB/s.
- Read traffic served from nodes: assume 50% reads served from replicas; worst-case network egress ≈ 1,000,000 *1.2KB ≈ 1.2 GB/s. Plan for 2–3 GB/s total egress across cluster.
Node sizing (example baseline):
- Network: 100 Gbps per node (~12.5 GB/s) gives headroom for spikes; can host multiple rack placements. With 100 Gbps, cluster-level egress demand (≈1.2–3 GB/s) divided across N nodes.
- CPU: assume ~200–400 CPU cores total needed for request processing, compaction and GC. Per node: 32–64 vCPUs (continuous low-latency processing + background threads).
- Memory: allocate enough cache + JVM heap (if Java store). Example: 256–512 GB RAM per node (256 GB heap reserved carefully; leave host memory for page cache).
- Disk/IOPS: writes = 200k/sec (durable writes). With 1.2KB per write => 240 MB/s sequential write plus compaction rewrite amplification (x2–3) -> plan 600 MB/s sustained per cluster. Per node NVMe: 3–6 GB/s and 300k IOPS (4KB) comfortable. Use many drives; target <70% utilization.
Accounting background ops:
- Compaction/repairs: model write amplification factor (WAF). If WAF=2.5, effective write bandwidth = 200k1.2KB2.5 = 600 MB/s. Provision IOPS/throughput for that plus headroom. Schedule major repairs/anti-entropy during low-traffic windows or throttle via token bucket; prioritize read/write latency by throttling compaction when percentiles exceed SLO.
- GC: minimize stop-the-world pauses: run with G1/ZGC or native runtimes. Keep heap per JVM modest (≤32–64GB) and use many service threads across containers to limit GC impact. Monitor and set alerts for GC pause tail.
- Background I/O isolation: use cgroups/blkio or QoS on disk to reserve IOPS for foreground operations.
Planning for read tail latency spikes:
- Multi-tier cache: use local node memory cache + global edge caches (CDN/redis) to absorb spikes; aim to serve 80–95% reads from cache.
- Client-side retries with jitter and hedged reads: issue secondary read after 5–10ms to another replica for high-percentile mitigation.
- Prioritized scheduling: prioritize small reads over compaction I/O; use io_uring or native async IO.
- Autoscaling: add nodes when request rate sustained; use rolling restarts to avoid correlated GC/compaction.
Replication bandwidth & durability:
- With RF=3 plan for ~480 MB/s replication + overhead (protocol, TLS) -> provision ~600 MB/s margin.
- For cluster elasticity, ensure leaderless or configurable quorum to avoid single-node bottlenecks. Use batching for replication (group writes into 10–20KB batches) to reduce per-write overhead.
Operational practices:
- SLOs: set read/write p99/p999 targets; monitor CPU, GC, disk latency, IOPS, network.
- Load testing: synthetic load that exercises compaction and repair simultaneously to validate tail behavior.
- Capacity formula summary: provision per-node network/IO such that (cluster throughput)/(nodes) ≤ 50% of a node’s network/disk capacity to allow headroom for background ops and failure scenarios.
Example final sizing (rough):
- Nodes: 50 nodes, each: 100 Gbps NIC, 48 vCPUs, 384 GB RAM, NVMe 8TB (3–5 GB/s, 300k IOPS). This yields cluster headroom for replication, compaction, failover — adjust after benchmarking with real data and WAF.
You're coordinating an incident that impacts key customers and senior management is asking for updates. How do you structure a concise, non-technical update for executives and account managers that balances transparency with technical accuracy? Provide a three-bullet executive update template (impact, action, next update/ETA).
Sample Answer
Approach: For execs and account managers, keep language business-focused, quantify customer impact, state owned actions and mitigations, and commit to a clear next update/ETA. Avoid technical detail unless it affects customer-facing timelines.
Three-bullet executive update template:
- Impact: [What customers/business are experiencing, scope, and numbers] — e.g., "Customers in EU region experiencing intermittent payment failures; ~12% of transactions affected, impacting ~8k users and 3 top-tier accounts."
- Action: [What we’re doing and who’s owning it; immediate mitigations] — e.g., "Engineering (on-call SRE + payments team) is running a targeted rollback and routing payments to backup processor; rate-limiting applied to reduce error volume. Customer support has escalation playbooks for affected accounts."
- Next update / ETA: [When and what will be in the next update; if unknown, give cadence] — e.g., "Next update in 30 minutes or sooner if the rollback completes; ETA for recovery ~45–60 minutes. If unresolved, we'll provide a mitigation timeline and customer communication plan."
Concise example message you can send:
- Impact: "Intermittent payment failures for EU customers — ~12% of transactions failing; 3 premium customers impacted."
- Action: "On-call SRE and payments team performing rollback to last stable release; routing to backup processor and applying rate limits; CS notified with escalation steps."
- Next update / ETA: "Next update in 30 minutes. Estimated recovery 45–60 minutes; will include recovery status and customer communication wording."
Explain what profiling is in the context of Site Reliability Engineering. Describe the main goals of profiling, common types of profilers (sampling vs instrumentation), typical metrics collected (CPU, memory, I/O, network), and why SREs follow a measure-first, change-later approach to keep optimizations safe and reproducible.
Sample Answer
Profiling in SRE is the systematic measurement of where a system spends resources (CPU, memory, I/O, network, lock contention) so you can target performance and reliability improvements with evidence. Main goals:
- Identify hotspots and bottlenecks (hot code paths, memory leaks, heavy syscalls)
- Quantify impact (cost, latency, error amplification)
- Reproduce and validate optimizations safely
- Guide capacity planning and SLO decisions
Common profiler types:
- Sampling profilers: periodically sample program state (stack traces) at intervals. Low overhead, good for CPU and latency hotspots; produces statistical view.
- Instrumentation profilers: insert timers/counters around functions or events. Higher fidelity and overhead; useful for precise timing, allocations, and custom metrics.
Typical metrics collected:
- CPU: CPU usage by process/thread, per-function CPU time
- Memory: heap size, allocation rate, GC pauses, object counts
- I/O: syscall counts, read/write bytes, latency distributions
- Network: bytes/sec, packet rates, per-call latency, retransmits
- Concurrency: thread counts, lock contention, wait times
Measure-first, change-later rationale:
- Prevents “optimizing the wrong thing” by grounding changes in data
- Ensures reproducibility: record baseline metrics and profiles, apply change, compare
- Keeps safety: small, verifiable changes reduce regressions; use canary rollouts and benchmarks
- Provides audit trail for cost/benefit and informed postmortems
Concrete practice: capture a sampling CPU profile and allocation profile in prod (low overhead), reproduce locally or in staging, design a minimal change, run A/B/canary with the same profiling to confirm improvement before full rollout.
Describe the kubectl commands and rollout strategies you would use to perform a safe rolling restart of a Deployment, view rollout history, and rollback to a previous revision. Include examples using kubectl and explain how you would avoid causing cascading failures during a restart of a consumer‑facing service.
Sample Answer
A safe restart uses kubectl rollout restart, which recreates pods through the normal RollingUpdate strategy rather than deleting them directly, so the same availability guarantees that protect a routine deployment protect the restart too.
Commands
Trigger and watch a rolling restart:
kubectl rollout restart deployment my-app -n prod
kubectl rollout status deployment my-app -n prod --watch
View rollout history and inspect a specific revision:
kubectl rollout history deployment my-app -n prod
kubectl rollout history deployment my-app -n prod --revision=3
Roll back:
kubectl rollout undo deployment my-app -n prod --to-revision=3
kubectl rollout status deployment my-app -n prod
Ship an image change with a recorded reason (the --record flag some older references use for this is deprecated; annotate explicitly instead):
kubectl set image deployment/my-app my-app=registry/app:1.2.3 -n prod
kubectl annotate deployment my-app kubernetes.io/change-cause="bump to 1.2.3, ticket OPS-441" --overwrite -n prod
What keeps a restart from becoming a cascading failure
- RollingUpdate parameters:
maxUnavailableandmaxSurge(both default to 25% of desired replicas) bound how many old pods can be down and how many extra new pods can exist at once. For a consumer-facing service, a conservative setting (for examplemaxUnavailable: 0, maxSurge: 1) never drops capacity below the current replica count during the restart, at the cost of briefly running more pods than the steady-state count. - Readiness probes: a Service only sends traffic to pods that pass their readiness probe, so a newly restarted pod that's still initializing doesn't receive requests it can't yet handle. This is the single biggest lever against a restart-induced error spike; without a readiness probe, the rollout has no signal that a "new" pod is actually ready and can start routing traffic to it immediately.
- PodDisruptionBudget (PDB): guarantees a minimum number (or percentage) of replicas stay available throughout the restart, independent of the Deployment's own
maxUnavailablesetting, which matters when other voluntary disruptions (a node drain, a cluster upgrade) happen to overlap with the restart window. - Graceful shutdown: a
preStophook plus aterminationGracePeriodSecondslong enough for in-flight requests to finish, combined with the Service removing the pod's endpoint before the container actually stops, avoids dropping requests that were already in progress when the restart began. - Staged rollout for risk-sensitive services: restarting (or deploying) to a small subset first, watching error rate and latency, then proceeding, catches a bad new revision before it reaches full traffic; this is a general staged-rollout practice, not a specific traffic-splitting mechanism (traffic-splitting techniques like weighted canary routing are a load-balancing/ingress-layer concern, not something the Deployment object itself provides).
Trade-offs and pitfalls
kubectl rollout restartonly recreates pods; it does not change the Deployment's spec, sorollout historyrecords it as a new revision with the same template, which is easy to forget when later trying toundoyour way back past a restart that changed nothing.- Setting
maxUnavailable: 0guarantees no capacity loss but requires enough spare cluster capacity formaxSurgeextra pods to schedule; on a tightly packed cluster this can leave the rollout stuck Pending on the surge pods instead of proceeding. - A rollback only restores the pod template (image, env, resource requests, and so on). If the Deployment reads a ConfigMap or Secret by a fixed name and that ConfigMap was edited in place rather than replaced with a new name or hash-suffixed name, rolling the Deployment back does not restore the old configuration content, only the old pod template pointing at the same (already-mutated) ConfigMap. This is the most common way a rollback fails to actually roll back.
- The same gap applies to a PersistentVolumeClaim (PVC): a Deployment's rollback restores the pod template's volume mount references, not the data on the volume itself. If the new version wrote a schema migration or otherwise mutated data in place on that volume, rolling the Deployment back gives you the old code pointing at already-changed data, not the old data. Anything stateful needs its own restore path (a volume snapshot or application-level backup) alongside the Deployment rollback, not instead of thinking about it separately.
Discuss the trade-offs between a highly extensible, plugin-based CI pipeline architecture and a simple, opinionated set of pipeline templates that every team must use. How does each choice affect developer velocity, operational burden, security surface area, and your ability to scale platform support across hundreds of teams?
Sample Answer
Direct answer
A highly extensible, plugin-based CI architecture maximizes what any individual team can do with the platform, at the cost of a larger, harder-to-secure surface area and more operational burden maintaining that flexibility; a simple, opinionated set of pipeline templates trades some flexibility for lower operational burden, a smaller security surface, and much easier support at scale across many teams.
Structured elaboration
Developer velocity. A plugin-based architecture lets a team with an unusual need (an exotic build tool, a niche deployment target) solve it themselves without waiting on the platform team, which is a real velocity win for teams whose needs genuinely fall outside the common case. An opinionated template set is faster for the common case (most teams never need anything beyond the template) but can genuinely block or badly slow down the uncommon case, where a team's real need isn't expressible within the template's assumptions.
Operational burden. Every plugin (or every degree of freedom in a highly extensible system) is something the platform team has to account for when reasoning about the system's behavior, security posture, and upgrade path; a plugin ecosystem's collective maintenance burden (as covered concretely in the Jenkins-at-scale question) grows with the number of distinct plugins in active use across the organization, not just with the platform's own complexity. An opinionated, templated system has a much smaller surface: the platform team supports a small, known set of patterns, not an open-ended combinatorial space of whatever any team has chosen to install or configure.
Security surface area. Every plugin or extension point is a potential vulnerability, and a highly extensible system's actual security posture depends on the weakest plugin any team has installed, not just on the core platform's own security; an opinionated system's security review can focus on a small, fixed set of supported patterns instead of an open-ended, ever-changing set of third-party extensions.
Upgrade and testing complexity. A highly extensible system has to validate that platform upgrades don't break the potentially huge combinatorial space of plugin combinations teams have actually deployed, which is close to intractable to fully test; an opinionated system's upgrades only need to be validated against its own small set of supported templates, which is genuinely tractable.
Scaling support across hundreds of teams. An opinionated system scales support effort roughly with the number of distinct template patterns (small and roughly constant as team count grows), while a highly extensible one scales support effort closer to the number of distinct plugin/extension combinations in actual use (which tends to grow at least linearly, and often faster, with team count), making it a much harder support model to sustain as the organization grows.
Worked example
A 20-person startup benefits from a highly extensible, plugin-based system: few enough teams that the platform team can reasonably track what's installed, and the flexibility lets early, fast-moving teams solve their own unusual needs without a platform bottleneck. A 2,000-engineer enterprise with hundreds of teams is much better served by a small, opinionated set of well-supported templates with a genuinely rare, carefully-reviewed exception path for the handful of teams whose needs don't fit, because the alternative (letting hundreds of teams each install whatever plugins they want) produces an untestable, unsupportable combinatorial mess, as the earlier Jenkins-plugin-governance discussion covers concretely.
Trade-offs and pitfalls
The most common mistake is choosing maximal extensibility by default without accounting for how the operational and security burden scales with organization size, which works fine at small scale and becomes genuinely unsustainable well before an organization reaches hundreds of teams. The second is choosing a rigidly opinionated system with no legitimate exception path at all, which either blocks teams with genuinely different needs or, more likely, drives them to quietly work around the platform entirely, which is worse for consistency than a small, deliberate, reviewed set of exceptions.
You are asked to create a monitoring bootstrap plan for a greenfield product so engineering and product teams can detect regressions that affect customers early. Outline the SLIs, minimum dashboards, alerting policy, SLO targets, and a feedback loop with product to refine coverage in the first 90 days.
Sample Answer
Requirements & constraints:
- Greenfield product, customer-facing, must detect regressions early, low MTTR, minimal initial instrumentation cost, iterate over 90 days.
- Target users: product + engineering; integrate with existing tooling (Prometheus/Grafana, Datadog, or equivalent).
Day 0–7: Instrumentation & SLIs
- SLIs (customer-centric + system metrics):
- Availability: successful user requests / total user requests (HTTP 2xx/3xx within timeout) per minute.
- Latency P95/P99 for key user journeys (API call, page load).
- Error rate: 5xx rate and client-visible functional errors (business errors).
- Throughput: requests/sec per endpoint.
- Queue/backlog depth and processing latency for async jobs.
- Key resource health: CPU, memory, disk, DB connection pool saturation.
- Implement lightweight tracing hooks (span IDs) and structured logs.
Day 7–21: Minimum dashboards
- Overview dashboard (ops): Availability, Error Rate, Latency P95/P99, Throughput, Error budget burn rate.
- Endpoint health dashboard: per-critical-endpoint requests, errors, latency heatmap.
- Infrastructure dashboard: host/cluster CPU, memory, disk, network, DB connections, queue depth.
- Deployment/CICD dashboard: last deploys, deploy frequency, canary metrics.
- Alert inbox dashboard: active alerts and owner.
Day 14–30: Alerting policy (noise-minimizing)
- Alert tiers:
- P0 (immediate page): Availability < 99.5% over 5m OR error-rate spike (>5% absolute) for core API affecting customers.
- P1 (pager for on-call): Latency P99 > 2x baseline for 10m or error budget burn rate > 5%/hour.
- P2 (email/Slack): Resource saturation nearing threshold (DB conn > 80% for 5m), queue backlog > threshold, deploy failure rates.
- P3 (ticket): Non-urgent regressions, test failures.
- Alert rules include runbooks, suggested mitigations, owner rotation, and automatic deduplication & suppression during known deploy windows.
- Use burn-rate alerts to abort rollouts automatically if canaries fail.
SLO targets (initial, revise after 90 days)
- Availability SLO: 99.95% monthly for core user flows (error budget 22 mins/month).
- Latency SLO: P95 < 300ms, P99 < 1.5s for API.
- Error-rate SLO: <0.1% customer-visible errors.
- Infrastructure SLOs: DB connection saturation < 70%.
First 90-day feedback loop
- Weeklies: Review dashboards + incidents with product and engineers; prioritize missing coverage.
- After every deploy: Canary review meeting for first 2 weeks of feature rollouts.
- Bi-weekly SLO review: compare burn rates, adjust thresholds, add/remove SLIs based on false positives/negatives.
- Runbooks & playbooks: iterate after each incident (blameless postmortem within 48h); update runbooks within 72h.
- Product collaboration: map user journeys -> tag SLIs to personas; product validates which journeys are critical.
- Month 1: Validate telemetry completeness (sampling rates, missing spans).
- Month 2: Add business metrics (conversion, sign-ups, checkout success) as SLIs.
- Month 3: Harden: automate remediation for common failures, add synthetic tests, formalize SLO review cadence and error budget policy (release freezes when budget exhausted).
Trade-offs & rationale
- Start with high-signal customer-facing SLIs to detect regressions early; avoid over-instrumentation.
- Conservative alerting to reduce pager fatigue; rely on burn-rate + canaries to protect customers during deploys.
- Iterate with product using data — SLOs are living contracts that balance velocity and reliability.
Two people on your team occasionally run terraform apply against the same workspace at the same time, and you've had partial applies leave things in a weird state. What's actually happening there, and how do you stop it from recurring?
Sample Answer
Direct answer
Two things can be happening. If the backend (where Terraform's state file actually lives and gets locked) enforces state locking (S3 with a DynamoDB lock table, GCS, Terraform Cloud, Consul), the second apply should be rejected outright with a lock-acquisition error, so genuine concurrent-write corruption almost always means locking isn't actually being enforced: no lock table configured, someone ran apply with -lock=false, or someone force-unlocked while the first apply was still in flight. Separately, even a single apply is not transactional: Terraform applies resources one by one in dependency order, so a mid-apply failure (an API timeout, throttling, a killed CI job) leaves some resources created and others not, independent of whether a second run was involved at all. The fix is to make concurrency structurally impossible (backend locking plus a CI-level mutex) and to always apply a saved plan rather than a freshly generated one.
How this happens and how to prevent it
Why concurrent applies corrupt state
Both runs compute a plan against the same starting state. If locking isn't enforced, the second run's plan doesn't know the first run already changed things; when both finish, the state write from whichever run finishes last silently overwrites the state written by the other, discarding its record even though the real infrastructure it created still exists.
Prevention
- Backend locking: an S3 backend with a DynamoDB lock table (or GCS/Terraform Cloud's built-in locking) makes Terraform itself refuse to run a second apply against the same state while a first one holds the lock.
- CI-level mutex: backend locking only protects the moment
applyruns, not the whole review window. Two engineers can each get an approved plan and then race to click apply. A CI concurrency gate (GitHub Actionsconcurrency:group per workspace, GitLabresource_group, or an explicit lock service) serializes the pipeline jobs themselves. - Plan-then-apply-exact-plan: run
terraform plan -out=tfplan, review that artifact, then apply withterraform apply tfplanrather than a bareterraform apply. If the real state has moved since the plan was generated, Terraform detects the mismatch and refuses to apply the stale plan, instead of silently recomputing a new one.
Worked example
Suppose a plan touches six resources: a security group, two subnets, a NAT gateway, a route table, and a route table association. If locking is enforced, a second engineer's terraform apply at the same time fails immediately with an error acquiring the state lock, that's the safe, expected outcome, not corruption. Corruption happens when locking is missing or bypassed: engineer A's apply reaches the NAT gateway create step while engineer B's unlocked run, computed from the same pre-apply state, doesn't know a NAT gateway is already being created and also attempts to create one. The result is two NAT gateways in the account, and depending on which run's state write lands last, the state file ends up tracking only one of them, the other becomes an orphaned, unmanaged, billable resource that terraform plan won't even show anymore because nothing in state or config references it.
Trade-offs and pitfalls
- Locking prevents corruption but a genuinely stuck lock (a CI job killed mid-apply, a crashed laptop run) blocks every future apply until someone force-unlocks. Force-unlock is a manual, risky escape hatch, use it only after confirming no apply is truly still in flight (check the CI job status and the cloud provider's own activity log, not just the lock table).
- A CI-level mutex is necessary in addition to backend locking specifically to close the review-to-apply race window; relying on backend locking alone still lets two approved plans collide at the apply step.
- Applying a stale saved plan fails safely, Terraform detects the plan no longer matches current state, but only if the pipeline is disciplined about always applying the plan artifact rather than falling back to a bare
terraform applythat silently regenerates a fresh plan against whatever the current state happens to be.
A microservice intermittently returns 504s. Outline a practical investigation plan: what logs, traces, metrics, and load tests you would request or run, what areas of the code you'd review, and what quick mitigations you might propose while you're still investigating.
Sample Answer
Direct answer. A 504 specifically means the gateway or load balancer gave up waiting on an upstream response, so the investigation should center on finding which hop in the chain is actually slow or unresponsive, not on the gateway itself, which is usually just the messenger.
Structured elaboration.
- Confirm where the timeout is actually happening. Check the gateway or load balancer's own timeout configuration and logs: a 504 tells you the gateway gave up, but not which upstream it gave up on. If you have distributed tracing, pull a handful of the failing requests and look at which span never completes or takes far longer than normal.
- Check load and concurrency on the microservice itself. Look at request rate, thread-pool or connection-pool saturation, and queue depth. A service that's fine at low traffic can start timing out purely from being overwhelmed, well before it would show as unhealthy on CPU or memory.
- Check its own downstream calls. If the microservice calls a database, cache, or another service, check THOSE for elevated latency; the microservice may be blocked waiting on something further down the chain rather than being slow itself.
- Review the code for the specific bugs that turn a slow dependency into a hung request. Three areas are worth checking directly: whether the client for each downstream call has an explicit timeout set at all (a client with no timeout can hang indefinitely, which is a different and worse bug than one with a merely generous timeout); whether the connection or thread-pool size is hardcoded or read from a config value that may not have been updated as traffic grew; and whether there's a retry-without-backoff loop anywhere in the request path that would amplify load on an already-slow dependency instead of failing fast.
- Reproduce under load if you can. A quick load test against a staging or canary instance, mimicking the traffic pattern that triggers the 504s, can confirm a capacity-related hypothesis in minutes rather than guessing from production alone.
- Mitigate. Immediate options include raising the gateway timeout slightly if the upstream is close to finishing anyway (a stopgap, not a fix), adding capacity if it's a load problem, or failing fast with a clear error instead of hanging if the root cause is a stuck downstream dependency.
Worked example. Traces show requests hanging in a call from the microservice to its database, with the query itself sometimes taking 8 to 10 seconds under load versus under 200ms normally. Checking the database's own connection pool shows it's fully saturated during the incident window. That converges on a specific, testable hypothesis: the service's connection pool to the database is too small for current traffic, requests queue up waiting for a connection, and eventually the gateway's shorter timeout fires before the query even starts. The fix is raising the pool size (or adding a circuit breaker so requests fail fast instead of queuing indefinitely) rather than anything at the gateway layer.
Trade-offs and pitfalls. A common mistake is treating the 504 itself as the problem and only tuning the gateway timeout, which can mask a real capacity or dependency issue and just delays the same failure. The other pitfall is not distinguishing 'slow' from 'stuck': a slow downstream call that eventually returns is a capacity problem you can often scale your way out of, but a stuck call that never returns (a connection that hangs instead of timing out) needs a timeout and circuit breaker at every hop, or one hung dependency can eventually exhaust every caller's resources.
Write a Python tool that performs a safe compare-and-swap (CAS) update on a configuration key in Consul KV, records version metadata (who, when, change-id), and supports automatic rollback to the previous version if post-update health checks fail. Describe how you would atomically swap values, detect failure, and restore the older value with minimum race conditions.
Sample Answer
Approach (brief):
- Use Consul KV CAS (ModifyIndex) plus a short-lived Consul session lock to minimize races. Read current value and ModifyIndex, acquire a session lock on the key (or a companion lock key), perform a CAS write that includes metadata (who, when, change-id) appended to the value or stored in a companion key, run post-update health checks, and if checks fail, CAS the previous value back (using the ModifyIndex observed when we read it). If rollback CAS fails because somebody else changed the key, escalate/alert (automated retry window possible) — never silently overwrite someone else’s change.
Sample implementation (Python, using requests):
import requests, json, time, uuid, os
from datetime import datetime
CONSUL = os.getenv("CONSUL_ADDR", "http://127.0.0.1:8500")
KV_KEY = "service/config/mykey"
LOCK_KEY = KV_KEY + ".lock"
SESSION_TTL = "15s"
HEALTH_CHECK_URL = "http://localhost:8080/health"
HEADERS = {"Content-Type": "application/json"}
def consul_put(path, params=None, data=None):
url = f"{CONSUL}/v1/{path}"
return requests.put(url, params=params, data=data)
def consul_get(path, params=None):
url = f"{CONSUL}/v1/{path}"
return requests.get(url, params=params)
def create_session(name):
payload = {"Name": name, "TTL": SESSION_TTL, "Behavior": "delete"}
r = requests.put(f"{CONSUL}/v1/session/create", json=payload)
r.raise_for_status()
return r.json()["ID"]
def destroy_session(sid):
requests.put(f"{CONSUL}/v1/session/destroy/{sid}")
def acquire_lock(key, sid):
r = consul_put(f"kv/{key}", params={"acquire": sid}, data="")
return r.text == "true"
def release_lock(key, sid):
consul_put(f"kv/{key}", params={"release": sid}, data="")
def get_kv(key):
r = consul_get(f"kv/{key}")
if r.status_code == 200:
obj = r.json()[0]
val = obj.get("Value")
if val:
val = base64_decode(val)
return obj["ModifyIndex"], val, obj
return 0, None, None
def base64_decode(s):
import base64
return base64.b64decode(s).decode()
def base64_encode(s):
import base64
return base64.b64encode(s.encode()).decode()
def health_check():
try:
r = requests.get(HEALTH_CHECK_URL, timeout=3)
return r.status_code == 200
except Exception:
return False
def cas_write(key, value, cas_index):
# write value with cas=ModifyIndex
data = value
r = consul_put(f"kv/{key}", params={"cas": cas_index}, data=data)
return r.text == "true"
def safe_update(new_value, who):
change_id = str(uuid.uuid4())
ts = datetime.utcnow().isoformat() + "Z"
meta = {"who": who, "when": ts, "change_id": change_id}
payload = json.dumps({"value": new_value, "meta": meta})
sid = create_session("cfg-updater-"+change_id)
try:
if not acquire_lock(LOCK_KEY, sid):
raise RuntimeError("Could not acquire lock; another operator active")
old_index, old_val, _ = get_kv(KV_KEY)
# attempt CAS with observed ModifyIndex
success = cas_write(KV_KEY, payload, old_index)
if not success:
raise RuntimeError("CAS failed: concurrent update detected")
# short stabilization delay, then run health checks
time.sleep(1)
if health_check():
print("Update successful and healthy")
return True
else:
print("Health checks failed; attempting rollback")
rb_success = cas_write(KV_KEY, json.dumps({"value": old_val}), old_index+1 if old_index else old_index)
#Note: we try to CAS to previous index; if someone else changed it meantime, this may fail
if rb_success:
print("Rollback successful")
return False
else:
# final attempt: if CAS failed, try to write an error marker and alert humans
print("Rollback failed due to concurrent changes. Alerting and leaving state for manual resolution.")
return False
finally:
release_lock(LOCK_KEY, sid)
destroy_session(sid)
# Example usage:
# safe_update({"threshold": 10}, who="sre-jenkins")
Key concepts and reasoning:
- Consul KV CAS uses ModifyIndex to ensure you only write if the key’s state is unchanged. That gives atomicity for the swap attempt.
- A short-lived session lock reduces races by preventing concurrent updaters from attempting CAS at the same time; sessions give a simple mutex-like mechanism.
- Store metadata together with the value (or in a companion key) so every version has who/when/change-id. Using a structured JSON value keeps metadata queryable.
- Health checks run after the CAS—if they fail, rollback uses CAS to reapply the old value only if the key hasn’t changed since our original read. If somebody else changed it during our window, automatic rollback could overwrite someone else’s valid change—so detect that and escalate.
Trade-offs and robustness:
- Stronger guarantee: use Consul transactions (KVTxn) to write value and metadata atomically and use a lock to prevent concurrent operators.
- For bulletproof rollback, implement a change-log (append-only) key storing versions so you can always inspect history and restore safely rather than blindly CASing older index.
- Add retries with exponential backoff for transient failures, alerting when rollback cannot proceed automatically.
Edge cases:
- CAS fails because of concurrent changes — abort and retry or escalate.
- Health check false positives/negatives — run multiple probes and longer stabilization window before rollback.
- Network partitions between operator and Consul — avoid making decisions without quorum visibility; include safeties (manual approval) if uncertain.
Complexity:
- Operational complexity is bounded; Consul calls are O(1) per operation. The main concerns are correctness under concurrency and flaky health checks rather than algorithmic complexity.
You need to deploy an OpenTelemetry Collector fleet that can autoscale with load and keep accepting data even if the downstream backend has an outage. How would you design the deployment (agent versus gateway, horizontal autoscaling, a durable buffer sitting in front of the exporters) and structure the processor chain, for example batching, sampling, and enrichment?
Sample Answer
Direct Answer
Split the fleet into a fixed agent tier (one per host, DaemonSet-deployed, doing only light initial processing) and a horizontally autoscaled gateway tier that does the heavier work (sampling, enrichment, batching) and fronts the actual export. Put a durable buffer between the gateway and the exporter so a backend outage fills the buffer instead of blocking or dropping at the gateway, and scale the gateway tier on real backpressure signals (queue depth, CPU) rather than a fixed replica count.
Structured Elaboration
Fleet topology
flowchart LR
AGENT["Per-Host Agents"] --> GW["Gateway Tier: HPA-scaled"]
GW --> PROC["Processor Chain: memory_limiter, enrich, sample, batch"]
PROC --> BUF[("Durable Buffer")]
BUF --> EXP["Exporter"]
EXP --> BACKEND[("Backend")]
BUF -.->|"queue depth metric"| HPA{"Autoscaler"}
HPA -.->|"scale replicas"| GW
Agent versus gateway split
Agents run one per host, receiving OTLP from local processes and forwarding onward with minimal processing, so their resource footprint per host stays flat and predictable regardless of fleet-wide load. The gateway tier does the load-dependent work (see below), which is exactly what needs to scale with traffic, so isolating it from the fixed agent tier is what makes autoscaling meaningful.
Horizontal autoscaling
Scale the gateway tier on a metric that reflects real backpressure, most reliably queue depth in front of the exporter (or CPU as a proxy if queue depth isn't exposed as a scalable metric), using a standard proportional scaling rule: desired replica count scales with how far the current metric is above target.
Durable buffer in front of the exporters
A persistent queue (backed by local disk or an external durable log like Kafka) sits between the processor chain and the exporter. During a backend outage, the gateway keeps accepting and processing data, writing into the buffer instead of failing the export, and drains the buffer once the backend recovers.
Processor chain structure
Order matters: memory_limiter first (shed load before spending CPU on anything else), then resource and attribute enrichment, then sampling (tail-based sampling needs to see whole traces, so it runs before batching, not after), then batch last, right before the exporter, so batches only ever contain data that already survived the sampling decision.
Worked Example
Autoscaling thresholds. Assume each gateway pod sustains 20,000 spans/sec (a stated sizing assumption reflecting the processor chain's per-pod cost), and incoming load ranges from a floor of 50,000 spans/sec to a peak of 400,000 spans/sec through the day.
minReplicas=⌈20,00050,000⌉=3,maxReplicas=⌈20,000400,000⌉=20Applying the standard horizontal-scaling proportional rule, desiredReplicas = ceil(currentReplicas x currentMetricValue / desiredMetricValue), for a concrete example at 5 current replicas running at 90% CPU against a 70% target:
desiredReplicas=⌈5×7090⌉=⌈6.43⌉=7Durable buffer sizing. Assume the gateway continues accepting spans at 100,000/sec during a backend outage (average 800 bytes/span post-enrichment, a stated design input), and the outage is expected to last up to 15 minutes (900 s) before either recovery or a paging escalation forces a decision:
100,000×900×800 B=7.2×1010 B=72 GBA roughly 72 GB buffer requirement is well within the local disk capacity of a typical commodity broker or persistent-volume-backed queue, so this is a provisioning number to size the buffer's storage class against, not a hard architectural constraint.
Trade-offs and Pitfalls
Scaling on CPU alone is a lagging proxy: CPU can look fine even while the queue in front of the exporter is growing, if the bottleneck is actually export throughput to a slow backend rather than processing throughput. Scaling on queue depth directly is a better signal when it's available, since it reflects the thing you actually care about (are we falling behind) rather than a correlated but imperfect stand-in.
A durable buffer removes the immediate pressure to fix an outage fast, which is good for availability but can mask a slow backend degradation if nobody is watching buffer fill rate: a buffer that's growing steadily but not yet full looks the same as a healthy system on a dashboard that only shows "buffer not full yet," unless fill rate itself is alerted on.
Running sampling before batching (rather than after) is correct for tail-based decisions that need whole traces, but it means the sampling stage has to hold and correlate spans across a trace, which is real memory pressure on the gateway tier specifically, on top of whatever the autoscaling math above accounts for from raw throughput alone. Size gateway pod memory against expected in-flight trace count, not just span throughput.
Recommended Additional Resources
- Designing Data-Intensive Applications by Martin Kleppmann - Deep understanding of distributed systems and data architecture
- Site Reliability Engineering: How Google Runs Production Systems (O'Reilly) - Industry-standard SRE practices and philosophy
- The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win by Gene Kim - Systems thinking and operational excellence
- Building Microservices: Designing Fine-Grained Systems by Sam Newman - Microservices architecture patterns and tradeoffs
- AWS Well-Architected Framework (official AWS documentation) - Amazon's approach to designing reliable, efficient systems
- Levels.fyi - Real Amazon SRE interview experiences and compensation data
- Blind - Anonymous employee conversations about Amazon interview processes
- Amazon Leadership Principles (official Amazon careers website) - Understanding Amazon's cultural values
- Kubernetes in Action by Marko Lukša - Container orchestration and Kubernetes operations at scale
- Terraform: Up and Running by Yevgeniy Brikman - Infrastructure as Code best practices
Search Results
SRE interview questions and job descriptions - Gremlin
Sample Site Reliability Engineer Interview Questions · What is an SLO? · Follow up: What is an SLA? · What is a linked list? · Name some other data structures.
SRE(Site Reliability Engineer) Interview Questions (2025)
This article covers everything you need to know about becoming a Site Reliability Engineer, also some SRE Interview Questions, and answers
50 Site Reliability Engineer (SRE) Interview Questions 2025
Following are the most commonly asked Site Reliability Engineering interview questions, which will help you understand how interesting it actually can be.
Site Reliability Engineering AWS Interview Questions | MindMajix
Are you preparing for a Site Reliability Engineering (SRE) interview with AWS skills? This video covers AWS SRE interview questions and ...
Real SRE (Site Reliability Engineer) Interview Questions & Answers ...
Q1. How would you deploy an application to AWS? · Q2. What measures have you taken to secure your EKS clusters? · Q3. What is the toughest ...
Site Reliability Engineer (SRE) Interview Preparation Guide - GitHub
A collection of questions to practice with for SRE interviews · SRE Interview Questions · Sysadmin Test Questions · Kubernetes job interview questions · DevOps ...
Commonly Asked Amazon Interview Questions
Master Amazon interview questions with answers to technical and behavioral questions and learn the top tips to ace the interviews at Amazon.
This interview preparation guide was generated using AI-powered research from the sources listed above. While we strive for accuracy, we recommend verifying critical information from official company sources.
Want to create your own tailored preparation guide using our deep research?
Get Started for FreeInterview-Ready Courses
Visual-first, interactive, structured learning paths
Browse Site Reliability Engineer (SRE) jobs
AI-enriched listings across hundreds of company career pages
Explore Jobs