Meta Site Reliability Engineer (Senior Level) Interview Preparation Guide
While search results confirm Meta hires for SRE roles, detailed Meta-specific interview process documentation was not available in the search results. This guide is based on industry-standard SRE interview patterns for senior-level candidates and informed by general interview preparation resources. The structure, round types, and topics reflect what senior SREs typically encounter at top-tier technology companies.
Meta's SRE interview process for senior-level candidates follows a structured approach beginning with recruiter screening, progressing through a technical phone screen, and culminating in multiple onsite interview rounds. The interview evaluates coding proficiency, ability to design complex distributed systems, operational troubleshooting expertise, and cultural alignment with Meta's leadership principles. Senior SRE candidates are expected to demonstrate deep technical expertise in building and operating reliable systems at massive scale, proven ability to influence technical direction, mentorship experience, and strong incident response capabilities.
Interview Rounds
Recruiter Screening
What to Expect
Initial conversation with a Meta recruiter to discuss your background, career motivation, and alignment with the Senior SRE role. The recruiter will verify your understanding of SRE responsibilities, discuss compensation and equity expectations, confirm availability, and schedule subsequent technical interviews. This is also an opportunity to assess your communication skills and genuine interest in Meta's engineering challenges.
Tips & Advice
Prepare a concise 2-3 minute summary of your SRE career, highlighting scale of systems you've managed and key achievements. Research Meta's infrastructure and mention specific aspects that interest you. Be honest about your experience level and career goals. Ask meaningful questions about the team, projects, and growth opportunities. Show enthusiasm for solving reliability problems at massive scale. Have your calendar and availability ready for flexible scheduling.
Focus Topics
Motivation for Senior SRE Role
Articulate why you're attracted to SRE work specifically, what motivates you about building reliable systems, and why you're seeking a senior-level role at this point in your career. Connect your motivation to Meta's needs and culture.
Practice Interview
Study Questions
Meta-Specific Interest and Knowledge
Demonstrate research about Meta's infrastructure, engineering culture, and technical challenges. Reference Meta's public talks, engineering blogs, or known infrastructure at scale. Show specific interest in problems Meta solves rather than generic interest in 'big tech.'
Practice Interview
Study Questions
SRE Career Narrative
Develop a compelling narrative about your SRE journey. Highlight progression from junior responsibilities to senior-level work. Emphasize scale of systems managed, complexity of problems solved, and impact on reliability. For senior level, discuss how you've grown as a leader and mentor.
Practice Interview
Study Questions
Technical Phone Screen
What to Expect
Technical assessment conducted by a Meta engineer (typically an SRE or senior engineer) via video call. This round typically involves one or two coding problems to assess algorithmic thinking, problem-solving methodology, and code quality. Expect LeetCode-style medium to hard questions with emphasis on data structures and algorithms. You'll code in a shared collaborative editor while discussing your approach with the interviewer. The focus is on clear communication, systematic problem-solving, and writing clean, correct code.
Tips & Advice
Communicate your approach before writing code. Clarify problem requirements and constraints. Walk through your solution with examples. Discuss time and space complexity. For senior candidates, expect to optimize your initial solution and discuss scalability implications. Write production-quality code with proper variable naming and error handling. Test your code mentally. If stuck, think aloud and engage the interviewer in discussion. Demonstrate problem-solving process more than just arriving at the answer.
Focus Topics
Optimization and Scalability Thinking
After solving the basic problem, discuss optimizations and trade-offs. For senior candidates, automatically consider how solution scales and what improvements could make it more efficient. Discuss practical limits and how solution behaves under extreme conditions.
Practice Interview
Study Questions
Algorithms and Problem-Solving
Proficiency with common algorithms including sorting, searching, graph traversal (BFS, DFS), dynamic programming, and string manipulation. Ability to analyze problem structure, identify the right algorithmic approach, and implement clean solutions. Understanding of time and space complexity analysis.
Practice Interview
Study Questions
Data Structures
Deep understanding of arrays, linked lists, trees, graphs, hash tables, heaps, queues, and stacks. Know when each data structure is appropriate, their performance characteristics, and how to implement them. Understand variants like balanced trees and graphs.
Practice Interview
Study Questions
Code Quality and Communication
Write clean, readable code with meaningful variable names and proper structure. Communicate your thinking process throughout. Ask clarifying questions about requirements. Walk through examples to verify correctness. Handle edge cases explicitly. For senior candidates, discussion should include code maintainability and production considerations.
Practice Interview
Study Questions
Onsite Round 1: Coding and Algorithms
What to Expect
First onsite interview focused on advanced coding and algorithmic problem-solving. This round typically involves one or two complex coding problems, often with systems relevance (such as designing a rate limiter, cache, queue system, or handling concurrent access). You'll work on a laptop with access to any programming language and can compile/run code. The interview assesses algorithm design, code correctness, optimization thinking, and your ability to write robust, production-ready code with proper error handling and edge case consideration.
Tips & Advice
Start by asking clarifying questions about constraints and requirements. For systems-oriented problems, think about failure modes and edge cases from the start. Write code that handles errors gracefully. For senior candidates, demonstrate consideration of performance under load and how to test the code. Include logging and error handling as you would in production code. If problem involves concurrency or distributed aspects, discuss synchronization and race conditions. After getting a working solution, think about improvements and scalability.
Focus Topics
Code Testability and Verification
Write code that is testable. Discuss test strategy including unit tests and edge case coverage. Verify your implementation handles all important cases. For senior candidates, think about how code would be tested in production.
Practice Interview
Study Questions
Error Handling and Robustness
Write code that handles edge cases, invalid inputs, and error conditions gracefully. Include proper exception handling and validation. Think about failure modes and how your code behaves under adverse conditions. For senior level, implement defensive programming practices.
Practice Interview
Study Questions
Concurrency and Synchronization
Understanding of concurrent programming, race conditions, mutual exclusion, deadlocks, and synchronization primitives. Ability to write thread-safe code. Understanding of how to handle concurrent access to shared resources. For senior candidates, deep understanding of memory models and synchronization semantics.
Practice Interview
Study Questions
Systems-Oriented Coding Problems
Solve complex coding problems with systems relevance such as rate limiting, caching with eviction policies, distributed queuing, concurrent access patterns, stream processing, or connection pooling. These problems are more realistic than pure algorithms and directly relevant to SRE automation work.
Practice Interview
Study Questions
Onsite Round 2: System Design - Monitoring and Observability
What to Expect
This system design round focuses on designing core SRE infrastructure systems, specifically monitoring, observability, and alerting. You might be asked to design a metrics collection and alerting system, a log aggregation and search system, a distributed tracing system, or an anomaly detection system. The interviewer assesses your ability to architect systems for reliability, think about operational concerns, understand trade-offs, and design solutions that are actually operational at scale. Emphasize SLO/SLI concepts, preventing alert fatigue, and ensuring observability doesn't become a bottleneck.
Tips & Advice
Start by understanding requirements and constraints. Ask about scale, retention requirements, query patterns, and accuracy requirements. Draw clear architecture diagrams showing data flow and major components. Discuss trade-offs explicitly (e.g., accuracy vs. cost, completeness vs. latency). For senior candidates, demonstrate deep understanding of observability philosophy, SLI selection, SLO definition, and error budget implications. Discuss how to prevent alert fatigue while maintaining coverage. Think about operational challenges like scaling, maintenance, and troubleshooting the monitoring system itself.
Focus Topics
Distributed Systems Tracing and Debugging
Design system to trace requests through distributed systems. Understand distributed tracing architecture, span collection, storage, and visualization. Discuss how to debug latency and failures using trace data. Balance trace volume with cost.
Practice Interview
Study Questions
Alerting and Anomaly Detection
Design alerting system that detects significant problems while minimizing false positives. Understand threshold-based alerting, statistical anomaly detection, and complex rule evaluation. Discuss how to prevent alert fatigue and ensure high-priority alerts are noticed. Implement feedback mechanisms to tune alert quality.
Practice Interview
Study Questions
Metrics Collection and Time-Series Storage
Design system to collect, store, and query metrics at massive scale. Understand time-series database design, compression techniques, retention policies, and query patterns. Discuss different aggregation levels and retention strategies. Consider how to handle high-cardinality metrics and avoid storage explosion.
Practice Interview
Study Questions
SLI, SLO, and Error Budget Design
Understanding of Service Level Indicators (what to measure), Service Level Objectives (targets), and error budgets (how much unreliability is acceptable). Design monitoring that connects to SLOs. Discuss how error budgets guide decisions. Implement SLO tracking and budgeting.
Practice Interview
Study Questions
Onsite Round 3: System Design - Infrastructure and Deployment
What to Expect
Second system design round focused on designing complex infrastructure systems. You might design a deployment and release management system, service discovery system, configuration management system, load balancing infrastructure, or handling resilience at scale. Assess ability to design for reliability through architectural patterns, handling failure scenarios, gradual rollout strategies, and operational safety. For senior SREs, expect deep probing into operational implications, testing strategies, and how to validate system behavior.
Tips & Advice
Start with clear requirements and assumptions. Draw architecture with all components. Discuss data flow and failure scenarios explicitly. For senior candidates, dig deep into operational concerns: how would you debug issues? How do you test this system? What could go wrong? Design for observability and debuggability. Discuss trade-offs between speed and safety. Think about capacity planning and scaling. Be prepared to go deep into specific technical areas based on interviewer questions.
Focus Topics
Operational Validation and Testing Infrastructure
Design systems and processes to validate system behavior safely. Understand chaos engineering, load testing, failure injection, and staged rollout validation. Discuss how to test disaster recovery and failure scenarios without impacting production.
Practice Interview
Study Questions
Safe Deployment and Release Strategies
Design system for deploying software to production safely. Understand canary deployments, blue-green deployments, feature flags, gradual rollout strategies, and rapid rollback mechanisms. Design for minimizing blast radius of bad deployments. Discuss how to detect issues early during rollout.
Practice Interview
Study Questions
Service Discovery and Configuration Management
Design system for service discovery at scale. Understand consistency models, failure handling, and client-side caching. Design configuration management that handles updates across thousands of services without downtime. Discuss consistency guarantees and eventual consistency implications.
Practice Interview
Study Questions
Resilience Patterns and Graceful Degradation
Design systems that degrade gracefully under failure. Understand circuit breakers, bulkheads, fallback strategies, and cascading failure prevention. Design for operating in degraded mode and recovering when dependencies heal. Discuss trade-offs between availability and consistency.
Practice Interview
Study Questions
Onsite Round 4: Operational Troubleshooting
What to Expect
This round assesses ability to troubleshoot complex production issues systematically. You'll be presented with hypothetical production problems or scenarios where systems behave unexpectedly. Use systematic methodology to diagnose root cause by asking questions, gathering data, forming hypotheses, and testing them. Scenarios might involve performance degradation, connectivity issues, data inconsistencies, or cascading failures. Interviewers assess troubleshooting approach, depth of systems knowledge, ability to handle ambiguity, and communication clarity.
Tips & Advice
Use structured troubleshooting: clearly define the problem, establish baseline and what changed, gather data, form hypotheses, test them. Ask about symptoms, timeline, scope, and affected components. Draw diagrams of system components. Use knowledge of Linux, networking, databases, and infrastructure to narrow possibilities. For senior candidates, demonstrate sophisticated systems thinking across multiple layers. Consider infrastructure, OS, application, and dependencies. Communicate findings clearly. Discuss how you'd escalate and involve other teams.
Focus Topics
Database and Storage Troubleshooting
Common database issues: slow queries, connection pool exhaustion, lock contention, replication lag, data consistency problems. Ability to investigate query performance, check replication status, understand transaction behavior, and diagnose data issues. Knowledge of database-specific tools and metrics.
Practice Interview
Study Questions
Networking Concepts and Troubleshooting
Understanding of OSI model, TCP/IP, DNS, routing, network interfaces, and packet flow. Ability to diagnose connectivity problems, DNS issues, port conflicts, packet loss, latency, and network-level failures. Knowledge of firewalls, NATs, load balancers, and their impact. Use tools like ping, traceroute, netstat, ss, tcpdump, and dig.
Practice Interview
Study Questions
Linux Systems and Performance Analysis
Deep understanding of Linux including process management, memory management, CPU scheduling, I/O subsystems, and kernel networking. Proficiency with tools: ps, top, htop, iostat, vmstat, netstat, ss, strace, ltrace, and perf. Understand performance metrics and how to identify bottlenecks. Knowledge of kernel parameters and tuning.
Practice Interview
Study Questions
Incident Diagnosis and Root Cause Methodology
Systematic approach to diagnosing incidents. Understand difference between symptom and root cause. Process for gathering data, forming hypotheses, and testing them. Understanding common categories of production issues: resource exhaustion, configuration errors, dependency failures, concurrency issues, and cascading failures.
Practice Interview
Study Questions
Onsite Round 5: Behavioral and Leadership
What to Expect
Final onsite round assesses cultural fit with Meta and leadership capabilities at senior level. Interviewers explore your work history, decision-making approach, conflict resolution, collaboration style, and alignment with Meta's leadership principles including Move Fast, Be Direct, and Focus on Impact. For senior SRE candidates, expect questions about how you've influenced technical direction, mentored team members, driven reliability initiatives, and balanced competing priorities. Interviewers assess strategic thinking about systems reliability, ability to lead across boundaries, and communication effectiveness.
Tips & Advice
Prepare 5-7 concrete examples using STAR format (Situation, Task, Action, Result) that demonstrate impact at scale. For senior level, focus on examples showing leadership influence, mentorship, or driving significant reliability improvements. Discuss failures honestly and what you learned. Understand Meta's leadership principles and align your examples. Be genuine, direct, and specific. For SRE context, prepare examples of incidents handled well, building reliability culture, balancing reliability with velocity, and mentoring junior SREs. Be ready to discuss your approach to difficult conversations and how you handle disagreement about reliability vs. speed trade-offs.
Focus Topics
Cross-Functional Collaboration and Stakeholder Management
Working effectively with developers, product managers, and infrastructure teams. Examples of resolving conflicts between reliability and velocity goals. How you've communicated technical concerns to non-technical stakeholders. Experience influencing prioritization across organizational boundaries.
Practice Interview
Study Questions
Technical Leadership and Influence
Examples of influencing technical decisions without direct authority. Leading reliability initiatives or architectural improvements. Experience driving adoption of new tools, practices, or approaches. How you've influenced teams to prioritize reliability. Examples of mentoring junior SREs or engineers.
Practice Interview
Study Questions
SLO and Error Budget Thinking
Deep understanding of SLOs, SLIs, SLAs, and error budgets. Ability to explain how error budgets guide trade-off decisions between reliability and feature development. Examples of how you've communicated trade-offs between innovation and stability. Experience using error budgets to influence prioritization decisions.
Practice Interview
Study Questions
Incident Response and Blameless Culture
How you've handled production incidents under pressure. Your approach to postmortems and psychological safety. Examples of building blameless incident culture. Systemic improvements implemented based on incidents. How you balance rapid response with thorough investigation and learning.
Practice Interview
Study Questions
Frequently Asked Site Reliability Engineer (SRE) Interview Questions
How do you explain a genuinely technical trade-off, for example speed versus reliability, or model accuracy versus explainability, to an executive who has no technical background and wants a straight answer? Walk through how you'd structure that conversation.
Sample Answer
Direct answer
Lead with the business decision the trade-off actually affects, not the technical mechanism behind it. State the choice in one sentence, give the two or three real options with their concrete business consequences, then recommend a path, usually a staged one that limits downside while you gather more evidence, rather than dumping the full technical reasoning and hoping the executive assembles the conclusion themselves.
Structured elaboration
- Open with the decision, not the technology. "We can ship in two weeks with a small but real chance of a data quality issue reaching customers, or four weeks with that risk substantially reduced" is a sentence an executive can act on. "Our model's precision-recall trade-off means we need to decide on a threshold" is not, even though it is the same underlying trade-off.
- Translate the technical axis into the business axis the executive already tracks: latency into conversion or churn, model accuracy into false-positive cost or customer trust, reliability into revenue at risk during an outage. If you cannot state the technical trade-off in terms of a metric the executive already reports on, you have not finished translating it yet.
- Give real, bounded options, not a spectrum. Two or three named paths, each with its concrete cost, benefit, and risk, is decidable. An open-ended discussion of the trade-off space is not, and it reads as the engineer being unable to make a call.
- Recommend a staged or reversible path when the uncertainty is genuinely high. A pilot on a subset of traffic, or an explicit accept-the-risk-with-a-monitoring-trigger plan, lets the executive make a real decision now instead of being asked to bet on incomplete information.
- Set the expectation for what happens next: what you will report back, on what cadence, and what would change the recommendation. Executives who feel informed rather than presented-to are far more likely to back a staged decision through its follow-through.
This same translation exercise applies across a wide range of audiences and trade-offs: presenting a failed-model-deployment retrospective to non-technical stakeholders, a CFO weighing accuracy against explainability for a regulated lending product, presenting a complex ML model in five sections for non-technical executives, a board member focused on revenue asking about speed versus reliability, a technical trade-off explained to product, marketing, or operations stakeholders, presenting probabilistic forecasts and confidence intervals to a non-technical audience, a decision-making dashboard visualizing speed, reliability, and cost trade-offs for executive leadership, translating statistical results into a five-minute executive briefing, translating a technical proposal, like an ETL job or a metric-definition change, into business value, a fifteen-minute non-technical roadmap overview, a stakeholder who wants an immediate answer despite real uncertainty, a product manager pushing for a faster refresh cycle at the cost of accuracy, securing buy-in from finance, legal, sales, or executive stakeholders for a technical decision, a VP demanding real-time dashboards the current infrastructure genuinely cannot support, a controversial technical decision that requires convincing both engineering and business stakeholders, a non-technical product manager who needs "data contract" explained in terms of what breaks downstream if it's violated rather than in terms of schemas, and persuading executives to accept a temporarily increased error budget during a major migration. The audience and the specific trade-off change; the discipline of stating the decision, translating the axis, and bounding the options does not.
Worked example
A platform team needed sign-off from a non-technical VP on whether to ship a new recommendation model with a two-week delay to add a fairness and bias check, or ship on the original date without it. The temptation was to explain the bias-detection methodology; instead, the conversation opened with: "We can ship on schedule with a small but real chance of the model treating one customer segment unfairly, which is the kind of issue that shows up in a support-escalation spike after launch, or we can ship two weeks later with that risk substantially reduced. Which matters more to you right now, the launch date or that risk?"
The VP asked what "substantially reduced" meant in practice, which was the right question. I gave a bounded answer: the check would catch the two known failure patterns we had already seen in a smaller pilot, at the cost of two weeks, and would not catch every possible fairness issue, since no check does. That honesty about the limits of the fix, stated plainly rather than hedged, is what let the VP make a real trade-off decision (they chose the two-week delay) instead of assuming the delay bought a guarantee it didn't.
The number that mattered in that conversation was simple and stated up front rather than buried: two weeks of delay against a support-escalation risk the team had already observed at least twice in the pilot, not an invented probability or severity score dressed up as more precise than it was.
Trade-offs and pitfalls
- Over-simplifying to the point of hiding a real risk erodes trust faster than a complicated explanation does; the goal is translation, not omission.
- Presenting a false binary (ship now versus never ship) when a staged or reversible option exists wastes the executive's actual decision-making power; always check whether a middle path is available before framing it as all-or-nothing.
- Leading with caveats and confidence intervals before stating the decision loses a non-technical audience in the first thirty seconds; state the recommendation first, then the uncertainty behind it.
- Treating this as a one-time pitch instead of a standing translation habit means every future trade-off has to be re-explained from scratch; the executives who trust you fastest are the ones you have given a track record of honest, bounded framing to before.
What is alert fatigue, and how would you go about preventing it on a team you're leading?
Sample Answer
Direct answer
Alert fatigue is what happens when on-call engineers get so many low-value, noisy, or duplicate pages that they start treating all alerts as probably-not-real, including the ones that matter. It's a trust problem as much as a technical one: once someone has been paged repeatedly in a night for something that turned out to be nothing, the next page, which might be the real incident, gets a slower, more skeptical response.
How I'd prevent it on a team I'm leading
- Deduplication and grouping: alerts that share a root cause (same service, same error type) should collapse into a single incident with a count, not fire a separate page per occurrence. This is usually a config change in the alerting tool (fingerprinting by service and error signature) rather than a code change.
- Severity tuning tied to required response time: not every alert deserves a page. A three-tier split (page now, notify during business hours, dashboard-only) forces every new alert to justify why it needs to interrupt someone's sleep.
- Actionable-by-default policy: no new paging alert ships without a linked runbook and a clear "what to check first." An alert with no next step is a dashboard panel that accidentally has a pager attached.
- Automated remediation for known, safe, repeatable fixes: if the same alert reliably resolves by restarting a stuck worker or clearing a queue, and that action is safe and idempotent, automate it and only page if the automated fix fails.
- A regular noise review: periodically look at which alerts fired most often and whether they led to real action; alerts that never lead to action get tuned or removed, not left running indefinitely out of habit.
Worked example
Suppose a team's on-call rotation is getting paged for "queue depth over 100" on a background job processor, firing several times a week, always self-resolving within a few minutes without anyone doing anything. Applying the framework above: first, check whether these spikes line up with a predictable traffic pattern (a nightly batch job, say) and if so, either raise the threshold above that expected peak or add a time-of-day exception. Second, if the queue really can back up unpredictably but always self-resolves within a known window without intervention, the alert should require a longer sustain window (e.g. "queue depth over 100 for 15 minutes") so it only fires when it isn't going to resolve on its own. Third, if manual intervention when it does page is always the same action (scale up worker count), that's a strong automated-remediation candidate: auto-scale on the same threshold, and only page if depth is still elevated after the auto-scale has had time to take effect.
Trade-offs and pitfalls
- Automated remediation without an audit trail or human confirmation for higher-severity cases can turn a noisy-alert problem into a silent-failure problem: the system "fixes" itself repeatedly while masking a root cause that's getting worse.
- Tuning thresholds purely to reduce page volume, without checking against real past incidents, risks quietly increasing false negatives; the goal is signal-to-noise, not just fewer pages.
- Alert fatigue prevention is not a one-time project. It needs an ongoing review cadence, because new alerts get added faster than old noisy ones get cleaned up if nobody owns the process.
What is starvation? Describe a situation in a service where one class of work never gets to run, and explain how you would mitigate it.
Sample Answer
Starvation means a task or class of work is ready to run but is never granted the resource it needs, because other work keeps getting it first. The system is busy and not deadlocked (nobody is waiting in a cycle), yet one party makes no progress. In a livelock everyone is busy and none progresses; in starvation most work progresses and a victim does not.
A concrete service scenario
A backend worker pulls jobs from two queues: interactive API requests (high priority) and batch report exports (low priority). The rule is "always take interactive first". On a quiet day batch jobs drain in the gaps. During a busy hour interactive requests arrive as fast as the worker can serve them, the interactive queue is never empty, and the batch queue only grows. Exports time out at the client, support tickets arrive, yet CPU is high and the throughput graph looks healthy. The same shape appears with a reader-preferring reader-writer lock (readers keep entering, a writer waits forever), an unfair mutex, and a thread pool where a long job class holds every thread.
A small model
One worker, 10 ms per job, interactive arrivals every 10 ms (the worker's whole capacity), batch arrivals every 100 ms, simulated for 10 s of virtual time. The simulation is deterministic, so its output is the same on every run:
from collections import deque
def simulate(reserve=0, cap=None):
"""One worker, one job per 10 ms slot, 1000 slots (10 s).
Interactive job arrives every 10 ms, batch job every 100 ms.
reserve=N: every Nth slot goes to batch if a batch job is waiting.
cap=C: refuse an interactive arrival when C interactive jobs already wait."""
hi, lo = deque(), deque()
hi_served = lo_served = shed = 0
max_lo_wait = None
for slot in range(1000):
t = slot * 10
if cap is not None and len(hi) >= cap:
shed += 1
else:
hi.append(t)
if t % 100 == 0:
lo.append(t)
if reserve and slot % reserve == reserve - 1 and lo:
wait = t - lo.popleft()
lo_served += 1
max_lo_wait = wait if max_lo_wait is None else max(max_lo_wait, wait)
elif hi:
hi.popleft()
hi_served += 1
elif lo:
wait = t - lo.popleft()
lo_served += 1
max_lo_wait = wait if max_lo_wait is None else max(max_lo_wait, wait)
return hi_served, lo_served, shed, len(hi), len(lo), max_lo_wait
rows = [("strict priority", simulate()),
("1 slot in 5 reserved", simulate(reserve=5)),
("reserved + queue cap 50", simulate(reserve=5, cap=50))]
print(f"{'policy':26}{'hi served':>10}{'lo served':>10}{'shed':>6}{'hi queued':>10}{'lo queued':>10}{'max lo wait ms':>16}")
for name, (h, l, s, hq, lq, w) in rows:
print(f"{name:26}{h:>10}{l:>10}{s:>6}{hq:>10}{lq:>10}{str(w):>16}")
Run in a python:3.12-slim container it prints:
Column key: hi served and lo served are the interactive and batch jobs finished in the 10 s; shed is jobs refused outright; hi queued and lo queued are jobs still waiting at the end; max lo wait ms is the longest a batch job waited before a worker took it (None means no batch job was ever served, so there is no wait to measure).
policy hi served lo served shed hi queued lo queued max lo wait ms
strict priority 1000 0 0 0 100 None
1 slot in 5 reserved 900 100 0 100 0 40
reserved + queue cap 50 900 100 51 49 0 40
Strict priority served all 1000 interactive jobs and none of the 100 batch jobs. Reserving one dispatch in five for batch served every batch job (waiting at most 40 ms), at the price of 100 interactive jobs left queued: the interactive class alone needed 100% of capacity, so giving batch any slots must push a backlog somewhere. The reserve is a guarantee of up to 20% of slots, not a quota that is always spent: only 100 batch jobs arrived against 1,000 dispatch slots (10 s at 10 ms each), so batch used 10% of them and interactive got the other 900. The 100 interactive jobs left queued are exactly the 100 slots batch consumed. Capping the interactive queue at 50 turns that backlog into explicit shedding (51 jobs refused) instead of unbounded latency. The model is idealised (fixed job size, one worker), so read the pattern, not the exact counts.
How I would mitigate, in order
- Detect it with the right metric. Throughput and CPU look fine. Alert on age of the oldest item per class and per-class completion rate; starvation is invisible in an average.
- Guarantee a floor. Reserve a share (a slot in N, a separate small pool, or a minimum weight in a weighted fair queue, which hands each class a share of dispatches in proportion to its weight) for each class. This is the fix I would ship first, because it bounds a victim's wait regardless of load.
- Age priorities. For many classes, raise a job's effective priority the longer it waits, so any job eventually outranks new arrivals.
- Bound the dominant class. Cap its queue or concurrency and shed or defer its excess (as in the third row), so that high priority cannot consume 100% of a shared worker.
- Use fair primitives. Choose a fair lock (one that hands the lock to waiters in arrival order, a FIFO hand-off lock) or a writer-preferring or fair reader-writer lock where writers must not wait indefinitely, and know its throughput cost. A reader-preferring reader-writer lock, by contrast, lets new readers in while a writer waits, which is the starvation case described earlier.
- Fix capacity. Starvation under saturation is a capacity signal. Priorities choose who suffers; they do not create capacity.
I would recommend 2 plus 4 plus the age metric: a floor protects the low class, the cap protects the system, and the metric tells you when the real fix is more workers.
Describe a practical exception-handling strategy for a service you own: when to catch an exception locally versus let it propagate to a caller, when to create and use a custom exception type versus a generic one, and how to avoid common pitfalls like swallowing exceptions or duplicating log lines at every layer. Walk through one example for a service-to-service call and one for a database operation.
Sample Answer
Direct answer
Catch an exception locally only when you can actually do something useful with it there (retry, fall back, translate it into a domain-specific error); otherwise let it propagate. Create a custom exception type when the caller needs to distinguish this failure from others programmatically; reuse a generic one when nobody downstream will branch on it.
Structured elaboration
- The 'can I do something' test: at each layer, ask whether you have enough context AND enough authority to resolve the failure. A repository layer that hits a broken connection can retry once; it usually can't decide whether the caller should show an error page or silently use cached data, so it should propagate (possibly wrapped) rather than swallow.
- Custom vs generic exceptions: define a custom type when a caller three layers up needs to branch (
except PaymentDeclinedError: offer another cardvsexcept PaymentGatewayTimeout: retry). A genericRuntimeErroror bareExceptionis fine for truly unexpected states nobody is meant to handle specially, but never use a bareexcept Exception:as a catch-all that discards the distinction. - Avoiding pitfalls: never catch-and-discard (
except Exception: pass) without at minimum logging with full context; never catch a broad type just to re-raise the same thing unchanged (that's dead code that hides which specific failures the layer actually expects); when you DO catch to translate, preserve the original exception as the cause (raise DatabaseError(...) from ein Python, wrapping in Java) so a debugger can still walk to the root cause. Also avoid duplicating log lines at every layer: if every layer that catches-and-rethrows also logs the same exception on its way up, one real failure produces several near-identical log entries by the time it reaches the top, which pages on-call with noisy duplicates and makes the true error rate impossible to read off log volume. The fix is to log ONCE, at the layer that either fully handles the error or is the outermost boundary (the request handler, the job runner), and let every intermediate layer that only wraps-and-rethrows do so silently, relying on the exception chain (from e) rather than a fresh log line to preserve context.
Worked example
Service-to-service call: a UserService.get_profile(id) calls an HTTP client that can raise ConnectionError or HTTPStatusError. UserService catches both, and translates HTTPStatusError with status 404 into its own UserNotFoundError (a real domain concept the caller branches on), but lets a 500 or ConnectionError propagate wrapped as UserServiceUnavailableError from e (preserving the cause) since it has no way to fix an unreachable dependency itself; it does NOT log at this layer, since it's not the final decision point.
Database operation: a repository's save(record) catches a unique-constraint violation and translates it to DuplicateRecordError (a business-meaningful case the caller likely wants to show the user), but lets a connection-pool-exhausted error propagate unmodified up to the request-handling layer, which is the only layer with enough context to decide 'shed load' vs 'retry', and is also the only layer that logs it.
Trade-offs and pitfalls
Over-translating (wrapping every low-level exception in a new custom type at every layer) produces an exception-type explosion that is as hard to reason about as no typing at all, and it can silently lose the original stack trace if you forget to chain the cause. Under-translating (letting raw library exceptions like ConnectionError leak all the way to a UI layer) forces every caller to know implementation details of a dependency two layers down. The right amount of translation happens at trust/ownership boundaries (crossing into a new bounded context, crossing a network call, crossing into user-facing code), not at every function call, and the same discipline applies to logging: log at the boundary that owns the decision, not reflexively at every catch block.
An application started throwing intermittent 'duplicate key value violates unique constraint' errors after a migration. Outline how you'd determine whether this is due to an application-level race condition, a migration script bug, or genuinely inconsistent data. Include SQL queries to locate the duplicates, checks you'd run on the migration script, and steps to mitigate impact in production while you investigate.
Sample Answer
Direct answer
The database's own error text, "duplicate key value violates unique constraint," looks identical whether the cause is a genuine two-writer race, a re-run migration script, or real pre-existing duplicate data, because the constraint's whole job is to make all three collisions look the same at the SQL layer. Distinguishing them means bringing in evidence the database itself doesn't retain: an independent request log correlated against the failing key, a direct query against the source data for pre-existing duplicates, and a read of the migration script for idempotency. Mitigate the live impact by treating the race case as an expected, catchable outcome rather than an error, without touching the constraint itself.
Structured elaboration
Race condition check
Correlate an application-level log of every write attempt (not just successful writes) against the failing key. That log must be committed in its own transaction, separate from the risky write attempt; logging it inside the same transaction as the write means a failed write rolls the log entry back too, destroying the exact evidence the investigation needs. If two different client or session identifiers attempted the same key within a tight window (milliseconds to low tens of milliseconds), that's the race signature. One client retrying after a long gap and hitting an already-committed row is a normal, correct idempotent retry, not a bug, and should be treated as success by the caller.
Migration script bug check
Read the migration for whether reruns are idempotent (INSERT ... ON CONFLICT DO NOTHING or MERGE, versus a plain INSERT that fails loudly, or worse silently double-inserts, on a partial rerun after a timeout), whether it deduplicates the source data before inserting rather than assuming it's already unique, and whether its own execution log shows any sign it ran twice (two rows in a migration ledger, or overlapping time ranges in its own job log).
Genuinely inconsistent data check
Query the source (legacy or pre-migration) table directly for existing duplicates on the column the new constraint enforces: SELECT key_col, count(*) FROM legacy GROUP BY key_col HAVING count(*) > 1. If duplicates already existed upstream, the constraint is correctly surfacing a pre-existing data-quality problem the old system silently tolerated, not a migration bug or a race.
Immediate mitigation while investigating
For the race case specifically, catch the unique-violation and treat it as expected: re-select the row that already exists, and if its content matches what you intended to write, return success rather than an error to the caller. This is the standard idempotent-upsert pattern (INSERT ... ON CONFLICT (key) DO NOTHING followed by a SELECT, or DO UPDATE if a merge is genuinely safe). It doesn't fix the underlying cause, but it stops user-visible errors for the likely-majority-benign race case while the migration-bug and bad-data hypotheses, which need a human decision, get investigated.
Worked example
Real output from Postgres 16. First, the genuinely-inconsistent-data check against a legacy table that already has a duplicate before any migration touches it:
SELECT idempotency_key, count(*) AS dup_count, max(created_at) - min(created_at) AS time_spread
FROM legacy_payments
GROUP BY idempotency_key
HAVING count(*) > 1;
idempotency_key | dup_count | time_spread
------------------+-----------+-------------
idem-7001 | 2 | 00:00:04
Then, a real unique constraint and two genuinely concurrent sessions racing to insert the same new key:
CREATE TABLE payments (
id bigserial PRIMARY KEY,
idempotency_key text NOT NULL,
amount numeric NOT NULL,
CONSTRAINT payments_idempotency_key_uq UNIQUE (idempotency_key)
);
Session A and session B, started 20 milliseconds apart, both attempt INSERT INTO payments (idempotency_key, amount) VALUES ('idem-9002', 25.00);. Session B wins; session A gets:
ERROR: duplicate key value violates unique constraint "payments_idempotency_key_uq"
DETAIL: Key (idempotency_key)=(idem-9002) already exists.
The exact same error text as the pre-existing-duplicate case above; nothing in it says which cause produced it. The request-log correlation query, run against attempts logged in their own committed transactions before each insert was tried, is what actually distinguishes them:
SELECT idempotency_key, count(*) AS attempts, count(DISTINCT client_request_id) AS distinct_clients,
max(received_at) - min(received_at) AS spread
FROM request_log GROUP BY idempotency_key HAVING count(*) > 1 ORDER BY spread;
idempotency_key | attempts | distinct_clients | spread
------------------+----------+-------------------+-----------------
idem-9002 | 2 | 2 | 00:00:00.022678
Two distinct clients, 22.6 milliseconds apart: the race signature, versus the legacy duplicate's 4-second spread above, which is far too slow to be a race and instead reflects a real pre-existing double-submit the old system accepted. The order-of-magnitude difference in spread is itself diagnostic.
While building this, logging the request attempt inside the same transaction as the risky insert made the log entry for the losing session vanish entirely when that transaction rolled back on the constraint violation, taking the very evidence needed for this investigation with it. That's exactly the pitfall stated above, discovered by hitting it directly: log attempts in their own committed transaction, always, before the risky write is attempted.
Trade-offs and pitfalls
- Don't disable or drop the constraint to stop the errors; that removes the only thing currently preventing real duplicate business records, even while it's noisy.
- The idempotent-catch mitigation is for the race case only. Applying it blindly to the inconsistent-data case would silently paper over real duplicate business records that need a human decision about which of the conflicting rows is actually correct.
- The transaction-boundary mistake above (logging inside the same transaction as the write it's meant to explain) is easy to make and destroys exactly the evidence a race-versus-bug investigation depends on.
Design a global multi-region service discovery and configuration system for an application deployed across 5 regions serving 1M RPS. Requirements: region-local discovery for low latency, automatic regional failover, versioned global config propagation with audit history, and ability to perform region-scoped rollbacks. Discuss DNS TTLs, geo-DNS, control plane replication, and trade-offs between strong and eventual consistency.
Sample Answer
Direct answer
Split it into two systems with opposite consistency needs. Service discovery is region-local and eventually consistent: each of the 5 regions runs its own registry, clients discover only same-region endpoints, and no request ever waits on another region. Configuration has one global, strongly consistent write path that assigns every change a version and an audit record, then replicates asynchronously to a read-only config store in each region; each region points at a version, so a rollback moves one region's pointer back without touching the others. Users reach a region through geo-DNS with a short TTL (time-to-live) plus health checks, and every region is provisioned to absorb a failed neighbour's share.
Requirements and numbers I am designing to
- 1M requests per second (RPS) globally over 5 regions: about 200,000 RPS per region in steady state.
- Regional failover: if one region dies, its traffic spreads over the other 4, so each must handle 1,000,000 / 4 = 250,000 RPS. Each region is therefore provisioned at 25% above its normal load (250,000 / 200,000 = 1.25).
- Assume about 4,000 service instances per region (an illustrative sizing, not a measurement). Discovery load is driven by instance churn and watches, not by the 1M RPS: clients cache endpoint lists, so a request never calls the registry.
- Config writes are rare (tens per hour); config reads happen at process start and on every change, never per request.
Terms used below
- Registry: the database of "which healthy instances serve service X", e.g. Consul or the Kubernetes API server.
- Raft: a consensus protocol; a small cluster (3 or 5 nodes) elects a leader and commits a write only when a majority (the quorum) has stored it. It gives linearizable writes: once a write is acknowledged, every later read sees it.
- Strong vs eventual consistency: strong means every reader sees the latest committed value; eventual means readers may lag briefly but converge.
- Geo-DNS: an authoritative DNS service that answers the same name with different addresses depending on where the client is, and stops returning a region that fails health checks.
Architecture
flowchart TB
U[Users] --> G[Geo-DNS with health checks]
G --> R1[Region A edge LB]
G --> R2[Region B edge LB]
subgraph CP[Global config control plane]
W[Config API, Git review] --> S[(Raft store: versions and audit log)]
end
S -->|async replication| C1[(Region A config cache)]
S -->|async replication| C2[(Region B config cache)]
R1 --> A1[Services in A]
A1 --> D1[(Region A registry)]
A1 --> C1
R2 --> B1[Services in B]
B1 --> D2[(Region B registry)]
B1 --> C2
Two regions are drawn for readability; the other three are identical. Each region's edge LB (edge load balancer: the boundary layer that terminates incoming user connections and forwards them to services inside that region) sits behind geo-DNS and in front of the region's own services.
1. Region-local discovery
- Each region runs its own registry cluster (a 5-node Raft cluster across that region's availability zones, meaning physically separate data centers within the region, each with independent power and networking, so the cluster survives one of them failing, or the Kubernetes control plane per cluster). There is no global registry: a cross-region consensus round trip (tens to over a hundred milliseconds of network delay per commit) has no place in the discovery path, and a trans-oceanic partition must not break discovery inside a region.
- Health does not go through Raft. If 4,000 instances each wrote a heartbeat through consensus every 10 seconds, that is 4,000 / 10 = 400 consensus writes per second per region for nothing but liveness. Instead, a local agent or the kubelet (the per-node Kubernetes agent that already runs on every node and reports pod health) probes each instance and only state changes (healthy to unhealthy) become registry writes.
- Clients or sidecar proxies (a proxy process deployed next to each service instance, as in a service mesh) hold a watch on the registry and keep an in-memory endpoint list, so discovery reads cost nothing per request and survive a registry outage using the last known list.
- Endpoint entries carry version tags (
orders v42), so a rolling upgrade can route by version, keep old and new side by side, and drain old instances cleanly.
2. Automatic regional failover
- User to region: geo-DNS answers with the nearest healthy region. Health checks probe a deep endpoint in each region (one that exercises the region's real dependencies) every 10 seconds and fail it after 3 misses. DNS TTL is 30 seconds, so worst-case steering time is about 30 s detection + 30 s TTL = 60 s, plus clients that hold connections open (cap connection lifetime so they re-resolve). An anycast global load balancer (one IP address announced from every region at once, so network routing itself, not DNS or client caching, sends each user to the nearest healthy region and can redirect within seconds of a region failing) can replace geo-DNS and fail over in seconds without depending on client DNS caches; I would use one where available and keep geo-DNS as the fallback.
- Service to service: stays in-region. If a single service is down in region A but the region is otherwise up, the local proxy can fail over to that service in the nearest region, but only when the registry's failover policy allows it, because it adds cross-region latency and egress cost (what cloud providers charge for data leaving a region) and can overload the neighbour.
- Capacity: the 25% headroom above is non-negotiable; without it a regional failover becomes a multi-region outage as the surviving regions overload one after another.
3. Versioned global config with audit history
- Config lives in a single global control-plane store: a 5-node Raft cluster with one node per region. Writes need 3 of 5 regions, so a write commits even with 2 regions unreachable, and each commit costs one cross-region round trip (the leader sends the write to the other 4 regions in parallel and only has to wait for the fastest 2 replies, since itself plus those 2 is already a majority of 3; because the sends and replies happen in parallel, it is one round trip, not four sequential ones), acceptable for tens of writes per hour.
- Every write is: reviewed change in Git, then applied through the config API as
(key, value, version, author, change_id, reason)with a monotonically increasing version, appended to an append-only audit log in the same transaction. Nothing edits config directly in a region. - Each region runs a read-only config replica fed by an asynchronous stream from the control plane. Services read only from their region's replica (via a local agent that watches it and writes a file or pushes to the process). If the control plane is unreachable, regions keep serving last known good config: config staleness is acceptable, config unavailability is not.
- Replicas publish their applied version; an alert fires if any region's version lags the global head by more than a few minutes.
4. Region-scoped rollouts and rollbacks
- The control plane stores immutable versions plus, per region, a pointer:
region-a -> v118,region-b -> v117. A rollout advances pointers region by region with a bake time between (a deliberate pause after each region's change, watching its metrics before touching the next one), starting with the lowest-traffic region. - Rollback of region B is a single write:
region-b -> v117. The versions themselves never change, so the rollback is exact, audited like any other change, and does not affect regions A, C, D, E. - Every config read reports the version it served, so "which version is region B running" is answered from telemetry, not from what the control plane intended.
Strong versus eventual consistency: where each belongs
| Concern | Consistency | Why |
|---|---|---|
| Config writes, versions, audit log, region pointers | Strong (global Raft) | Two operators must not both create "v119"; audit must be complete; rollbacks must target an exact version |
| Config reads in a region | Eventual, bounded by replication lag | Reading from a local replica keeps reads fast and independent of cross-region links |
| Service discovery | Eventual, region-local | Endpoint lists are stale by seconds anyway (health checks take seconds); availability matters more |
| Geo-DNS | Eventual, bounded by TTL | Clients cache by design |
The rule behind the table: pay for strong consistency only where a stale or conflicting value is a correctness bug, and never on the request path.
Trade-offs and pitfalls
- A single global registry (one Raft cluster spanning all 5 regions for discovery) is the common wrong design: every instance change pays a cross-region commit and a partition can stall discovery everywhere.
- Async config replication means a brief window where regions run different versions. That is intended (it is how region-by-region rollout works), but configs must be backward compatible across adjacent versions.
- Low DNS TTLs are not failover by themselves: pooled connections and runtime DNS caches ignore them, and the TTL only starts after health checks detect the failure.
- What would change the design: if config must be read-your-writes consistent across regions (read-your-writes consistent: a client that just wrote a value is guaranteed to see that same value on its very next read from any region, never a stale one; for example a security revocation), send it through the control plane with a synchronous "applied in all regions" acknowledgement instead of the async path; if regions are fully independent tenants, drop the global Raft and run five independent config stores synced from Git.
During an incident, a junior engineer suggests repeatedly restarting a cluster node to clear state, which risks data corruption. As incident commander, how would you manage the risk, coach the engineer under time pressure, and achieve a safe mitigation that preserves data integrity while moving the incident forward?
Sample Answer
The idea in plain words
The engineer's instinct is worth keeping (they have a hypothesis: a restart clears bad state), but a stateful node (one that holds data other nodes depend on) is not like a stateless web server. Restarting it, again and again, can interrupt writes, trigger repeated recovery and, if other nodes are already unhealthy, lose the quorum (the minimum number of in-sync nodes that must agree for a write to be accepted). In a typical replicated cluster one node is the leader, which accepts writes and copies them to the followers. A follower is in-sync when its copy of the data has caught up with the leader's; replication lag is how far behind it is. As incident commander (IC, who coordinates and decides, and does not debug), I would slow that one action down by two minutes, put a gate in front of it, let at most one controlled restart through, and coach the engineer in the open channel without embarrassing them.
Why repeated restarts are risky: a small cluster
Assume a 3-node cluster where a write needs 2 of 3 in-sync nodes (quorum = floor(3 / 2) + 1 = 2).
| Situation when node A is restarted | In-sync nodes remaining while A is down | Quorum of 2 held? |
|---|---|---|
| B and C are healthy and in sync | 2 | Yes. Writes continue |
| B is lagging behind or down, C is healthy | 1 | No. Writes stall or, if the system is configured permissively, may be accepted without safe replication |
| A is restarted three times in a row, B and C healthy | 2 each time (3 again between restarts) | Yes each time, but with no spare node during every restart |
The third row is the other cost, and it is measured in time. Assume each restart keeps node A down and recovering for 4 minutes (an assumed figure; real recovery depends on how much data the node must replay). Three restarts cost 3 x 4 = 12 minutes. The first restart tests the hypothesis and returns information. If it did not help, the second and third are rarely a different experiment, so those 2 x 4 = 8 minutes carry the risk of a restart while nobody tests a new hypothesis.
What I do, in order
- Pause, politely and specifically. In the channel: "Hold the restart for two minutes. What state do you expect it to clear, and what makes you think that is the problem?" This treats the idea as a hypothesis, which a junior engineer can survive being wrong about.
- Assign a verification to the same engineer. "Check replication lag and which node is the leader, and report in two minutes." The suggester stays involved and the risk check gets done by someone who cares about the answer.
- Run a restart gate. A restart of a stateful node proceeds only if all of these hold:
- Quorum will hold with this node down (check the table above for the cluster).
- Replication on the other nodes is caught up, or a recent snapshot (a point-in-time copy of the data) or backup exists and its time is known.
- One node at a time, with a second person watching.
- A success test and a stop rule are written down first: "if the error rate has not dropped within 5 minutes, we do not restart again."
- Reduce the risk of the action itself. Drain traffic from the node first (stop sending it new requests by taking it out of the load balancer), let in-flight writes finish, and if the system supports it, fail over cleanly (move the leader role to a healthy follower) before restarting.
- Allow one controlled restart, then reassess. If it helps, continue with the monitored recovery. If it does not, the hypothesis was wrong. Do not repeat it. Move the work to the next hypothesis with the people who know the data layer (the database or platform owner), and consider a controlled failover.
- Record it. The scribe notes the hypothesis, the gate checks, the result and the stop rule.
Coaching under time pressure
- In the channel, brief and specific: "Good instinct to try to clear state. The risk is that we lose quorum while B is behind, so I need replication numbers before we touch A. You own that check." This is praise for the thinking and an assigned task.
- Do not lecture during the incident. The channel is for decisions.
- After the incident, privately: walk through the table above, explain why the gate exists, ask what they would add, and invite them to help write the stateful-restart section of the runbook (a documented procedure for known situations). People follow rules they helped write.
Recommendation
Do not say no to the restart outright and do not allow it as proposed. Say "yes, once, through the gate". What flips it: if the node is already hung and the data on it is replicated safely elsewhere, a single restart is cheap and the gate completes in a minute. If no recent backup exists and replication is behind, the first action is to protect the data (snapshot, or catch replication up), not to restart anything.
Common mistakes
- Shutting the idea down with authority and no explanation, so the engineer stops speaking up in later incidents.
- Letting a second and third restart happen because the first one "looked like it helped".
- The IC personally checking replication instead of assigning it.
- Coaching at length in the channel while responders wait.
Tell me about how you build trust with someone in another function, like a new product manager who's going to depend on your team, before you actually need something from them.
Sample Answer
Direct answer
Build trust before you need anything, by being reliable on small things, transparent about your constraints and capacity, and by giving the other person visibility into your world so they aren't surprised later. Waiting to invest in the relationship until you need a favor makes the ask feel transactional.
Framework
Lead with reliability on small things. Deliver on small, early commitments, answer a question promptly, show up to their planning session, so your word has a track record before there's a high-stakes ask on either side.
Be transparent about constraints. Proactively share capacity, risk, and known limitations rather than letting the other person find out the hard way, mid-project.
Give visibility into your world. Invite them into a review or share a roadmap or dashboard, so they understand your constraints without needing you to explain from scratch every time.
Make it reciprocal early. Ask what they need and what's on their plate too. Trust runs both directions, not just from you demonstrating value to them.
Worked example
Situation: a new product manager joins and will depend on your team, for example a platform or infrastructure team, for their roadmap.
Action: in the first couple of weeks, gave the PM read access to the team's capacity and roadmap view along with a short walkthrough, rather than waiting for them to ask. Proactively flagged one known constraint, a piece of infrastructure that was close to capacity, before it affected their planning. Followed through quickly and visibly on a small early request, answering a scoping question the same day, to establish reliability before anything high-stakes came up.
Result: by the time the PM had a genuinely high-stakes ask, an accelerated timeline, there was already a working relationship and a shared understanding of constraints. The conversation started from what's actually possible given what you already know, instead of starting from zero.
Trade-offs and pitfalls
- Trust-building gestures can look like busywork if they aren't tied to something concrete. Keep them small and genuinely useful, not performative.
- Over-sharing every constraint upfront can read as excuse-making before there's even a request. Calibrate to what's actually relevant to their planning.
- The senior differentiator is doing this proactively, before there's a need, rather than scrambling to build rapport only once you need something from the other person, which reads as transactional.
What's the difference between fault tolerance, high availability, and resilience? Give a concrete example of each, and explain how they show up in operational metrics like MTTR and MTBF.
Sample Answer
Fault tolerance, high availability, and resilience are related but answer different questions. Fault tolerance means a failure is masked entirely: the system keeps producing correct output with no visible interruption. High availability (HA) means downtime is minimized and recovery is fast, but a brief, bounded interruption is expected and acceptable. Resilience is the broadest term: the system's ability to keep delivering acceptable service under any kind of stress, not just component failure, including load spikes, bad inputs, or a slow dependency, usually by degrading gracefully rather than failing outright.
How each shows up architecturally
| Property | What it guarantees | Typical mechanism | Concrete example |
|---|---|---|---|
| Fault tolerance | No visible interruption during a failure | Redundant, synchronized components that vote or replicate in lockstep (RAID, dual power supplies, Raft/Paxos-replicated state) | A 3-node Raft cluster loses one node; the other two still form a quorum (a majority of the cluster, here 2 of the original 3 nodes, enough to safely keep operating and elect a leader if needed) and serve every request with zero downtime |
| High availability | Short, bounded interruption, fast automated recovery | Health-checked redundancy plus automated failover (active-passive DB failover, load-balanced app tier) | A primary database instance crashes; a monitor detects it in seconds and promotes a replica, so the outage is measured in seconds to low minutes, not zero |
| Resilience | Acceptable service continues even when something can't be masked or failed over cleanly | Circuit breakers, timeouts, bulkheads, graceful degradation, autoscaling | A recommendation service starts timing out; the product page serves without recommendations instead of failing the whole page load |
Fault tolerance and HA are usually about infrastructure failing; resilience is about the system's response to any kind of stress, including ones where nothing has technically "failed" yet (a slow but technically-up dependency, for instance).
Effect on MTTR and MTBF
MTTR (mean time to repair/recover) and MTBF (mean time between failures) combine into steady-state availability:
A=MTBF+MTTRMTBFFault tolerance mainly extends effective MTBF from the user's point of view: individual component failures still happen at whatever rate they happen, but they don't count as user-visible failures because they're masked, so the failure interval a customer would notice grows. High availability mainly drives MTTR down: the goal isn't to prevent the primary from ever failing, it's to make detection and recovery fast and automatic. Resilience patterns move both numbers in the same direction from a different angle: a circuit breaker doesn't prevent a dependency from failing (MTBF of the dependency is unchanged) but it prevents that dependency's failure from becoming your incident at all, which is a third way to improve the user-visible number.
Worked example
Take a service with a component MTBF of 720 hours and an MTTR of 30 minutes (0.5 hours) once a failure is detected and recovered:
A=720+0.5720=720.5720≈0.99931(99.931%)That converts to annual downtime using 525,600 minutes per year (365 days × 24 hours × 60 minutes):
(1−0.99931)×525,600≈364.8 minutes/year≈6.08 hours/yearNow compare two improvements starting from that baseline, holding the other variable fixed:
- Cut MTTR to 5 minutes (better HA: faster automated failover) with MTBF unchanged at 720h: A=720/720.083≈0.999884, about 61.0 minutes/year of downtime, a ~6x reduction driven entirely by faster recovery.
- Double MTBF to 1440 hours (better fault tolerance: the failure that used to happen now gets masked half as often) with MTTR unchanged at 30 min: A=1440/1440.5≈0.999653, about 182.4 minutes/year, a 2x reduction.
Neither number is "the metrics." They're two independent levers on the same availability formula, and which one is cheaper to pull depends on the system: automating failover (MTTR) is often cheaper than adding redundant hardware paths everywhere (MTBF).
Trade-offs and pitfalls
The common mix-up in interviews is treating "high availability" as if it means "never goes down," which is what fault tolerance actually promises, and at a much higher engineering cost (consensus protocols, lockstep replication) than HA's health-check-and-failover pattern. A resilient system is not automatically fault-tolerant or highly available either: a service with excellent circuit breakers and graceful degradation for its dependencies can still have a single database with no HA story of its own. These three properties are complementary, not substitutes, and a system typically needs different amounts of each depending on the blast radius of the component: mask failures (fault tolerance) for the smallest, cheapest, most critical primitives; fail over fast (HA) for stateful tiers where full masking is expensive; and degrade gracefully (resilience) at the edges where "reduced functionality" beats "hard failure." The same reasoning applies outside a classic web-service stack too: a GPU training job gets fault tolerance from checkpointing plus redundant nodes (a crashed worker resumes from the last checkpoint instead of restarting the whole job), and a data pipeline gets resilience from feature-store (a system that serves precomputed inputs to a machine-learning model) fallback values or a stale-but-served cache when an upstream API is delayed rather than hard-failing the request.
Write a SQL query (or outline it) to compute the 30-day sliding-window error budget burn rate at hourly granularity given a table requests(timestamp, status_code, service). The output should be a time series of burn_rate per hour over the past 90 days. Explain how you handle aggregation and performance considerations.
Sample Answer
A 90-day, hourly-granularity burn-rate series needs an efficient way to compute a 30-day TRAILING sum at every hour, which is a classic windowed-aggregation problem, not a per-row calculation.
Structured elaboration
Rather than recomputing a 30-day sum from scratch for every output hour (an O(n * window) approach), a window function computes each trailing sum in a single pass. First pre-aggregate raw requests into hourly buckets (service, hour_bucket, total, bad), converting each bucket's timestamp into an integer hour-index (hour_num) so the frame can use a numeric RANGE (dates directly are not portable across engines for RANGE frames). Then a SUM(...) OVER (PARTITION BY service ORDER BY hour_num RANGE BETWEEN 719 PRECEDING AND CURRENT ROW) (719 = 30 days x 24 hours - 1) gives the true trailing 30-day total and bad count at every hour in a single pass; the burn rate at each hour is the ratio of the trailing bad-to-total requests, normalized by the SLO's allowed error fraction.
Worked example (executed; sqlite3, hourly aggregation and 30-day trailing window confirmed against a small synthetic dataset)
WITH hourly AS (
SELECT service,
strftime('%Y-%m-%d %H:00:00', timestamp) AS hour_bucket,
CAST(strftime('%s', strftime('%Y-%m-%d %H:00:00', timestamp)) / 3600 AS INTEGER) AS hour_num,
COUNT(*) AS total,
SUM(CASE WHEN status_code >= 500 THEN 1 ELSE 0 END) AS bad
FROM requests
WHERE timestamp >= datetime('now', '-90 days')
GROUP BY service, hour_bucket
),
trailing AS (
SELECT service, hour_bucket, hour_num, total, bad,
SUM(total) OVER (PARTITION BY service ORDER BY hour_num
RANGE BETWEEN 719 PRECEDING AND CURRENT ROW) AS total_30d,
SUM(bad) OVER (PARTITION BY service ORDER BY hour_num
RANGE BETWEEN 719 PRECEDING AND CURRENT ROW) AS bad_30d
FROM hourly
)
SELECT service, hour_bucket, total_30d, bad_30d,
ROUND(bad_30d * 1.0 / total_30d, 4) AS observed_error_rate_30d,
ROUND((bad_30d * 1.0 / total_30d) / 0.001, 2) AS burn_rate_30d_vs_999_slo
FROM trailing
ORDER BY hour_bucket;
Against a small synthetic requests table (three consecutive hourly buckets with own error counts of 1/3, 0/2, and 2/3 respectively), the trailing 30-day totals accumulate correctly across hours: hour 1 (3 total, 1 bad, own rate 33.33%, no prior history so trailing = own = 333.33x); hour 2 (cumulative 5 total, 1 bad, trailing rate 20% -> 200.00x, which is LOWER than hour 2's own instantaneous 0% would suggest in isolation only because it is blended with the still-elevated hour 1 inside the trailing window); hour 3 (cumulative 8 total, 3 bad, trailing rate 37.5% -> 375.00x). These trailing figures were confirmed by running the query and differ meaningfully from a naive per-hour-only calculation, which is exactly the bug in a non-trailing implementation: a single bad hour would appear to "clear" the alert the moment the next hour is healthy, when in reality 30 days of accumulated bad requests are still being carried forward.
Trade-offs and pitfalls
SQLite's window RANGE frame only supports numeric offsets, not native date/time intervals, which is why the hour timestamp is first cast to an integer hour-index; PostgreSQL supports RANGE BETWEEN INTERVAL '30 days' PRECEDING AND CURRENT ROW directly on a timestamp column, which is the more natural production choice if available. At 90 days of hourly data per service this is a modest row count for the window function, but if this pattern is applied at per-minute granularity across many services, a windowed aggregate over raw (rather than pre-aggregated hourly) rows becomes expensive fast; pre-aggregating to hourly rollups (as done here) before applying the window is the standard mitigation, and the window itself should be computed on the much smaller hourly table, never re-scanning raw per-request rows for every output hour.
Recommended Additional Resources
- Designing Data-Intensive Applications by Martin Kleppmann - Essential for understanding distributed systems design and trade-offs
- Site Reliability Engineering (SRE Book) by Google - Foundational SRE concepts, practices, and culture
- The Phoenix Project by Gene Kim - Understanding DevOps, systems thinking, and organizational change
- Distributed Systems Consensus Algorithms - Raft and Paxos for understanding coordination
- LeetCode Premium - Practice medium to hard coding problems with focus on systems-oriented problems
- System Design Interview resource - Design monitoring systems, deployment pipelines, and distributed infrastructure
- Linux Kernel Development by Robert Love - Deep understanding of Linux internals
- TCP/IP Illustrated by W. Richard Stevens - Comprehensive networking fundamentals
- Meta Engineering Blog - Understanding Meta's infrastructure, engineering culture, and technical direction
- Chaos Engineering principles and tools - Understanding resilience testing and failure injection
- Kubernetes architecture and troubleshooting - Container orchestration for modern infrastructure
Search Results
Google Site Reliability Engineer (SRE) Interview (questions, process ...
You should expect questions around networking concepts, such as connectivity checks, DNS resolution, port conflicts, and routing. Example Google ...
50 Site Reliability Engineer (SRE) Interview Questions 2025
Most asked Site Reliability Engineering (SRE) interview questions · Q1. Differentiate between DevOps and SRE. · Q2. Why do you want to do a job in ...
Site Reliability Engineering Interview Questions - MentorCruise
Study Mode · 1. How do you deal with on-call emergency issues · 2. Which programming languages are you most comfortable working with? · 3. What steps would you ...
Meta Software Engineer Interview Questions and Preparation Guide
Expect LeetCode-style coding questions, design problems shaped like apps people use every day, and behavioral questions that test how well you'd ...
Top 25 SRE Interview Questions and Answers for 2025 - YouTube
Want to crack your SRE (Site Reliability Engineer) interview fast? This video covers the most commonly asked SRE interview questions and ...
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 ...
Meta (Facebook) Site Reliability Engineer Interview Questions
Review this list of Meta (Facebook) site reliability engineer interview questions and answers verified by hiring managers and candidates.
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