Airbnb Site Reliability Engineer Interview Preparation Guide (Mid-Level)
Airbnb's Site Reliability Engineer interview process for mid-level candidates consists of a structured evaluation across technical fundamentals, system design thinking, infrastructure expertise, and cultural alignment. The process includes an initial recruiter screen, a technical phone screen focusing on algorithmic problem-solving, and an on-site loop with four rounds covering coding, system design/infrastructure, operations/automation, and behavioral assessment. Each round emphasizes both technical excellence and Airbnb's collaborative culture. The entire process typically spans 4-6 weeks from initial contact to offer decision.
Interview Rounds
Recruiter Screening
What to Expect
Your initial conversation with an Airbnb recruiter (15-20 minutes) is an informal screening to assess your background, motivation, and cultural fit. The recruiter will explore your years of SRE experience, relevant technical background, and familiarity with Airbnb's platform and scale. They evaluate your communication clarity, enthusiasm for the role, and whether your career goals align with the position. This stage also confirms you understand SRE fundamentals and establishes whether you're ready for technical evaluation rounds.[1]
Tips & Advice
Research Airbnb's engineering blog and technical challenges before the call. Prepare a focused 30-second pitch about why you're specifically excited about SRE at Airbnb—reference concrete things you know about their platform (scale, multi-region deployment, incident response culture, etc.). Have 2-3 specific achievements ready: a monitoring system you built, an incident you led response on, or a major automation project that reduced toil. Show genuine understanding of what SRE means—not just 'keeping systems up' but balancing reliability with development velocity through observability, automation, and process. Ask informed questions about the team's on-call rotation, incident response processes, or infrastructure challenges. Be authentic and conversational rather than scripted.
Focus Topics
Technical Skills and Tooling Experience
Provide specific overview of technical competencies: programming languages (Python, Go, Java, etc.), infrastructure platforms (Kubernetes, AWS, GCP), monitoring tools (Prometheus, DataDog, New Relic, etc.), configuration management (Terraform, Ansible), and incident response platforms you've used. Be honest about depth—distinguish between 'used in production' and 'familiar with.'
Practice Interview
Study Questions
Cross-Team Collaboration and Communication
Demonstrate clear, thoughtful communication during the call. Give specific examples of collaborating with developers on reliability concerns, explaining SRE concepts to product teams, or coordinating incident response across groups. Show how you balance SRE's perspective with engineering team needs.
Practice Interview
Study Questions
Motivation for SRE at Airbnb
Articulate why SRE specifically (not just engineering), why Airbnb specifically (not just any tech company), and how the role aligns with your career development. Reference Airbnb's scale, technical challenges, or cultural aspects that genuinely appeal to you. Avoid generic responses.
Practice Interview
Study Questions
SRE Background and Hands-On Experience
Clearly articulate your SRE journey: years of experience, specific responsibilities, key projects, and progression from junior to mid-level. Highlight hands-on work with monitoring platforms, incident response, infrastructure automation, and reliability engineering. For mid-level, demonstrate evolution in scope—perhaps you started responding to incidents and progressed to designing systems to prevent them.
Practice Interview
Study Questions
Technical Phone Screen
What to Expect
In this 60-90 minute coding screen, you'll solve 1-2 algorithmic problems using a shared coding platform (typically HackerRank or similar). Problems focus on data structures (arrays, linked lists, trees, graphs, hash maps) and algorithms (searching, sorting, BFS/DFS, dynamic programming), typically at medium difficulty. You're evaluated on problem-solving approach, code quality, optimization thinking, and communication throughout the process.[1]
Tips & Advice
Spend 30-45 minutes on each problem. For mid-level, interviewers expect thoughtful, optimized solutions—not brute force. Start by clarifying requirements and constraints, discuss your approach before coding (think out loud about trade-offs), write clean code with meaningful variable names, handle edge cases explicitly, and test with examples. Focus on optimization naturally—explain your complexity analysis and why you chose that approach. If stuck, communicate your thinking rather than staying silent. Ask clarifying questions when problem statements are ambiguous. Practice on LeetCode medium problems to build speed and pattern recognition. For mid-level, time management matters—solve efficiently within the window without perfection.
Focus Topics
Dynamic Programming and Optimization
Understand recursive problem-solving, memoization, and dynamic programming approaches. Practice classic DP problems: fibonacci variants, coin change, longest subsequences, knapsack, and path counting. Learn to identify DP problems and convert recursive solutions to iterative with space optimization.
Practice Interview
Study Questions
Hash Tables and Frequency-Based Problems
Master hash table design and applications. Understand collision handling, load factors, and custom hash functions. Practice problems using hash maps for optimization: finding duplicates, frequency counting, substring problems, two-sum variants, and anagram detection.
Practice Interview
Study Questions
Problem-Solving Communication and Complexity Analysis
Master the interview process: clarify requirements explicitly, discuss approach and trade-offs before coding, explain algorithmic choices clearly, analyze time and space complexity of your solution, identify edge cases, and test thoroughly. Communicate throughout rather than working silently.
Practice Interview
Study Questions
Arrays and Strings Manipulation
Master problems involving array searching, sorting, manipulation, and string operations. Includes techniques like two-pointer methods, sliding windows, prefix sums, binary search, and string transformations. Practice problems like finding duplicates, merging intervals, rotating arrays, pattern matching, and dynamic array resizing.
Practice Interview
Study Questions
Trees and Graphs Algorithms
Understand tree traversals (inorder, preorder, postorder, level-order), binary search trees, balanced tree concepts, and graph algorithms (BFS, DFS, shortest path algorithms, topological sort, cycle detection). Practice problems involving tree construction, LCA (lowest common ancestor), path finding, and graph connectivity.
Practice Interview
Study Questions
On-Site Coding Round
What to Expect
During your on-site (or virtual) visit, you'll have a 45-60 minute coding interview with a dedicated engineering interviewer. You'll solve 1-2 algorithmic problems at medium-to-hard difficulty, typically more challenging than the phone screen. You're evaluated on problem-solving depth, code quality, optimization thinking, and your ability to discuss and defend your approach. The interviewer also assesses your debugging skills and how you handle unexpected questions or edge cases.[1]
Tips & Advice
Write clean, production-ready code from the start—treat it as if it will be code-reviewed. Use meaningful variable names, add comments for complex logic, and structure code logically. Optimize your solution naturally rather than writing brute force first, then optimizing. For mid-level, interviewers expect efficiency-conscious thinking upfront. Include proper error handling and input validation. Verify your solution works with multiple test cases including edge cases. Be prepared for follow-up questions like 'How would you handle X constraint?' or 'Can you optimize further?' Stay engaged with the interviewer—if you get stuck, think out loud and ask for hints rather than going silent. Show curiosity about why the problem matters or how it relates to real systems.
Focus Topics
Edge Cases and Comprehensive Testing
Systematically identify edge cases: empty inputs, single elements, maximum sizes, negative numbers, duplicates, null values, and boundary conditions. Handle these cases explicitly in your code. Walk through your solution with diverse test cases before declaring completion.
Practice Interview
Study Questions
Optimization and Complexity Trade-offs
Analyze time and space complexity of your solution. Understand trade-offs between different approaches (speed vs. memory, simplicity vs. optimization). For mid-level, explain why your chosen approach is appropriate for the constraints. Discuss optimization naturally without prompting—show efficiency-conscious thinking.
Practice Interview
Study Questions
Production Code Quality and Maintainability
Write code that is clean, well-structured, and easy to understand. Use clear naming conventions, organize code logically, include helpful comments for non-obvious logic, and maintain consistent style. Include appropriate error handling, input validation, and null checks. For mid-level, code quality is a significant evaluation dimension—as important as correctness.
Practice Interview
Study Questions
Medium to Hard Coding Problem Patterns
Master coding patterns appearing in harder problems: multi-step algorithms, complex graph problems, advanced tree operations, sophisticated DP solutions, and problems requiring multiple data structures. Practice problems that require combining multiple techniques or non-obvious approaches.
Practice Interview
Study Questions
System Design and Infrastructure Architecture Round
What to Expect
In this 45-60 minute round, you'll design a system or infrastructure architecture for reliability at scale. Unlike SWE system design (which focuses on service architecture), SRE system design emphasizes monitoring architecture, incident response systems, observability infrastructure, deployment pipelines, or scaling strategies. You might be asked 'Design a monitoring system for Airbnb's booking service,' 'How would you architect incident detection and response,' or 'Design a canary deployment system.' For mid-level, expect scenarios focused on single services or small infrastructure domains at medium scale, not enterprise-wide systems.[1]
Tips & Advice
Start by clarifying requirements: scale, availability targets, failure modes, and constraints (cost, latency, etc.). For mid-level, spend time understanding the problem deeply before designing. Discuss trade-offs openly—reliability vs. complexity, automation vs. manual intervention, cost vs. availability. Include monitoring, alerting, and observability in your design from the start, not as an afterthought. Draw diagrams communicating your architecture clearly. Use specific technologies you know (Prometheus, Kubernetes, Terraform, etc.) rather than vague 'load balancers.' Discuss failure scenarios: 'What happens if the monitoring system fails?' or 'How do we detect this failure?' Include human factors: runbooks, escalation procedures, on-call rotation considerations. Be prepared to discuss scalability: 'What happens at 10x traffic?' Mention SLO/SLA concepts and error budgets in your design thinking.
Focus Topics
Distributed Systems Trade-offs and Data Consistency
Understand CAP theorem, consistency models (strong vs. eventual), partition tolerance, and availability-consistency trade-offs. Design systems making intentional choices about these trade-offs based on requirements. Discuss replication strategies and their consistency implications.
Practice Interview
Study Questions
Infrastructure Scalability and Capacity Management
Design systems that scale with demand. Discuss horizontal vs. vertical scaling trade-offs, auto-scaling policies, database scaling strategies (sharding, read replicas), caching layers, and burst capacity handling. Plan for growth through capacity forecasting, trend monitoring, and proactive provisioning.
Practice Interview
Study Questions
Monitoring, Observability, and Alerting Architecture
Design comprehensive monitoring and observability systems: metrics collection, log aggregation, distributed tracing, and dashboards. Plan alerting strategies minimizing false positives while catching real issues. Include thresholds, escalation policies, and notification routing. Understand the three pillars of observability: metrics, logs, and traces. For mid-level, design specific to problem constraints.
Practice Interview
Study Questions
Incident Detection, Response, and Recovery Processes
Design end-to-end incident response: automated detection systems, alert routing and escalation, incident command procedures, runbooks, triage processes, mitigation strategies, recovery procedures, and communication protocols. Include post-incident review mechanisms. Design for human factors—how teams coordinate during stress.
Practice Interview
Study Questions
High Availability and Fault Tolerance Architecture
Design systems for high availability through redundancy, geographic distribution, and failover mechanisms. Understand load balancing strategies, replication patterns, multi-region deployment, and graceful degradation under failure. Identify and eliminate single points of failure. For mid-level, focus on practical, implementable reliability patterns.
Practice Interview
Study Questions
Infrastructure, Automation, and Operations Round
What to Expect
This 45-60 minute round focuses on practical SRE operations: infrastructure-as-code, automation strategies, deployment safety, SLO/SLA/error budget management, and operational excellence. You might discuss your approach to infrastructure automation, design a deployment pipeline, explain how you'd define SLOs for a service, or describe your strategy for reducing operational toil. This round evaluates hands-on experience with real operational challenges and your philosophy around automation and reliability.[1][4]
Tips & Advice
Use concrete examples from your previous work: an infrastructure automation project, a deployment system you built, or an incident response process you improved. Be specific about tools and frameworks (Terraform, Ansible, Kubernetes, etc.) you've actually used in production. Discuss SLO definition thoughtfully—explain how you'd determine appropriate targets based on business requirements and cost-reliability trade-offs. Show understanding of error budgets and how to use them to balance reliability with feature velocity. Be prepared for scenarios like 'Tell me about a time you had to choose between automation investment and manual toil' or 'How would you handle a service with unreliable dependency?' Show thoughtfulness about automation—discuss when it's worth investing in automation vs. accepting manual processes. Mention your post-incident review philosophy and how you prevent recurring failures.[2][4]
Focus Topics
Performance Optimization and Capacity Planning
Discuss systematic approaches to performance optimization: profiling, bottleneck identification, database optimization techniques, caching strategies, and load testing. Include capacity planning methodology: monitoring capacity trends, forecasting growth, and proactively provisioning resources. Understand relationships between performance, reliability, and operational cost.
Practice Interview
Study Questions
Deployment Strategies and Release Safety
Discuss deployment strategies (blue-green deployments, canary releases, rolling deployments, feature flags) and when to use each. Understand how to minimize deployment risk through staged rollouts, monitoring during deployment, and quick rollback capabilities. Include CI/CD pipeline design and automated testing requirements before production.
Practice Interview
Study Questions
Automation, Toil Reduction, and Engineering Philosophy
Understand the distinction between toil (repetitive manual work) and engineering work. Discuss strategies for identifying, quantifying, and automating toil. Include specific examples: deployment automation, incident response automation, backup processes, configuration management, log management. Know when automation ROI makes sense vs. when manual processes are acceptable.
Practice Interview
Study Questions
SLO, SLA, and Error Budget Management
Understand SLO definition (how to set appropriate targets based on business requirements), SLA implications, error budget concepts, and how to use error budgets to balance feature velocity with reliability investments. Discuss trade-offs: tighter SLOs require more investment but provide better reliability. Show how you'd communicate error budget status to product teams.
Practice Interview
Study Questions
Infrastructure as Code (IaC) and Infrastructure Automation
Master infrastructure-as-code tools (Terraform, CloudFormation, Ansible, etc.) you've used in production. Understand version control for infrastructure changes, automated testing of infrastructure changes, reproducible deployments, and disaster recovery through IaC. Discuss benefits (consistency, auditability, speed) and challenges (state management, complexity, testing strategies).
Practice Interview
Study Questions
Behavioral and Values Alignment Round
What to Expect
In this 45-60 minute round, an interviewer explores your past experiences, how you handle challenges, your collaboration style, and alignment with Airbnb's values. You'll answer questions like 'Tell me about a significant incident you responded to,' 'Describe a difficult technical trade-off you made,' 'How do you work with engineers who disagree with reliability trade-offs,' and 'What does Airbnb's mission mean to you.' For mid-level SREs, interviewers evaluate your maturity in handling complex situations, your ability to mentor junior colleagues, sound judgment in reliability decisions, and authentic connection to Airbnb's culture.[1]
Tips & Advice
Prepare 4-5 detailed stories using the STAR method (Situation, Task, Action, Result), showcasing: managing a major incident, mentoring a junior engineer, making a difficult reliability-velocity trade-off, resolving a disagreement with colleagues, and improving system reliability significantly. Show emotional maturity and genuine learning from failures—avoid blaming others. Demonstrate how you balance SRE's reliability mission with business needs and developer productivity. Connect experiences to Airbnb's values: belonging (inclusive incident response, blameless post-mortems), community (cross-team collaboration), trust (reliability focus), and bias toward action (fast incident response, automation). Ask thoughtful questions revealing interest in Airbnb's SRE culture specifically. Be authentic and specific rather than generic. For mid-level, show evidence of growth from junior to mid-level, mentorship capabilities, and mature judgment in complex situations.
Focus Topics
Learning from Failures and Continuous Improvement
Discuss a time you made a mistake or when a system you built had significant issues. Show how you handled it professionally, what you learned, and how you prevented similar issues. Include your approach to post-incident reviews: blameless culture, psychological safety, actionable improvements. Show curiosity about root causes rather than surface symptoms.
Practice Interview
Study Questions
Airbnb Values and Mission Alignment
Connect your experiences to Airbnb's core values: belonging (inclusive, collaborative teams), community (supporting each other), trust (reliability focus), and bias toward action (rapid incident response, automation drive). Discuss what 'belong anywhere' means to you in the context of SRE work. Show genuine understanding of Airbnb's business and how your SRE work enables their mission.
Practice Interview
Study Questions
Cross-Functional Collaboration and Influence
Share examples of working effectively with developers, product managers, other SREs, or leadership. Discuss how you built trust, communicated technical concepts to non-technical stakeholders, influenced decisions, resolved disagreements constructively, and fostered collaboration. Show examples of mentoring junior colleagues or leading technical discussions.
Practice Interview
Study Questions
Technical Trade-off Decision Making
Share a story about making a difficult trade-off: reliability vs. feature velocity, automation investment vs. accepting toil, manual safety vs. deployment speed, or cost vs. availability. Explain your decision-making process, how you involved stakeholders and engineers, how you communicated the decision, and the outcome. Show mature judgment balancing competing priorities.
Practice Interview
Study Questions
Major Incident Response and Crisis Leadership
Prepare a detailed incident story: what happened, how you responded, your specific actions during the incident (communication, prioritization, decision-making), how you managed stress and helped others, what you learned, and improvements implemented. For mid-level, show leadership during incidents—perhaps coordinating across teams, mentoring someone responding to their first incident, or making critical decisions under time pressure.
Practice Interview
Study Questions
Frequently Asked Site Reliability Engineer (SRE) Interview Questions
Design a data structure that supports insert(value), remove(value), and getRandom() so that every currently-stored value is equally likely to be returned, with all three operations running in expected O(1) time. A hash set alone gives you O(1) insert/remove but not uniform O(1) random access; explain what you add to fix that.
Sample Answer
Direct answer
Keep a resizable array of the stored values plus a hash map from value to that value's index in the array. Insert appends to the array in O(1); getRandom picks a uniformly random array index in O(1); the trick is delete, which must not leave a gap: swap the removed value with the array's last element, update that moved element's index in the hash map, then pop the last slot off in O(1).
Structured elaboration
values: an array of the currently stored values, with no gaps.index_of: hash map from value to its current position invalues.
insert(val): if val is already in index_of, return false. Otherwise append it to values and record its index.
remove(val): if val is absent, return false. Otherwise look up its index, overwrite that slot with the array's last element (updating that moved element's entry in index_of to the vacated index), then pop the array's last slot and delete val from index_of. Because the moved element simply changes which index it lives at, and every array slot is always occupied by exactly one live value, no gap is ever created and no shifting of the remaining elements is needed.
getRandom(): choose a uniformly random integer index in [0, len(values)) and return values[that index]. Since each stored value occupies exactly one slot and slots are chosen uniformly, every value has equal probability of being returned.
The reason a plain hash set cannot support getRandom in O(1) is that hash tables give you no way to address "the k-th element" directly: you would need to walk buckets, which is not O(1) and not uniform once buckets have different chain lengths. The array gives you that direct O(1) addressing that a hash table structurally lacks.
Worked example
import random
class RandomizedSet:
def __init__(self):
self.index_of: dict[int, int] = {}
self.values: list[int] = []
def insert(self, val: int) -> bool:
if val in self.index_of:
return False
self.index_of[val] = len(self.values)
self.values.append(val)
return True
def remove(self, val: int) -> bool:
if val not in self.index_of:
return False
idx = self.index_of[val]
last_val = self.values[-1]
self.values[idx] = last_val
self.index_of[last_val] = idx
self.values.pop()
del self.index_of[val]
return True
def get_random(self) -> int:
return random.choice(self.values)
random.seed(42)
rs = RandomizedSet()
print(rs.insert(1))
print(rs.insert(2))
print(rs.insert(3))
print(rs.remove(2)) # swaps 3 into index 1
print(rs.values)
print(rs.get_random())
print(rs.get_random())
Running this (CPython's random module, seeded) prints:
True
True
True
True
[1, 3]
1
1
Key points
- The swap-with-last trick is what keeps delete O(1): it avoids shifting every element after the removed one.
- Uniformity comes from the array having no gaps:
random.choiceover indices is exactly a uniform choice over the stored values.
Complexity
O(1) averagefor insert, remove, and getRandom; O(n) space for the array and hash map together.
Edge cases
- Removing the last element in the array: the "swap with last" step is swapping an element with itself, which is harmless.
getRandomon an empty structure has no valid answer; guard it explicitly (raise, or document as undefined behavior) rather than lettingrandom.choicethrow an unhandled exception on an empty list.
Trade-offs & pitfalls
The most common mistake is deleting by shifting all elements after the removed index, which is correct but O(n), defeating the point. A second common mistake is deleting by using values.remove(val) in Python, which internally does that same O(n) scan-and-shift. The design absorbs a lighter-weight sibling problem well: an insertion-order-preserving set (for example, deduplicating items in a shopping cart while keeping display order) uses the same "array plus hash map of positions" composition, but it cannot use the swap-with-last trick, because swapping would destroy the insertion order it is trying to preserve. That variant instead needs either a tombstone marker left in place (with periodic compaction) or a doubly linked list plus hash map (the same structure used for an LRU cache), trading away the O(1) swap-delete for order preservation.
Design a governance model that settles who decides when product, engineering and SRE disagree on acceptable risk during an incident, for example whether to keep a risky revenue-generating feature on. What is decided in advance, who holds the final call, and how is the decision recorded?
Sample Answer
The idea in plain words
Disagreements about acceptable risk during an incident are settled badly when they are settled live, by whoever argues loudest. The governance model moves most of the argument to before the incident: thresholds, decision rights, a tie-break and a record format are agreed in calm conditions, so that during the incident the incident commander (IC, the person who coordinates the response and makes the calls) applies rules instead of negotiating. Product accepts revenue risk, SRE and the IC hold the reliability and safety limits, and one named executive breaks ties quickly.
Three terms first
An SLO (service-level objective) is a target such as 99.9% of requests succeed over 30 days. The error budget is the allowed failure: 100% - 99.9% = 0.1%. Over 30 days that is
30×24×60×0.001=43.2 minutes of full outageBurn rate is the observed error rate divided by the allowed error rate. A burn rate of 1 uses exactly the whole budget by the end of the window.
What the IC does first
Three checks, in this order. (1) Does a safety trigger apply? If yes, the feature goes off and nothing is negotiated. (2) Is a reliability threshold met? If yes, the default action written next to that threshold applies. In the example below that action is feature off. A lower threshold can instead name an earlier step on the degradation ladder (ordered steps short of switching the feature off), such as disabling an optional sub-feature. (3) Does someone ask to keep it on? Then the request goes to the named product executive, who may grant a limited exception inside the rules below, and the clock and the record start.
What is decided in advance
| Element | Content | Example |
|---|---|---|
| Safety triggers (conditions the business never trades for revenue) | Conditions where the feature goes off, with no exception process | Data being corrupted or lost; suspected compromise; a legal or regulatory violation; risk to physical safety |
| Reliability thresholds per feature | A measurable condition and the default action when it is met | Burn rate (how fast the error budget is being used, as defined in the three terms above) at 10 times or more for 15 minutes: feature off |
| Degradation ladder per feature | Ordered steps short of "off" | Step 1: disable the optional sub-feature. Step 2: lower the rate limit. Step 3: off |
| Exception rule | Who may ask to keep the feature on, for how long, and under what conditions | A named product executive; at most 60 minutes at a time; only if no safety trigger applies and at least 50% of the error budget remains |
| Tie-break | Who decides when the IC and the exception requester disagree | A named executive, reachable by paging, who within 15 minutes settles disputes about facts and judgement (does a safety trigger apply, is the budget figure right, is the evidence enough) but cannot waive a condition the exception rule states; if unreachable, the safe state (feature off) stands |
| Decision record | Fields written into the incident log for every such call | See below |
| Review | When exceptions are examined | Every exception reviewed within a week; thresholds recalibrated if they were wrong |
Who holds the final call
- During the incident, within the agreed envelope (the set of actions and thresholds agreed in advance): the IC. The IC applies the thresholds and does not need approval to turn a feature off on a safety trigger.
- Outside the envelope (keep the feature on although a threshold is met): only the named product executive, in writing, for a limited time, accepting the stated risk. The IC may refuse where a safety trigger applies.
- Disagreement that remains about the facts or the judgement: the tie-break executive. The tie-break exists so that a disagreement costs minutes, not hours.
The IC should not be the person who owns the revenue target of the feature, and the product executive should not be the person judging data safety. Splitting the roles this way keeps each risk with the party that can bear it.
Decision record
Each entry in the incident log has: time; the decision; the options considered; who decided and in what capacity; the evidence (graphs, burn rate, error counts); the risk accepted and by whom; the expiry time; and the condition that triggers a re-decision. The scribe writes it while the call is made, and the decider confirms the wording in the channel.
Worked example (assumptions)
A one-click upsell feature earns an assumed 1,500 revenue units per hour. With the feature on, 2% of requests fail; the SLO allows 0.1%.
burn rate=0.1%2%=20Spending 20 times the allowed rate for an hour uses 60×0.02=1.2 minutes of full-outage equivalent, which is 1.2÷43.2≈2.8% of the monthly budget. At that rate, the full budget would be gone in 720÷20=36 hours (720 is the hours in 30 days).
Why 60 x 0.02 gives minutes of outage: in 60 minutes at a 2% failure rate, the number of failed requests equals what a total outage (every request failing) would produce in 60 x 0.02 = 1.2 minutes. The budget is counted in that unit.
The product side is now quantified. The feature earns 1,500 revenue units per hour, so a 60-minute exception earns 1,500 revenue units and spends 2.8% of the month's budget, which is 1,500 / 1.2 = 1,250 revenue units earned per minute of budget spent. In the late-window case the same exception spends 1.2 of the 4.32 minutes left, which is 1.2÷4.32≈28% of what remains. That is why the rule asks for 50% remaining: the budget is also the reserve for unplanned events later in the month.
The example thresholds are starting points a team tunes from its own history. 10 times burn would use up a whole 720-hour budget in 720÷10=72 hours, fast enough to act on but slow enough that a 15-minute window filters out brief blips; the 50% rule keeps half the month's allowance in reserve; the 60-minute cap forces a new decision within an hour.
The threshold (10 times or more for 15 minutes) is met, so the default is feature off. Product asks for a 60-minute exception.
| Case | Budget remaining | After 60 minutes at this rate | Exception rule (50% remaining) | Outcome |
|---|---|---|---|---|
| Early in the window | 80% (34.56 min) | 33.36 min left, 77% | Met | Exception can be granted by the named executive, in writing, for 60 minutes, with the re-decision time recorded |
| Late in the window | 10% (4.32 min) | 3.12 min left, 7% | Not met | Feature stays off; the executive can still ask the tie-break executive to check the facts, such as the remaining-budget figure, but the 50% condition is not waived on the spot; if the team believes the rule is wrong, it is changed at the review |
In both cases a safety trigger overrides everything: if the failing requests were corrupting orders, the feature goes off at once and the product owner is informed.
Recommendation
Adopt the table above, publish it where responders find it during an incident, rehearse it in a game day (a practice incident), and review it quarterly. What flips the design: a very small company may put the tie-break and product-exception roles in one person; a regulated business may add compliance to the safety triggers.
Common mistakes
- Leaving "who decides" to be discovered mid-incident.
- Giving the IC authority but no pre-agreed thresholds, so every call is a personal confrontation.
- Letting exceptions renew automatically with no expiry.
- No record, so the same debate repeats next quarter.
- Setting thresholds once and never checking them against real incidents.
Explain Kubernetes' maxSurge and maxUnavailable rolling-update parameters. For a 100-pod deployment, how would you configure them differently for a latency-sensitive service versus a batch worker?
Sample Answer
Direct answer
maxSurge controls how many EXTRA pods above your target replica count can exist temporarily during a rollout; maxUnavailable controls how many pods can be DOWN (below target) at once. Together they set the trade-off between rollout speed/extra resource usage and how much capacity you're willing to sacrifice mid-rollout.
Structured elaboration
For a 100-pod deployment:
maxSurge: 25%means up to 25 extra pods can be created (125 total running temporarily) before old ones start being removed.maxUnavailable: 25%means up to 25 pods can be unavailable at once, so at minimum 75 pods are always serving traffic.- Setting both to 0 isn't allowed (Kubernetes needs at least one of them to make forward progress), and setting both to a large value maximizes rollout SPEED at the cost of both extra resource consumption AND reduced available capacity simultaneously.
Latency-sensitive service: prefer maxUnavailable: 0 (never drop below full target capacity, since capacity loss directly hurts p99 latency under load) combined with a modest maxSurge (say 10-25%) so new pods come up gradually without demanding a huge resource spike all at once. This is slower but protects the SLA.
Batch worker: can tolerate maxUnavailable being higher (say 50%), since a temporarily smaller worker pool just means jobs queue a bit longer rather than users seeing degraded latency; this lets the rollout complete faster with less need for surge capacity, since you're willing to sacrifice throughput temporarily instead of paying for extra headroom.
Worked example
For the latency-sensitive service at 100 replicas with maxUnavailable: 0, maxSurge: 25: Kubernetes first creates 25 new pods (125 total), waits for them to become ready, then removes 25 old pods (back to 100, all new), repeats: creates 25 more new (125 again, this time mixed), removes 25 more old, and so on, always keeping at least 100 healthy pods serving traffic throughout. For the batch worker at maxUnavailable: 50, maxSurge: 0: Kubernetes removes up to 50 old pods first (down to 50 capacity), creates 50 new ones to replace them, and repeats, needing no extra capacity headroom at all but running at half capacity partway through.
Trade-offs and pitfalls
Higher surge means faster rollouts but a temporary resource spike your cluster's autoscaler or node capacity needs to be able to absorb; if it can't, new pods stall in Pending and the rollout stalls too. The common mistake is picking these values once and never revisiting them as traffic patterns or cluster capacity change, so a setting that was safe at launch quietly becomes risky (or needlessly slow) as the service scales.
You need multi-cloud parity on a new platform. How would you weigh Terraform against Pulumi, Crossplane, and cloud-native templates, and what would actually tip your recommendation?
Sample Answer
Direct answer
Default to Terraform for the foundational, provider-broad layer, since it has the deepest multi-cloud provider coverage and the most mature ecosystem for infra teams. Reach for Pulumi specifically when the team is already strong in a general-purpose language and the win is expressiveness, real loops and functions and existing test frameworks, rather than provider coverage. Reach for Crossplane (a Kubernetes-native IaC tool that manages cloud resources as Kubernetes objects) specifically when continuous reconciliation matters more than plan/apply control, typically because the platform is already Kubernetes-centric. Treat cloud-native templates as a single-cloud tool, not a multi-cloud contender, useful only for the narrow slice of a platform that's genuinely cloud-specific anyway.
Structured elaboration
The axis that actually decides this
"Multi-cloud parity" collapses into three separable questions most comparisons blur together: does the tool have mature provider support for everything needed across all the clouds in play; is drift corrected continuously or only when someone runs a plan; and does the team's existing skill set make the tool's config language an asset or a liability. Answering those three first makes the tool choice close to mechanical; debating "Terraform vs Pulumi" in the abstract without them just becomes a preference argument.
Comparison
| Terraform | Pulumi | Crossplane | Cloud-native templates (CFN/ARM/Bicep) | |
|---|---|---|---|---|
| Config language | HCL, declarative DSL | General-purpose (TS/Python/Go/C#) | YAML + Compositions, Kubernetes CRDs (Custom Resource Definitions) | Vendor-specific declarative templates |
| State model | Remote state file, plan/apply on demand | Remote state, managed or self-hosted, plan/apply on demand | Stored in the Kubernetes control plane, continuously reconciled | Service-managed (CFN stacks, ARM deployments) |
| Provider maturity | Broadest multi-cloud ecosystem, longest track record | Growing, generally mirrors Terraform's providers but can lag on new resources | Improving quickly but narrower than Terraform for less-common resources | Excellent for its own cloud, doesn't exist for others |
| Drift handling | Detected on next plan, remediated on next apply; not continuous | Same model as Terraform: on demand, not continuous | Continuous reconciliation by default, closer to self-healing | Varies by vendor, generally not continuous |
| Multi-cloud parity | Strong: one tool, consistent workflow across providers | Strong: same language across providers | Strong in principle, weaker in provider breadth today | Weak by design: one template language per cloud |
| Best-fit team | Infra/platform teams comfortable with a DSL | App-heavy teams wanting real functions/loops/tests in the language they already use | Teams already running Kubernetes as the control plane | Teams committed to a single cloud who want the vendor's fastest-supported feature surface |
What tips the recommendation in practice
- If the team has no strong Kubernetes investment yet, Crossplane's continuous-reconciliation advantage isn't free: adopting it means adopting Kubernetes as infrastructure for infrastructure, a bigger commitment than the reconciliation benefit alone justifies for most platforms.
- If provider coverage for a specific, load-bearing service is the actual blocker, a niche managed service only has a mature cloud-native or Terraform provider, not a Pulumi or Crossplane one yet, that single gap can decide the whole platform's tooling, since running two different IaC tools for two different resource types is its own maintenance cost.
- If the team is already writing the application in TypeScript or Python and wants infra tests to run in the same CI job with the same test framework as the app, that's Pulumi's actual differentiator, the shared tooling and testability, not "the language is nicer."
- Cloud-native templates earn a place even in a multi-cloud platform for the narrow slice of resources that are genuinely cloud-specific, where the vendor's own template format gets day-one support for a new feature before any third-party provider catches up; that's a deliberate, scoped exception, not a sign the whole platform should move to vendor templates.
Worked example
Applying the axis to one concrete requirement: the platform needs a managed Kubernetes cluster on both AWS (EKS) and GCP (GKE), plus continuous enforcement that no cluster ever drifts from its baseline node count and network policy.
- Provider coverage: both EKS and GKE have mature, long-standing Terraform providers; this doesn't rule anything out yet.
- Continuous drift correction: this is the requirement that actually narrows the field, since "no cluster ever drifts" is a continuous-reconciliation ask, not a periodic-plan ask, which points toward Crossplane, or a Terraform-plus-a-separate-reconciler-loop hybrid, over plain Terraform.
- Team skill: if the platform team already operates Kubernetes clusters as their day job, Crossplane's operational model, another set of controllers to run, is a marginal addition, not a new discipline; that tips the recommendation to Crossplane for this specific requirement, while Terraform still provisions the surrounding account-level resources, networking, IAM, that don't need continuous reconciliation.
This is the actual decision process: none of the four tools wins as a general answer, the specific requirement, continuous drift correction here, determines which axis matters most.
Trade-offs & pitfalls
- Running two tools, Terraform for foundational resources and Crossplane for continuously-reconciled workload resources, for example, is a legitimate hybrid, but it's an explicit architectural decision with its own coordination cost, not a default to reach for without a specific requirement driving it.
- Pulumi's expressiveness, real loops, conditionals, functions, is also its biggest risk: it's easy to write infra code that's hard to review because the actual resources created depend on runtime logic, not something visible from reading the file the way a Terraform
for_eachmostly is. - Crossplane's continuous reconciliation means an unintended manual change gets reverted automatically, a feature until someone makes an emergency manual fix during an incident and Crossplane quietly reverts it a few minutes later; break-glass procedures need to account for that.
- Cloud-native templates being excellent for their own cloud is real, but it's also the lock-in mechanism; a platform leaning on them for anything beyond the narrow cloud-specific exception has quietly opted out of the multi-cloud parity goal the question started with.
Discuss trade-offs between server-side and client-side instrumentation for latency SLIs, including the impact of clock skew, network variance, sampling, and where to place histogram buckets. How do these choices affect SLO accuracy and trustworthiness?
Sample Answer
Where you measure latency (server-side versus client-side) changes what the number actually represents, and conflating the two, or trusting either blindly, produces an SLO that looks precise but measures the wrong thing.
Structured elaboration
Server-side instrumentation measures only the time the backend itself spends processing a request; it's cheap, low-variance, and easy to instrument consistently, but it is BLIND to everything that happens on the network between the client and the server (DNS lookup, TLS handshake, queueing, actual transit time), which for many users is a large fraction of perceived latency. Client-side instrumentation captures the full, true user-perceived latency, but introduces its own noise: clock skew between client devices (a client's own clock can be seconds off, corrupting any timestamp-difference calculation done client-side without a server-synchronized reference), highly variable network conditions across users, and sampling bias if only a subset of clients (e.g. those with a certain browser or app version) report telemetry at all.
Worked example
A service reports a server-side p95 of 80ms, comfortably inside its SLO, while client-side RUM data shows real users experiencing p95 latency of 450ms; the gap is almost entirely network transit and client-side rendering time invisible to the server-side number. An SLO built only on the server-side figure would report perfect health while the actual user experience is materially worse, which is exactly why it matters to declare, explicitly, which of the two the SLO is based on, and why most mature setups track both and set the CUSTOMER-facing SLO on the client-observed number, using the server-side one as an internal diagnostic signal.
Trade-offs and pitfalls
Histogram bucket placement compounds this problem: if buckets are chosen assuming server-side-scale latencies (fine-grained near 50-100ms) but applied to client-side data with true tails out past 1 second, the histogram's percentile estimate near p95/p99 becomes inaccurate because there aren't enough bucket boundaries where the real tail actually lives. Sampling client-side telemetry (common for cost reasons at very high traffic) also needs to be checked for bias: if only users on a fast, stable network path are more likely to successfully report their client-side telemetry (e.g. because a flaky connection also drops the telemetry beacon), the sampled data will look artificially fast, systematically underestimating the true tail.
Leadership wants to cut cloud costs by 30% without dropping below 99.99% uptime for critical services. Walk through how you'd find the savings and what you'd protect no matter what.
Sample Answer
Direct answer
Frame the cut through the 99.99% error budget, not a blanket percentage. 99.99% allows about 52.6 minutes of downtime a year; anything that doesn't touch the paths that consume that budget is safe to cut aggressively, and anything that does must be modeled against it explicitly before you touch it. In practice that means chasing waste and inefficiency hard (usually most of the 30%), and treating redundancy, failover paths, and DR test cadence as protected unless you can show the specific budget impact is acceptable.
A three-bucket framework for the savings
D99.99%=(1−0.9999)×525600 min=52.56 min/yrThat number is the currency every cut gets priced in.
| Bucket | Examples | Availability impact |
|---|---|---|
| 1. Waste elimination | Idle/overprovisioned instances, orphaned disks/snapshots/IPs, unscheduled non-prod environments | None, doesn't touch the serving or failover path |
| 2. Efficiency gains | Rightsizing with headroom preserved, reserved/spot capacity for stateless, replaceable workers, caching hot reads | Neutral to positive if done with canary rollout and autoscaling guardrails |
| 3. Structural changes | Fewer replicas, longer failover windows, single cloud/provider consolidation, reduced DR test cadence | Directly spends the 52.6 min/yr error budget, must be modeled before approval |
Chase bucket 1 and 2 first and aggressively (they rarely conflict with availability); only reach into bucket 3 if 1 and 2 don't get you to 30%, and price every bucket-3 cut against the budget above.
Worked example
Suppose an audit of monthly compute spend of $300,000 finds 15% idle or overprovisioned capacity, plus another 10% recoverable through rightsizing and reserved commitments on stateless, replaceable capacity:
wasterightsizingsubtotal=$300,000×0.15=$45,000/mo=$300,000×0.10=$30,000/mo=$45,000+$30,000=$75,000/mo=25% of spendThat's 25 of the 30 points from buckets 1 and 2 alone, with essentially zero availability risk. The remaining 5 points has to come from bucket 3, for example dropping a redundant standby from 3 independent paths to 2 on some service. Whether that's safe depends entirely on whether that service is in the 99.99% critical scope. Reusing the same series/parallel redundancy model above (an N-way redundant path's unavailability is the product of each independent unit's own unavailability, since all N units have to fail at the same time for the whole path to be down: UN=(1−a)N), for a building block at a=0.99:
N=3:N=2:U3=(0.01)3=0.000001⇒D3=0.000001×525600=0.5256 min/yrU2=(0.01)2=0.0001⇒D2=0.0001×525600=52.56 min/yrDropping that one path from N=3 to N=2 raises its expected downtime contribution from about half a minute a year (0.5256 min/yr) to 52.56 minutes a year, a 100x jump that would consume the entire annual budget for the 99.99% target on that one path alone. That's the concrete argument for why redundancy counts on in-scope critical services are protected regardless of the cost target: the math shows the cut doesn't save what it looks like it saves once you price the risk.
Trade-offs and pitfalls
The classic failure is applying a flat 30% cut across the board instead of segmenting critical from non-critical, which either misses easy wins in non-critical systems or, worse, quietly erodes redundancy on a critical path because nobody explicitly modeled the budget impact. Watch for Goodhart's-law style gaming too: cutting observability or alerting spend looks free on the invoice but raises mean time to detect, which inflates the effective downtime against the same budget without showing up as an "availability" line item until an incident hits. What to protect no matter what: replica or quorum counts below the tested minimum on in-scope services, cross-region failover paths, backup and DR test cadence, and on-call staffing, because all four either directly hold the redundancy math above or determine how fast you can react when it fails.
Extend an LRU cache design to support per-entry TTL (time-to-live) and safe concurrent reads/writes from multiple threads. Describe the data structures, locking or sharding strategies to minimize contention, eviction rules when TTL expires, and how to handle race conditions between expiry and access.
Sample Answer
Direct answer
Extending an LRU (least-recently-used) cache with per-entry time-to-live (TTL, a lifespan after which an entry is no longer considered valid) means treating expiry and eviction as two independent mechanisms layered on the same structure: TTL decides whether an entry is even valid to serve at all, LRU decides who gets removed when the cache is full, regardless of whether that entry's TTL has expired yet. Safe concurrent access comes from sharding the cache into N independently locked pieces by key hash, so unrelated keys never contend for the same lock, rather than one global lock serializing every request. The one genuine race to guard against is a reader and an expiry-driven cleanup touching the same key at the same instant, which a single lock per shard around each operation's full check-then-mutate sequence eliminates by construction.
Structured elaboration
Data structures. Per shard: an ordered map (a doubly linked list plus a hash index, or collections.OrderedDict in Python) storing key -> (value, expires_at). get first checks expires_at against the current time; if expired, the entry is deleted and treated as a miss, never served stale. If still valid, it is moved to the most-recently-used end, same as a plain LRU. put inserts or updates the entry with a fresh expires_at, then evicts from the least-recently-used end while the shard is over capacity, exactly as a TTL-unaware LRU would, an unexpired entry can still be evicted early purely for space if it is cold enough.
Locking and sharding to minimize contention. A single lock around the whole cache serializes every request regardless of which key it touches, the same contention problem as a naive shared counter. The fix is the same: partition keys across N shards by hash(key) % N, each with its own lock, so two threads touching different shards never block each other; within a shard, the critical section (a dict lookup, a move, maybe an eviction) is small enough that a simple mutex around the whole operation is both correct and fast, a lock-free linked-list-based LRU is real engineering effort that rarely pays for itself compared to just adding more, smaller shards.
Eviction rules on TTL expiry. Two independent triggers remove an entry: lazily, on access, if its expires_at has passed; and capacity-driven, on put, evicting the least-recently-used entry regardless of that entry's own TTL state once the shard is full. A background sweep thread that proactively scans for and removes expired-but-never-accessed entries is an optional memory-hygiene addition, not a correctness requirement, lazy expiry alone already guarantees an expired entry is never served, it just might sit unreclaimed in memory until LRU pressure or a sweep removes it.
Race conditions between expiry and access. Because the expiry check and the touch-or-evict mutation both happen inside the same lock acquisition as one atomic operation, no other thread on that shard can observe a half-expired state in between. Two remaining subtleties matter: use a monotonic clock (one that only ever moves forward, unaffected by wall-clock adjustments) for expiry comparisons, since a wall-clock adjustment (an NTP correction, a daylight-saving shift) can jump time backward and silently corrupt TTL math; and treat the exact boundary consistently, an access at precisely expires_at should be treated as expired, not as a coin flip.
Code
import threading, time
from collections import OrderedDict
class TTLLRUCache:
def __init__(self, capacity, default_ttl):
self._capacity = capacity
self._default_ttl = default_ttl
self._store = OrderedDict() # key -> (value, expires_at)
self._lock = threading.Lock()
def get(self, key, now=None):
now = time.monotonic() if now is None else now
with self._lock:
entry = self._store.get(key)
if entry is None:
return None
value, expires_at = entry
if now >= expires_at:
del self._store[key]
return None
self._store.move_to_end(key)
return value
def put(self, key, value, ttl=None, now=None):
now = time.monotonic() if now is None else now
ttl = self._default_ttl if ttl is None else ttl
with self._lock:
if key in self._store:
del self._store[key]
self._store[key] = (value, now + ttl)
self._store.move_to_end(key)
while len(self._store) > self._capacity:
self._store.popitem(last=False)
class ShardedTTLLRUCache:
def __init__(self, shard_count, capacity_per_shard, default_ttl):
self._shards = [TTLLRUCache(capacity_per_shard, default_ttl) for _ in range(shard_count)]
self._shard_count = shard_count
def _shard_for(self, key):
return self._shards[hash(key) % self._shard_count]
def get(self, key, now=None):
return self._shard_for(key).get(key, now=now)
def put(self, key, value, ttl=None, now=None):
self._shard_for(key).put(key, value, ttl=ttl, now=now)
if __name__ == "__main__":
# basic TTL expiry
cache = TTLLRUCache(capacity=2, default_ttl=10)
cache.put("a", 1, now=0)
print("get a at t=5 (not expired) ->", cache.get("a", now=5))
print("get a at t=15 (expired, ttl=10) ->", cache.get("a", now=15))
# LRU eviction independent of TTL (long ttl so eviction is purely LRU-driven)
cache2 = TTLLRUCache(capacity=2, default_ttl=100)
cache2.put("x", 100, now=0)
cache2.put("y", 200, now=1)
cache2.get("x", now=2) # touch x -> y becomes LRU
cache2.put("z", 300, now=3) # evicts y (LRU), not due to TTL (ttl=100, still valid)
print("y evicted by LRU (not TTL) ->", cache2.get("y", now=4) is None)
print("x survived ->", cache2.get("x", now=4) == 100)
# concurrency check: 16 threads, 200 put-then-get round trips each, shared 8-shard cache
shared = ShardedTTLLRUCache(shard_count=8, capacity_per_shard=64, default_ttl=1000)
errors = []
def worker(tid):
for i in range(200):
key = f"t{tid}-{i}"
shared.put(key, (tid, i), now=0)
val = shared.get(key, now=0)
if val != (tid, i):
errors.append((key, val))
threads = [threading.Thread(target=worker, args=(t,)) for t in range(16)]
for th in threads:
th.start()
for th in threads:
th.join()
print("concurrent put/get across 16 threads, errors ->", len(errors))
# exact boundary: an access at precisely expires_at counts as expired
cache3 = TTLLRUCache(capacity=2, default_ttl=1.0)
cache3.put("k", 42, now=0.0)
print("exactly-at-expiry (t=1.0) counts as expired ->", cache3.get("k", now=1.0) is None)
Output (executed as shown, using an injected clock so TTL behavior is deterministic and reproducible):
get a at t=5 (not expired) -> 1
get a at t=15 (expired, ttl=10) -> None
y evicted by LRU (not TTL) -> True
x survived -> True
concurrent put/get across 16 threads, errors -> 0
exactly-at-expiry (t=1.0) counts as expired -> True
The concurrency check ran 16 threads, each performing 200 put-then-get round trips against a shared 8-shard cache, and confirmed every value was read back exactly as written with zero errors, evidence the sharded locking is actually safe under real concurrent access, not just single-threaded correctness.
Trade-offs and pitfalls
- Lazy-only expiry can leave cold, expired entries resident indefinitely if the cache has generous capacity and that key is never looked up again; add a background sweep if bounding memory tightly matters more than the extra CPU cost of scanning.
- Shard count is a real tuning knob, not a fixed choice. Too few shards under-spreads lock contention; too many wastes memory on mostly-empty per-shard structures and adds bookkeeping overhead.
- Distributed sharding is the same idea one layer up. The identical hash-the-key-to-a-shard principle extends from in-process locks to independent nodes in a distributed cache: shard by consistent hashing across nodes so the cache's total capacity and throughput scale past one machine, with a routing layer (client-side or proxy-side) sending each request to the node that owns its key's shard.
- Persistence across restarts should stay proportionate to what TTL data actually needs. Since every entry already has a bounded lifespan, a periodic best-effort snapshot to disk or an external store, reloaded at startup and immediately filtered to discard anything whose
expires_athas already passed relative to current wall-clock time, is sufficient; treating this like a database's durability guarantee (distributed consensus, write-ahead logs) is usually over-engineering for data that was always meant to expire. - A common wrong turn: using wall-clock time (
time.time()) instead of a monotonic clock for TTL comparisons. It works in every normal test run and fails exactly once, silently, during a real clock adjustment in production, which is precisely why it is easy to ship and hard to catch without deliberately testing for it.
Explain the union-find (disjoint set) data structure: the operations find and union, how path compression and union by rank/size improve performance, and why the amortized cost is nearly constant. Describe two SRE use cases where union-find is useful, such as offline connectivity queries or grouping servers by failure domain.
Sample Answer
Direct answer
Union-Find (disjoint set union) maintains a partition of elements into disjoint sets and supports two operations: find(x), which returns a representative (root) identifying which set x currently belongs to, and union(x, y), which merges the sets containing x and y into one. On its own, a naive version can degrade to O(n) per operation on an adversarial sequence of unions, but adding path compression (flattening the tree toward the root during find) and union by rank or size (always attaching the smaller tree under the larger one) brings the amortized cost per operation down to O(α(n)), the inverse Ackermann function, a value effectively bounded by 4 for every input size that could exist in practice. Two concrete infrastructure use cases: batching offline connectivity queries over a static snapshot of a network graph, and grouping servers or hosts into failure domains from a stream of "these two are on the same rack/switch/power circuit" observations.
Structured elaboration
The two operations in detail:
find(x): walkx's parent pointer chain up to the root (the node that is its own parent). With path compression, every node visited during this walk gets repointed to point more directly at the root (either straight to the root, or to its grandparent under "path halving"), so subsequentfindcalls on those same nodes are faster.union(x, y): callfindon both, and if the roots differ, attach one root under the other. Union by rank tracks an upper bound on each tree's height and always attaches the shorter tree under the taller one (breaking ties arbitrarily and bumping the surviving root's rank); union by size does the analogous thing tracking subtree size instead of height. Both give the same asymptotic guarantee.
Why amortized cost is near-constant. Union by rank alone bounds any tree's height at O(logn), so even without path compression, each find is O(logn) worst case. Path compression alone also gives an amortized O(logn) bound. The combination of both is what produces the much stronger O(α(n)) amortized bound (a result due to Tarjan, 1975): every find call that walks through a node also flattens that node's future lookups, and union by rank ensures that no tree is allowed to grow needlessly tall in the first place, so the "expensive" flattening work a find call does gets amortized (spread out) over all the future cheap lookups it enables.
Two infrastructure use cases:
- Offline connectivity queries over a static graph. Given a fixed snapshot of a network topology (which hosts can reach which others through some set of links) and a batch of "are A and B in the same reachable group" queries, build the Union-Find structure once by unioning every known edge, then answer every query in near-constant time via two
findcalls and an equality check, instead of re-running a graph traversal per query. - Grouping resources by failure domain. Given a stream of pairwise "these two hosts share a failure domain" facts (same rack, same top-of-rack switch, same power distribution unit, same availability zone), union each pair as the facts arrive. The resulting sets are exactly the maximal failure domain groups, useful for placement decisions (spread replicas across different
findroots to avoid correlated failure) and for blast-radius estimation during an incident (given one affected host,findits root and treat every other member of that set as at elevated risk).
Worked example
For a tiny illustration of the failure-domain use case: suppose 6 hosts and the observed co-location facts arrive in this order: (host1, host2) share a rack, (host3, host4) share a rack, (host2, host3) share a power distribution unit, (host5, host6) share nothing observed yet. After processing the three known facts, the disjoint sets are {host1, host2, host3, host4} and {host5} and {host6}, three failure domains, even though no single fact directly named host1 and host4 together. This transitive-merging behavior (the union of a union) is exactly what a manual "same rack" lookup table would miss without repeatedly re-deriving connectivity, and is what Union-Find gives you for free as facts accumulate.
Trade-offs and pitfalls
- Union-Find has no efficient "un-union." Once you have merged the failure domains for host2 and host3 based on a shared power distribution unit, there is no cheap way to later split them back apart if that fact turns out to be stale (the unit was decommissioned, hosts were physically moved). A structure that must support both merges and un-merges over time needs periodic rebuilds or a genuinely dynamic-connectivity data structure, a materially harder problem.
- Common mistake: treating Union-Find as if it directly answers "list every host in this failure domain." It answers "are these two in the same domain" and "how many domains are there" in near-constant time, but producing the actual member list of a given domain requires a separate O(n) grouping pass over all elements by their final root, not a property of the structure itself.
- Common mistake: implementing find/union without EITHER optimization and assuming it is "fine because it is a small graph." On a pathological build order (facts arriving in a long chain, host1-host2, host2-host3, host3-host4, ...), an unoptimized version degrades to a linked list and each subsequent
findcosts O(n), which matters even at moderate scale if the facts stream is large or adversarially ordered. - Failure-domain grouping is a good fit for Union-Find specifically because facts only ever ADD information (a shared rack or shared power unit is discovered, not un-discovered, in the normal operating case); if the underlying use case instead needed to react to topology changes that REMOVE a shared-domain relationship, this technique alone would not be enough.
Design a scoring approach to rank automation candidates. What would you capture for each candidate, how would you weight and normalise it, and how would you decide between 'automate now' and 'defer or leave alone'?
Sample Answer
The idea in plain words
A scoring approach turns a pile of opinions ("this is painful") into comparable numbers. The design has three parts: what to record for every candidate, how to turn each raw fact into a comparable score and combine the scores, and a decision rule that sends each candidate to automate now, defer, or leave alone. Two ideas make it trustworthy: put hard stops (gates) before the score so a high score cannot override a fatal problem, and score from measured facts (hours, errors, effort) rather than gut feel.
1. What to capture for each candidate
| Field | Why it matters |
|---|---|
| Hours saved per year (occurrences per week x minutes per occurrence / 60 x 52, or occurrences per month x minutes / 60 x 12, net of the human review that remains) | The size of the prize |
| Errors, incidents or pages caused by doing it by hand in the last year | Value beyond time |
| Process stability (have the steps changed in the last 12 months, are they written down) | Automating a moving target wastes the build |
| Build effort in hours, and expected upkeep in hours per year | The cost side, including maintenance |
| Reach: how many people or teams run it or wait on it | Developer-time and organisational leverage |
| Blast radius if the automation is wrong (how much can be damaged if it does the wrong thing: read-only, internal, customer-visible, money or production data) | Decides how much safety work is needed |
| Dependencies and owner | Sequencing and who maintains it |
For a software organisation the same fields apply to developer workflows: hours a developer spends waiting on or hand-driving a step (environment setup, flaky builds, release chores), multiplied by how many developers are affected, with the impact later measured as developer time recovered.
2. Normalise and weight
Raw values have different units (hours, counts, people), so normalise them: convert each to a 1 to 5 band using fixed thresholds written down in advance (not rescaled against whichever candidates happen to be on the list, which makes scores shift when someone adds an item). Example thresholds:
| Band | Hours saved per year | Errors per year | Build hours | Reach (people) |
|---|---|---|---|---|
| 1 | under 50 | 0 | over 240 | 1 |
| 2 | 50 to 149 | 1 to 2 | 121 to 240 | 2 to 3 |
| 3 | 150 to 299 | 3 to 5 | 61 to 120 | 4 to 7 |
| 4 | 300 to 599 | 6 to 10 | 21 to 60 | 8 to 15 |
| 5 | 600 or more | over 10 | 20 or fewer | over 15 |
Why these thresholds: each step is two to three times the one before (50, 150, 300, 600 hours; 20, 60, 120, 240 build hours), so the bands spread across small and large prizes. At about 2,000 working hours in a person-year, band 5 (600 hours or more) is roughly a third of one person's year. The numbers belong to one organisation, not to every organisation: a team of five with few candidates should scale the reach bands down (nobody reaches more than 15 people), and a large organisation should scale the hours bands up. Set them once, from a few past automations whose size you know, then leave them alone.
In the formula below, each term stands for a band: time is the band for hours saved, errors the band for errors avoided, stability a direct 1 to 5 judgment of how settled the process is, effort band the reversed band for build hours (5 means 20 hours or fewer, not 5 hours), and reach the band for people affected.
Stability is judged directly on 1 to 5 (5 means unchanged for at least 12 months and written down; 1 means the steps change roughly monthly). The weights are a judgment call that the team agrees on, and they sum to 1:
score=0.35×time+0.20×errors+0.15×stability+0.20×effort band+0.10×reachBuild effort is banded so that cheap builds score high. Payback is deliberately not a weighted term, because it is derived from hours saved and effort and would count them twice; it is used as a gate instead.
3. The decision rule
- Gates first (pass or fail checks that sit before the score, so a high score cannot override them). Leave alone or fix first if any of these fails: payback at most 12 months (build cost divided by monthly saving net of upkeep); stability band at least 2; a named owner who will maintain it; and a safety plan (a dry-run, which reports what the automation would do without doing it; an approval step; and a rollback, a tested way to undo the change) if the blast radius includes money, customers or production data.
- Then the score: 3.5 or more means automate now; 2.5 to under 3.5 means defer and re-score after fixing the weakest criterion; under 2.5 means leave alone. Why those cut-offs: the weights sum to 1, so a candidate scoring 3 on every term totals exactly 3.0 and one scoring 4 on every term totals exactly 4.0. A total of 3.0 is the middle of the scale, so 3.5 asks for clearly above middle and 2.5 for clearly below. They are starting values: to calibrate, score ten past automations whose payoff you already know and move the cut-offs until the ranking matches what happened.
- Dependencies reorder the queue: an item that other automations need first (a dependency) moves up even if its own score is modest.
This rule is an illustration. A real process also needs a review of the weights each quarter, a check that different people scoring the same item land close together, and a way to override the score with a written reason.
Worked example (hypothetical candidates, rate USD 80 per hour, upkeep assumed at 20% of build hours per year)
| Candidate | Hours saved/yr | Errors | Stability | Build hours | Reach |
|---|---|---|---|---|---|
| K1 Ephemeral test environment setup (a throwaway test environment created on demand and deleted afterwards) | 520 | 4 | 4 | 80 | 22 |
| K2 Quarterly licence audit | 24 | 0 | 5 | 30 | 2 |
| K3 Customer data fix script | 300 | 9 | 1 | 200 | 3 |
Bands: K1 is 4, 3, 4, 3, 5 (time, errors, stability, effort, reach). K2 is 1, 1, 5, 4, 2. K3 is 4, 4, 1, 2, 2.
- K1: 0.35 x 4 + 0.20 x 3 + 0.15 x 4 + 0.20 x 3 + 0.10 x 5 = 1.40 + 0.60 + 0.60 + 0.60 + 0.50 = 3.70. Payback: saving 520 x 80 = USD 41,600 a year; upkeep 0.2 x 80 h x 80 = USD 1,280; net USD 40,320; build 80 x 80 = USD 6,400; payback 6,400 / (40,320 / 12) = 1.9 months. All gates pass. Automate now.
- K2: 0.35 + 0.20 + 0.75 + 0.80 + 0.20 = 2.30. Payback: saving 24 x 80 = USD 1,920; upkeep 0.2 x 30 x 80 = USD 480; net USD 1,440; build 30 x 80 = USD 2,400; payback 2,400 / (1,440 / 12) = 20 months, which fails the 12-month gate. Leave alone.
- K3: 1.40 + 0.80 + 0.15 + 0.40 + 0.20 = 2.95, so it would be deferred by score. Payback: saving 300 x 80 = USD 24,000; upkeep 0.2 x 200 x 80 = USD 3,200; net USD 20,800; build 200 x 80 = USD 16,000; payback 16,000 / (20,800 / 12) = 9.2 months, which passes. But stability is 1, which fails the stability gate. Defer: standardise the fixes first, then re-score. The attractive hours and error counts belong to a process that is still changing.
Common mistakes
- Ranking by hours saved alone, which ignores upkeep, risk and a process that is still moving.
- Rescaling scores against the current list so that adding a candidate changes the others.
- Counting payback and hours as separate weighted terms (double counting).
- Letting the score overrule a gate.
- Scoring from enthusiasm instead of measured counts, and never re-measuring after launch.
You forecast a 3x increase in traffic after a feature launch. Before provisioning full capacity, how would you design experiments and measurements to validate that assumption, and what would make you confident enough to decide whether additional capacity is actually needed?
Sample Answer
Framing
The ask here is explicitly upstream of load testing: before spending money provisioning for a 3x forecast, first find out whether the forecast itself is trustworthy, and whether the answer is even "add capacity" at all, the launch might shift traffic MIX rather than volume, or existing headroom might already cover it.
Validating the forecast itself
- Compare the forecast's methodology against a comparable past launch if one exists. If a similar past feature launch predicted 2x and actually delivered 1.3x, that's real evidence to widen or discount the current 3x forecast's confidence, not just trust the point estimate at face value.
- Break the 3x forecast into its components: is it 3x total requests, 3x users making the same per-user request volume, or the same users making 3x more requests each? Each has different infrastructure implications, for example 3x users usually scales roughly linearly across the system, but 3x per-user activity might concentrate load on one specific endpoint or database table rather than scaling everything uniformly.
- Run a smaller, controlled real-world test where possible: a percentage rollout or a beta cohort exposed to the new feature ahead of full launch, to get an actual measured multiplier from real traffic instead of relying purely on a forecast model.
Measurements to build confidence
Instrument the beta or percentage-rollout cohort's actual traffic multiplier and compare it against the 3x forecast in real time as rollout percentage increases. Separately, confirm CURRENT headroom, if the system already runs at 30% average utilization with room to 3x before hitting any known ceiling, the forecast may not require new provisioning at all, though that conclusion should be checked against PEAK utilization, not average, since peak is the number that actually matters for headroom.
Deciding whether additional capacity is actually needed
Set the decision threshold explicitly, ahead of time, for example: "if the beta cohort's measured multiplier plus a safety margin exceeds current peak headroom, provision ahead of full launch; if it's within headroom, monitor and scale reactively instead." This avoids two common failure modes: provisioning for every forecast regardless of whether current headroom already covers it (wasted cost), and always waiting for reactive autoscaling on a launch-day traffic profile whose ramp speed reactive autoscaling's own reaction time genuinely can't keep up with.
Recommended Additional Resources
- Designing Data-Intensive Applications by Martin Kleppmann
- Site Reliability Engineering by Google (O'Reilly)
- The Site Reliability Workbook by Google (O'Reilly)
- The Phoenix Project by Gene Kim
- LeetCode (practice medium-level coding problems)
- System Design Primer GitHub repository
- Grokking System Design Interview
- Airbnb Engineering & Data Science Blog
- AWS Well-Architected Framework
- Google Cloud Architecture Framework
- Kubernetes Official Documentation
- Terraform Best Practices
- Prometheus Monitoring Documentation
- Incident Response & Post-Mortem Culture resources
Search Results
Airbnb Software Engineer Interview Guide – Process, Questions ...
If you're preparing for the Airbnb software engineer interview, expect a mix of algorithm, system design, and code-quality questions that ...
34 Site Reliability Engineer Interview Questions (With Sample ...
Common questions include: "Why do you want to work for this company?", "What are your greatest strengths?", "How do you prioritize your work?", ...
Top 40 Airbnb Interview Questions
Describe one of the creative things you've done recently. · What is the scariest thing you've ever done? · What is your view on Airbnb China? · How ...
Site Reliability Engineering Interview Questions - MentorCruise
Examples include: "How do you deal with on-call emergency issues?", "Which programming languages are you most comfortable with?", and "What steps would you ...
Airbnb Interview Questions (Updated 2025) - Exponent
Review this list of 35 Airbnb interview questions and answers verified by hiring managers and candidates.
AirBnB SRE virtual on-site coding interviews | Tech Industry - Blind
The AirBnB virtual on-site for SRE has 2 coding rounds. For SWE, the typical problems are leetcode hards. Does anyone know if for SREs, ...
Airbnb Site Reliability Engineer Interview Questions - NodeFlair
Utilizing advanced AI, our tool generates tailored interview questions based on your industry, role, and experience. Practice and receive feedback on your ...
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