Meta Site Reliability Engineer (Junior Level) Interview Preparation Guide
While Meta's hiring for SRE roles is confirmed through multiple sources, detailed official interview process documentation was not available in the search results. This guide is based on industry-standard SRE interview patterns, the provided job description, and publicly documented practices for junior-level SRE candidates at tier-1 tech companies. Meta's actual interview process may vary.
Meta's SRE interview process for junior-level candidates typically consists of an initial recruiter screening, followed by 1-2 technical phone screens, and concludes with 4-5 onsite interview rounds. The interview structure assesses foundational SRE knowledge, practical incident response capabilities, system thinking, observability expertise, and cultural alignment. Candidates should expect discussions around monitoring, alerting, automation, distributed systems concepts, and real-world incident scenarios.
Interview Rounds
Recruiter Screening
What to Expect
Initial screening call with a Meta recruiter to assess fit, understand your background, verify interest in the SRE role, and provide details about the position. This is a conversational round focused on your career trajectory, motivation for joining Meta, and logistical details about the interview process. The recruiter will also answer your questions about the role and team. This is your opportunity to demonstrate enthusiasm for reliability engineering and your understanding of what the role entails.
Tips & Advice
Be authentic about your interest in SRE. Prepare 2-3 questions about the role, team structure, and current challenges they're facing with system reliability. Research Meta's infrastructure and mention relevant products or technical achievements that excite you. Have your elevator pitch ready: why you're transitioning to/pursuing SRE, what aspects excite you most, and why Meta specifically. Keep answers concise—this is not a deep technical round.
Focus Topics
Understanding of SRE Role at Meta
Demonstrate awareness of what Meta's SRE team does, the scale of problems they solve, and how SRE contributes to Meta's mission. Show you've researched Meta's engineering culture and reliability challenges.
Practice Interview
Study Questions
Career Motivation and SRE Interest
Articulate why you're interested in Site Reliability Engineering as a career path, what aspects of the role appeal to you, and why you believe Meta is the right next step. Discuss specific experiences that sparked your interest in reliability, scalability, or operations work.
Practice Interview
Study Questions
Professional Background and Relevant Experience
Summarize your work experience, focusing on projects and roles that demonstrate systems thinking, operational work, or infrastructure contributions. Highlight any experience with automation, monitoring, incident response, or supporting production systems.
Practice Interview
Study Questions
Technical Phone Screen 1: Fundamentals and Tools
What to Expect
First technical screening call with an SRE engineer from Meta. This round evaluates your foundational knowledge of SRE concepts, familiarity with monitoring and observability tools, and understanding of basic operational practices. Expect questions about how monitoring systems work, what metrics matter for reliability, and your hands-on experience with infrastructure tools. This is not a deep coding round but may involve discussing shell scripting or automation approaches at a high level.
Tips & Advice
Focus on explaining concepts clearly using real examples from your past work. When discussing tools, be specific about your hands-on experience: which tools have you used, in what context, and what problems did they help you solve? For junior-level, demonstrate practical understanding rather than theoretical perfection. If asked about a concept you're not familiar with, acknowledge it honestly and explain your approach to learning new tools. Prepare a concise explanation of a past incident you dealt with and how you debugged it.
Focus Topics
Automation and Infrastructure Tools
Discuss your experience with automation: shell scripting, configuration management tools (Terraform, Ansible, Chef), infrastructure-as-code, or CI/CD tools. Explain a repetitive operational task you've automated and the impact it had. For junior level, focus on practical examples rather than advanced optimization.
Practice Interview
Study Questions
Monitoring and Alerting Fundamentals
Understand the core principles of monitoring: what metrics matter (latency, error rate, saturation), types of alerts (threshold-based, anomaly detection, composite alerts), and how to avoid alert fatigue. Be prepared to discuss tools like Prometheus, Grafana, Datadog, or New Relic. Explain the difference between monitoring and observability.
Practice Interview
Study Questions
Basic System Observability and Debugging
Explain the three pillars of observability: metrics, logs, and traces. Discuss tools you've used for troubleshooting (command-line tools, log aggregation, APM tools). Describe your approach to debugging a performance issue or production incident: how you'd gather data, form hypotheses, and narrow down root causes.
Practice Interview
Study Questions
SLOs, SLIs, and Error Budgets
Define Service Level Objectives (SLOs), Service Level Indicators (SLIs), and Service Level Agreements (SLAs). Explain how error budgets work and how they guide decision-making about reliability improvements versus new feature development. Provide an example of how you'd define an SLO for a service.
Practice Interview
Study Questions
Technical Phone Screen 2: Incident Response and Problem-Solving
What to Expect
Second technical screening call typically with a different SRE engineer. This round assesses your incident response capabilities, troubleshooting mindset, and how you approach production problems. Expect scenario-based questions like 'How would you debug a slow database?' or 'What would you do if a service started returning 500 errors?' You may be asked to walk through a past incident, discuss how you'd set up monitoring for a given scenario, or explain your approach to capacity planning.
Tips & Advice
Prepare 2-3 detailed incident stories from your past work using the STAR method. Focus on what you learned and how you improved the system afterward, not just on fixing the immediate problem. When given a scenario, think out loud: ask clarifying questions, explain your debugging approach step-by-step, and discuss trade-offs. For junior level, demonstrating a logical troubleshooting process is more important than having the perfect answer. Show you understand that incident response involves collaboration and communication, not just technical problem-solving.
Focus Topics
Performance Optimization and Capacity Planning
Discuss how you identify performance bottlenecks. Explain concepts like resource utilization, headroom, and when to scale. Describe how you've optimized a system for performance: database queries, caching, infrastructure scaling, etc. Discuss the trade-offs between performance and cost.
Practice Interview
Study Questions
On-Call Responsibilities and Toil Management
Discuss your understanding of on-call rotations, escalation procedures, and runbooks. Explain how you'd balance responding to incidents with reducing toil through automation. Discuss the challenge of context-switching and how you'd minimize alert fatigue.
Practice Interview
Study Questions
Incident Response and Troubleshooting Methodology
Understand the incident response process: detection, triage, mitigation, resolution, and post-incident review. Explain your approach to troubleshooting: gathering data, forming hypotheses, testing them, and implementing fixes. Discuss the importance of communication during incidents and how you'd coordinate with other teams.
Practice Interview
Study Questions
Root Cause Analysis and Post-Incident Reviews
Explain how you identify root causes versus symptoms. Discuss the concept of blameless post-mortems and why they're valuable. Describe how you'd document an incident and extract learnings. Discuss preventive measures: how you'd ensure the same issue doesn't recur.
Practice Interview
Study Questions
Onsite Round 1: Technical Depth - System Reliability Concepts
What to Expect
First onsite round focused on deeper technical understanding of system reliability, distributed systems basics, and architectural concepts. The interviewer will ask questions about how systems fail, redundancy, consistency models, and how to design for reliability. You may be asked to discuss a system you've worked with, identify potential failure modes, and explain how you'd mitigate them. This round bridges toward system design thinking but remains grounded in reliability principles rather than full system design.
Tips & Advice
Come prepared with a real system you know well—explain its architecture, dependencies, and potential failure points. For a junior-level candidate, focus on demonstrating understanding of reliability principles (redundancy, failover, circuit breakers, graceful degradation) and applying them to real systems. Don't worry about perfect system design patterns; focus on explaining your thinking clearly and showing how reliability concerns influence architectural decisions. Ask clarifying questions if the interviewer introduces a hypothetical system.
Focus Topics
Scalability and Resource Management
Discuss vertical versus horizontal scaling. Explain how you'd identify scalability bottlenecks and plan for growth. Discuss container orchestration basics (Kubernetes concepts like pods, services, deployments) and how they support reliability and scalability. Explain resource limits, autoscaling policies, and capacity planning.
Practice Interview
Study Questions
Disaster Recovery and Business Continuity
Explain disaster recovery concepts: Recovery Time Objective (RTO) and Recovery Point Objective (RPO). Discuss backup strategies, multi-region redundancy, and data replication. Explain how you'd test recovery procedures. Discuss the trade-offs between disaster recovery investment and risk tolerance.
Practice Interview
Study Questions
Distributed Systems and Failure Modes
Understand common failure modes in distributed systems: network partitions, cascading failures, data consistency issues, resource exhaustion. Discuss how you'd design systems to tolerate these failures: redundancy, isolation, timeouts, circuit breakers, bulkheads. Explain concepts like eventual consistency, quorum-based replication, and health checks.
Practice Interview
Study Questions
Deployment and Rollback Strategies
Discuss deployment approaches: blue-green deployments, canary releases, rolling updates. Explain how you'd manage rollbacks and detect bad deployments. Discuss monitoring during deployments and the role of SREs in ensuring safe, reliable deployments. Explain trade-offs between deployment speed and safety.
Practice Interview
Study Questions
Onsite Round 2: Observability and Monitoring Architecture
What to Expect
This round focuses on observability, monitoring system design, and instrumentation strategy. The interviewer will discuss how to design monitoring and alerting for a service, what metrics and logs to collect, how to structure dashboards for different audiences, and how to detect problems early. You may be asked to design monitoring for a hypothetical service or discuss how you'd improve monitoring for a system you've worked with. This demonstrates practical understanding of observability as a reliability tool.
Tips & Advice
Come prepared with specific examples of monitoring you've implemented or improved. Discuss what you've learned about which metrics matter most and which alerts actually fire meaningfully versus generating noise. For junior level, focus on practical monitoring decisions: why you chose certain metrics, how you structured alerts, and how you collaborated with dev teams on instrumentation. If you haven't worked extensively with monitoring, discuss your approach to learning and implementing a monitoring system from scratch.
Focus Topics
Dashboard Design and Observability for Different Audiences
Discuss how to design dashboards for different purposes: on-call engineer dashboards for quick triage, business dashboards for stakeholders, SLO dashboards for tracking reliability. Explain how you'd structure dashboards for usability. Discuss the balance between too much information and not enough.
Practice Interview
Study Questions
Monitoring Tools and Infrastructure
Discuss experience with monitoring stacks like Prometheus/Grafana, Datadog, New Relic, or others. Explain architectures for collecting metrics at scale. Discuss time-series databases and their characteristics. Explain how you'd set up monitoring for containers and microservices. Discuss monitoring in cloud environments.
Practice Interview
Study Questions
Alerting Strategy and Preventing Alert Fatigue
Discuss how to design meaningful alerts that catch real problems without creating noise. Explain alert thresholds, composite alerts, and anomaly detection. Discuss alert routing, escalation policies, and on-call workflows. Explain how you'd measure alert quality: did it catch something important, or was it a false positive?
Practice Interview
Study Questions
Metrics, Logs, and Traces Strategy
Explain the three pillars of observability and their purposes. Discuss which metrics are most important for reliability (error rate, latency, saturation, availability). Explain how to structure logs for searchability and debugging. Discuss distributed tracing and why it matters in microservices environments. Explain trade-offs in data collection, retention, and cost.
Practice Interview
Study Questions
Onsite Round 3: Automation and Infrastructure-as-Code
What to Expect
This round focuses on automation, infrastructure-as-code, and tooling for operational efficiency. The interviewer will discuss how to automate repetitive tasks, infrastructure provisioning, configuration management, and CI/CD pipelines. You may be asked to discuss a repetitive process you've automated, explain infrastructure-as-code concepts, or design automation for a given scenario. This round tests your ability to reduce toil and scale operational work.
Tips & Advice
Prepare concrete examples of automation you've implemented: a script you wrote, a configuration management setup, or a CI/CD improvement. Explain the business value: what did this automation achieve in terms of time saved, error reduction, or reliability improvement? For junior level, focus on practical, impactful automation rather than overly complex systems. Discuss your approach to learning automation tools—most interviews value problem-solving and learning ability as much as existing expertise. Be honest about what you haven't done but show curiosity about these areas.
Focus Topics
CI/CD Pipelines and Deployment Automation
Explain CI/CD concepts: continuous integration, continuous deployment/delivery. Discuss tools like Jenkins, GitHub Actions, GitLab CI, or similar. Explain how to safely automate deployments: testing, deployment gates, rollback mechanisms. Discuss the role of SREs in ensuring deployment reliability and speed.
Practice Interview
Study Questions
Scripting and Programming for Operational Tasks
Discuss your programming or scripting experience relevant to operations: Python, Go, Bash, or others. Explain how you approach writing scripts for operational tasks. Discuss maintainability, error handling, and logging in operational code. Explain your approach to learning new languages for operations work.
Practice Interview
Study Questions
Automation for Toil Reduction
Define toil: repetitive, manual, operational work. Discuss how you identify toil and prioritize automation efforts. Provide examples of toil you've reduced through automation. Explain the cost-benefit analysis of automation: when is it worth automating versus accepting manual work? Discuss the impact on on-call experience and team productivity.
Practice Interview
Study Questions
Infrastructure-as-Code and Configuration Management
Understand principles of infrastructure-as-code: versioning infrastructure, reproducibility, idempotency. Discuss tools like Terraform, Ansible, CloudFormation, or similar. Explain how to manage infrastructure changes safely and audit who made changes. Discuss the benefits: faster provisioning, disaster recovery, consistent environments. Discuss trade-offs in complexity and learning curve.
Practice Interview
Study Questions
Onsite Round 4: Behavioral and Team Collaboration
What to Expect
Final onsite round focused on behavioral assessment, communication skills, teamwork, and cultural fit with Meta. The interviewer will use behavioral questions to understand how you handle challenges, collaborate with teams, learn from failures, and approach responsibilities. Expect questions about past experiences with conflict resolution, working across teams, learning new systems, and your approach to continuous improvement. This round assesses whether you're a good team member and aligned with Meta's engineering culture.
Tips & Advice
Prepare 5-6 detailed stories using the STAR method (Situation, Task, Action, Result) that showcase collaboration, learning, problem-solving, and handling adversity. For junior-level candidates, focus on stories that demonstrate: willingness to learn, asking for help appropriately, collaborating with teammates, taking ownership within your scope, and learning from mistakes. Emphasize team success over individual accomplishment. Be authentic and honest—interview conversations should feel like natural discussion, not recited answers. Ask thoughtful questions about the team's culture, how they handle incidents, and what support junior members receive.
Focus Topics
Handling Failure and Incident Response Communication
Discuss a significant incident or failure you experienced: how you handled it, what you learned, and how you prevented recurrence. Emphasize blameless post-mortem approach and psychological safety. Discuss how you communicate during stressful situations. Explain your approach to taking responsibility without making excuses.
Practice Interview
Study Questions
Taking Ownership and Accountability
Provide examples of projects or responsibilities you took ownership of as a junior team member. Discuss how you ensured quality and communicated progress. Explain your approach to asking for help when needed versus trying to solve everything alone. Describe how you handle situations where you don't know the answer.
Practice Interview
Study Questions
Collaboration and Cross-Functional Teamwork
Discuss your experience working with development teams, operations teams, and other functions. Explain how you communicate technical concepts to non-technical stakeholders. Describe a situation where you resolved conflict or misalignment between teams. For SREs, emphasize partnership with developers on reliability: how you collaborate on SLOs, incident response, and improving system design for reliability.
Practice Interview
Study Questions
Learning and Growth Mindset
Discuss your approach to learning new systems, tools, and domains. Provide an example of a challenging concept you learned and how you approached it. Discuss what you don't know and how you identify and fill knowledge gaps. Explain your approach to staying current with infrastructure and reliability trends.
Practice Interview
Study Questions
Frequently Asked Site Reliability Engineer (SRE) Interview Questions
You are asked to choose a primary language for building a company-wide reusable automation framework. Compare Python, Go, and Bash across safety, contributor familiarity, packaging and distribution, static analysis tools, concurrency primitives, binary size, and onboarding cost. Make a recommendation and provide a migration plan from existing ad-hoc scripts.
Sample Answer
Direct answer
Safety, packaging maturity, and contributor familiarity pull in genuinely different directions across these three, so the right answer depends on what the framework is actually FOR, not on picking a single best language in the abstract.
Comparison
| Dimension | Python | Go | Bash |
|---|---|---|---|
| Safety | Dynamic typing, runtime errors possible; mitigated by type hints + mypy | Static typing, compiled -- whole classes of bugs caught before ship | No type system, easy to write subtly wrong scripts (unquoted variables, unset -e forgotten) |
| Contributor familiarity | Very high across most eng orgs | Moderate, growing, but a real onboarding cost for teams without existing Go exposure | Universal baseline knowledge, but deep Bash mastery is rarer than it looks |
| Packaging/distribution | Requires a runtime + dependency management (wheels, venvs); more moving parts | Single static binary, trivially distributable, no runtime dependency | Ships as source; "distribution" is really just "copy the file," no build step |
| Static analysis | Mature (mypy, ruff, bandit) | Mature and built-in (go vet, staticcheck) | Weak (ShellCheck is good but the language itself resists deep static analysis) |
| Concurrency primitives | asyncio/threading, usable but more ceremony | Goroutines + channels, a first-class design strength | Effectively none; concurrency means spawning and managing subprocesses manually |
| Binary size / startup | Runtime startup overhead (Python interpreter init) | Fast startup, small static binary | Fastest startup, but that's not usually the differentiator that matters |
| Onboarding cost | Low | Medium | Low for basics, high for doing it CORRECTLY at scale |
Recommendation and reasoning
For a company-wide, contributor-heavy automation framework, Python is the strongest default: the packaging story is more work than Go's single binary, but the contributor-familiarity and library-ecosystem advantages usually outweigh that for a framework meant to be extended by many teams across the org, not just a small platform team. Go is the better call specifically when concurrency and single-binary distribution to environments without a Python runtime matter more than broad contributor familiarity -- for example, a high-throughput worker or a CLI that needs to run on minimal container images. Bash should be reserved for genuinely small, single-purpose glue (a few lines gluing existing CLI tools together) rather than as the implementation language for a 'framework' -- its lack of a type system and weak static analysis make it a poor foundation for something many people will extend over years, even though it's the right tool for a five-line wrapper script.
A concrete task-to-language mapping sharpens this: ad-hoc file operations and small production fixes are legitimately Bash's home turf (fast, universally readable, no build step); a shared deployment CLI that many developer laptops will install points toward Go specifically because a static binary sidesteps 'do you have the right Python version installed' entirely; and a high-throughput worker processing on the order of 10,000 tasks/minute is exactly where Go's goroutine model and lower per-task overhead earn their onboarding cost over Python's asyncio/multiprocessing, which can still hit the target but with more tuning and a higher operational ceiling to manage.
Migration plan from ad-hoc scripts
Don't do a big-bang rewrite. Inventory existing scripts by usage frequency and blast radius, migrate the highest-value/highest-risk ones first (where the framework's retry/logging/secrets primitives pay off fastest), and keep the framework backward-compatible enough that a not-yet-migrated Bash script can still be invoked as a step inside the new framework rather than requiring every single script to be rewritten before the framework has any users.
Trade-offs and pitfalls
The most common mistake is picking the language based on the TEAM's current skill distribution rather than the TASK's actual requirements, then discovering the mismatch only once the framework has grown large enough that switching is expensive. Edge case: a framework whose different SUB-COMPONENTS have genuinely different requirements (a fast CLI entrypoint alongside a slow, throughput-heavy background worker) may legitimately justify two languages rather than forcing one choice across a codebase that doesn't have uniform needs.
Describe a comprehensive security and compliance checklist for production deployments: secrets management, image signing and provenance, vulnerability scanning, RBAC and least privilege, audit logs, immutable infrastructure, patching policies, and evidence collection for audits. Explain trade‑offs between release speed and implementing these controls.
Sample Answer
A comprehensive security and compliance checklist for production deployments needs to cover the full path from what's in the artifact, to how it was produced, to who's allowed to approve it moving, since a gap at any one of those layers undermines the guarantees the others provide.
The checklist
Secrets management: no plaintext secrets in the artifact or its configuration; all runtime secrets injected via a secrets manager with short-lived, scoped credentials, following the patterns discussed throughout this topic. Image signing and provenance: the artifact is signed, and its provenance (what built it, from what source, when) is attached and verifiable, not merely claimed. Vulnerability scanning: the artifact has passed SCA and container-image scanning with no unaddressed CRITICAL finding, or has an explicit, time-boxed, approved exception on record. RBAC (role-based access control) and least privilege: the deployment identity itself has only the permissions needed to deploy this specific service, and production access more broadly follows a documented, reviewed access model rather than broad, shared credentials. Audit logs: every deployment action (who triggered it, what was deployed, when, and the outcome) is captured in an immutable, queryable log. Immutable infrastructure: the deployment replaces infrastructure with a new, versioned image rather than patching a running instance in place, so the deployed state always traces back to a specific, auditable build. Patching policies: a defined cadence and SLA for applying security patches to base images and dependencies, verified as actually being followed, not just documented as a policy. Evidence collection for audits: the artifacts above (signatures, scan results, approval records, access logs) are retained in a form an auditor can review without requiring a special, one-off data-gathering effort.
Trade-offs between release speed and implementing these controls
Every item on this checklist has a real velocity cost when first implemented (signing and scanning add pipeline time, RBAC design takes real engineering effort, audit-log retention has its own storage and tooling cost), but nearly every one of these, once built, becomes close to free on a per-deployment basis: the marginal cost of THIS deployment being signed, scanned, and logged, given the infrastructure already exists, is small, which is why the honest framing for a team weighing this trade-off is that the real cost is the one-time investment to build the capability, not an ongoing per-release tax. The controls most worth prioritizing first, given limited time, are the ones that are cheapest to build relative to the risk they close (secret scanning and basic signing) versus the ones that take longer to mature (a fully documented, reviewed RBAC model across every production system), which argues for a staged rollout of this checklist itself rather than treating it as an all-or-nothing bar every deployment must clear from day one.
Trade-offs
Treating this as a staged capability build, rather than an immediate, complete gate, means some deployments proceed for a period without every item on the checklist fully in place; that's an honest, deliberate trade for the same reason discussed for shift-left rollouts elsewhere in this topic: demanding full compliance from day one either blocks legitimate work at a team not yet ready for it, or gets quietly bypassed, neither of which actually improves the organization's real security posture.
As a security architect, you don't own another team's backlog, but you need your threat-modeling findings built into their design before they start coding. How do you get that prioritized without direct authority over their roadmap?
Sample Answer
Direct answer
As a security architect you rarely have line authority over another team's backlog, so you get findings prioritized by making them cheap to accept and costly to ignore: translate the finding into the other team's own vocabulary (a defect, a customer risk, a compliance control they must attest to) and attach it to a decision they are already about to make, rather than asking them to open a brand-new work item. You lead with a specific, demonstrated risk instead of a policy citation, offer a menu of remediation options at different costs, and use an existing recurring forum, like a design review or architecture council, so the tradeoff is made visible to the team's own stakeholders, not just to you.
Structured elaboration
- Translate, don't mandate: reframe the threat-modeling finding in terms the team already tracks (a customer-facing incident scenario, a compliance control, a defect class QA can reproduce) instead of a generic "security best practice."
- Time it to their planning cycle: bring a written finding before backlog grooming or sprint planning, not after code is merged, so accepting it is a normal prioritization decision instead of a rework request.
- Offer options, not a mandate: propose two or three remediation paths (a quick mitigating control now, a full fix next sprint, an explicit accepted-risk sign-off) so the team's own product owner makes an informed tradeoff instead of feeling overridden.
- Borrow a forum, don't invent one: attach the ask to a ritual the team already respects, like their design review, so it reads as peer-level influence rather than a unilateral security gate.
- Make patterns visible upward: when a team consistently deprioritizes findings, escalate the pattern, not the individual finding, to a shared forum with both engineering and security leadership present, so someone with authority over both sides makes the call.
Worked example (illustrative, adapt to your own experience)
A security architect threat-models a new payments feature two weeks before the product team's sprint planning. Instead of filing a ticket titled "add input validation" into the team's backlog and hoping it gets picked up, they write a one-page finding: the specific attack path, the customer-facing scenario it enables, and three remediation options ranked by effort. They bring it to the team's existing design review, present it alongside the team's own product owner, and let the team choose between a lightweight mitigating control shippable in the current sprint or a fuller fix in the next one. The team picks the lightweight option and schedules the fuller fix on their own board, because the tradeoff was made visible and owned by them, not imposed from outside.
Trade-offs and pitfalls
- Too formal (a mandatory sign-off gate) breeds resentment and workarounds; too informal (a message in passing) gets lost in someone else's priority queue.
- Offering remediation options is powerful but risks a team always choosing the cheapest option indefinitely, so track accepted-risk decisions somewhere durable so a pattern of chronic deferral becomes visible over time.
- Borrowing an existing ritual only works if that ritual has real teeth; if the design review itself gets skipped or ignored, attaching your ask to it just inherits its weakness.
What the interviewer probes next
They typically follow up on how you handle a team that keeps saying "next sprint" indefinitely, whether you would ever reach for a hard gate like a release-blocking scan instead of persuasion, and how this influence model holds up when you are supporting a dozen teams at once instead of just one.
Compare Five Whys, a fishbone (Ishikawa) diagram, fault-tree analysis, and causal-chain/timeline analysis as root-cause techniques. For each, describe what kind of incident it suits best, and its main weakness.
Sample Answer
Direct answer
Five Whys, fishbone (Ishikawa) diagrams, fault-tree analysis, and causal-chain or timeline analysis are all structured root-cause techniques, but they suit different incident shapes. Five Whys is fast and best for a single, mostly-linear chain of causation. Fishbone is best when you suspect several independent categories of cause (people, process, technology, environment) and want to brainstorm broadly before narrowing. Fault-tree analysis is best for complex, multi-path failures where you need to reason about combinations of conditions, not just one chain. Causal-chain or timeline analysis is best when the incident unfolded over a long period with many events, and reconstructing the sequence itself is most of the work.
Structured elaboration
- Five Whys. Strength: fast, requires no special tooling, good for straightforward incidents with a genuinely linear cause. Weakness: it forces a single narrative thread, so on an incident with multiple independent contributing factors it can stop at the first plausible-sounding chain and miss a second, unrelated gap that also mattered. Combining it with a causal-graph or fault-tree check on the resulting hypothesis (does this cause actually explain the full timeline, or just part of it) helps catch that failure mode.
- Fishbone (Ishikawa). Strength: structured brainstorming across categories (commonly people, process, technology, environment) surfaces candidates you might not think of starting from a single chain. Weakness: it's a divergent tool, good for generating hypotheses, but it doesn't by itself tell you which candidate cause is actually correct; you still need evidence to narrow down.
- Fault-tree analysis. Strength: models AND/OR combinations of conditions, so it's the right tool when the incident required several things to go wrong simultaneously (a database failover only failed because BOTH the standby was on an incompatible version AND the health check didn't catch the mismatch). Weakness: more effort and formalism than most incidents justify; overkill for a simple single-cause bug.
- Causal-chain or timeline analysis. Strength: best when the incident unfolded across many events over hours or days, and the real analytical work is establishing what happened when and in what order, which then makes the cause fairly evident once assembled. Weakness: doesn't add much analytical structure beyond reconstruction; you often still need Five Whys or fishbone on top of the assembled timeline to go from 'here's what happened' to 'here's why.'
Worked example
A multi-hour cascading outage across several services: causal-chain or timeline analysis is the right first tool, since the priority is establishing the sequence across services before anything else makes sense. A single service crashing on a specific malformed input: Five Whys is fast and sufficient. A database failover that should have worked but didn't: fault-tree analysis, since it likely required more than one condition (incompatible standby version AND a health check that didn't catch it) to align. A vague, hard-to-pin-down data-quality issue with no obvious single trigger: fishbone, to broadly brainstorm across categories (was it the data source, the pipeline code, a schema change, an environment difference) before narrowing with evidence.
Trade-offs and pitfalls
The most common mistake is defaulting to Five Whys for everything because it's the most familiar technique, even on incidents with multiple independent contributing factors where it will produce a tidy but incomplete story. Pick the technique to fit the shape of the incident, not out of habit, and don't hesitate to combine two (fishbone to generate candidates, then Five Whys or fault-tree to narrow and validate).
Runbooks and continuity documentation go stale fast once systems, teams, and org structure keep changing. How do you keep them accurate over time? Cover ownership, versioning, and how you'd catch drift before it matters during a real event rather than after.
Sample Answer
Direct answer. Ownership has to be a named role tied to the business function or system the runbook covers, not "whoever wrote it last," with versioning that ties each revision to a specific trigger, not just a date. Catching drift before a real event means testing the runbook during a planned exercise instead of discovering it's wrong while executing it under pressure, paired with a lightweight review trigger whenever something the runbook depends on changes.
1. Ownership
Assign a named owner to every runbook, ideally the person or role accountable for the business function or system it covers, not a shared team inbox and not necessarily the original author, who may move on. Ownership means being responsible for the runbook's accuracy, not personally executing every step during a real event. Make it visible on the document itself (name, role, last-reviewed date) so anyone opening it during an incident can see who to ask if something looks wrong, and so a stale "owner" who's left the organization is an obvious red flag rather than a hidden one. When ownership changes hands, require an explicit handoff with a fresh review as part of the transition, not a silent reassignment.
2. Versioning
Treat runbooks as controlled documents: every change gets a version number, a date, who made it, and why, kept in the document's own change history rather than relying on file metadata or institutional memory. Tie versions to triggers, not just a calendar. A scheduled review is a reasonable baseline, but the more reliable trigger is linking review to the events that actually make a runbook wrong: the system it depends on changes, the org structure around it changes, or a real exercise or incident surfaces a gap. A runbook untouched for eighteen months right after the system it describes was rebuilt is far more suspect than one reviewed on schedule six months ago. Keep prior versions accessible, not just the latest, so a post-event review can tell whether a gap that showed up was already known and fixed but hadn't propagated to whoever was executing, or was genuinely new.
3. Catching drift before it matters
The strongest mechanism is using the runbook for real, on a schedule, inside an exercise (a tabletop discussion or a functional exercise that actually executes some steps), before a live event forces the discovery. A runbook nobody has walked through since it was written is a hypothesis, not a tested procedure. Build a lightweight checklist step into whatever process generates the kind of change that breaks runbooks: when a system change, a supplier change, or an org change is being planned, that process flags which runbooks might be affected, so the review happens close to the change instead of being discovered much later. Track a simple staleness signal across the whole runbook set (time since last review, time since the system or team it covers last changed) and report on it the way you'd report any other risk metric, so an accumulating backlog of unreviewed runbooks is visible to whoever owns the continuity program overall, not discovered runbook by runbook.
Worked example
A payments-processing runbook is owned by the payments platform lead, currently at version 4: v2 added a fallback provider, v3 corrected an escalation contact list after a reorg, v4 followed a functional exercise that found the documented rollback step no longer matched how the system actually rolled back. Six months after v4, the team migrates the payments platform to new infrastructure as part of an unrelated project. Because "infrastructure migration for a system with an owned runbook" sits on that project's change-review checklist, the payments platform lead is flagged automatically and confirms the runbook needs an update before the migration ships, catching the drift as part of the planned change rather than during the next incident. At the next scheduled functional exercise three months later, the team walks through the updated runbook end to end and finds one further step, a monitoring dashboard link, still pointing at the decommissioned infrastructure. That becomes a logged finding and v5.
Trade-offs & pitfalls. A purely calendar-based review cadence catches drift too slowly for a fast-changing system and too often for a stable one; tying review to real change triggers is more work to set up but matches effort to actual risk. Ownership without accountability for staleness (a name on a document nobody ever checks) is barely better than no ownership; the staleness signal has to surface to someone, not just exist. And testing a runbook only during a real event is the worst possible time to discover it's wrong: the exercise programme is what lets a team find the gap on an ordinary afternoon instead of during an actual outage.
You're the incident commander for a severity-1 outage impacting multiple services. Describe how you would set up and run a war room (virtual or physical) during the first hour: required tools, role assignments, ground rules, prioritization method, and techniques to prevent information overload while keeping progress visible.
Sample Answer
The idea in plain words
A war room is the single place, a bridge (a shared voice or video call) plus a chat channel (or a physical room), where everyone working a major incident coordinates. A Sev1 is the top level on the common numbered severity scale (each organisation defines its own scale). The war room succeeds when three things hold: every person knows their role, one shared record shows the current state, and the volume of talk is controlled so that people doing the work are not drowned in people watching the work. As incident commander (IC) (the person who coordinates and makes the final calls) your first hour is about building that structure quickly, then protecting it.
Required tools
In the first ten minutes set up the first three rows (one chat channel, one bridge, the shared timeline document) and name the roles; the other rows follow as people arrive, within roughly the first half hour.
| Need | What it is for | Rule of use |
|---|---|---|
| One chat channel | Written record of the response | The only channel for decisions and changes; alerts go to a separate channel |
| One voice or video bridge | Fast discussion | Muted by default; stream leads (one lead per group of related services, defined under roles) and the IC speak |
| Shared timeline document | Source of truth: timeline, decisions, actions, who is in which role | Edited by the scribe; read by everyone |
| Dashboards on one board | The same graphs for everyone: the customer-impact metric first | Pinned link, so people stop sharing screenshots |
| Action tracker | Each open action with one owner and a status | Reviewed at every check-in |
| Status page or messaging tool | Customer and stakeholder updates | Used only by the communications lead |
| Paging tool (sends an alert to an on-call person's phone) and contact list | Bringing in specialists and vendors | Used by the escalation liaison |
Role assignments
IC, technical lead (directs the diagnosis), communications lead (owns all outward messages), scribe (keeps the timeline) and an escalation liaison (brings in other teams, vendors, executives). With a multi-service outage add stream leads, one per group of related services. Legal and public relations (PR) get a liaison who is kept informed and reviews wording for anything external, but who does not sit on the technical bridge.
Ground rules
The opening message states rules 1 to 3, which prevent the worst damage; the others are reinforced as the room fills.
- One conversation: the channel is the record; side threads are summarised back.
- Announce before you change: "I am restarting the cache cluster at 14:12" with the owner's name; the scribe logs the time.
- Nothing changes without an owner and an expected effect.
- Muted by default; speak only for a finding, a blocker or a decision.
- No blame and no root-cause debate during the incident.
- Every question from outside goes to the communications lead.
Prioritisation method
For a multi-service outage, first look for a shared cause: if several services depend on one component (authentication, a database, the network), fixing that component comes first because it helps all of them. If the services are truly independent, rank the work streams by customer impact restored per minute of effort: users affected divided by estimated minutes to mitigate. The estimates are guesses by the stream leads, so treat the ranking as a tie-breaker.
Hypothetical example with assumed numbers:
| Service | Users blocked (assumed) | Estimated minutes to mitigate | Users restored per minute |
|---|---|---|---|
| Checkout | 40,000 | 8 | 40,000 / 8 = 5,000 |
| Login | 120,000 | 30 | 120,000 / 30 = 4,000 |
| Reports | 5,000 | 5 | 5,000 / 5 = 1,000 |
Order: checkout, login, reports. If the logs show checkout depends on login, login moves to first, because its repair also restores checkout.
Preventing overload while keeping progress visible
- A pinned state-of-the-incident message re-posted by the scribe every 15 minutes: impact now, leading hypothesis, actions in flight with owners, next decision, next update time. A latecomer reads one message, not 400 lines.
- Breakout channels (smaller side channels, one per work stream) so detail stays with the three people who need it; stream leads report to the technical lead every 10 minutes.
- One action list with a count anyone can read: for example 7 actions in total: 3 done, 2 in progress and 2 not started (3 + 2 + 2 = 7), so 4 are still open. Progress is visible as numbers without a meeting.
- Observers have a read-only view and one summary a stakeholder-facing person owns.
- Action capture until closure: every action created in the room goes on the list with an owner and a due time, and stays until it is done or consciously dropped.
Stakeholders, legal and PR, and the end of the incident
Status cadence: the communications lead sends an update at a fixed rhythm (for example every 30 minutes) with impact, what we know, what we are doing and the next update time. Legal and PR see drafts of anything external before it goes out, on a short time limit so review does not stall updates.
Resolved means: the customer-impact metric has stayed at its normal level for a set hold period (for example 30 minutes), every temporary mitigation has an owner and a removal date, the open action list holds no urgent item, and a final message has been sent. The IC says "resolved" explicitly in the channel.
A data or business-intelligence outage
Suppose the warehouse feeding finance and sales dashboards is down at month end. Nothing customer-facing is broken, but the business may make decisions on stale numbers. The same war room works with different stakeholders: finance needs to know which tables are stale and the as-of time of each number; sales needs to know whether the pipeline report can be trusted for a forecast call. The prioritisation changes from users blocked to deadlines: the finance close date outranks a sales report, and the communications lead publishes "data is current as of 06:00" rather than "service is up". The as-of time is the moment a number was last refreshed from its source, so readers know how stale it is. The ground rules and roles stay the same.
Common mistakes
- Several channels and several documents, so the record fragments.
- Executives on the technical bridge asking for status.
- Treating the prioritisation estimate as exact.
- Closing the incident when the graph looks good, before the hold period.
How do you decide that a task should not be automated? Walk through the framework you would use, and how you would hold that line, or offer a middle path, when a sponsor insists.
Sample Answer
The idea in plain words
Automation is not free: it has a build cost, an ongoing maintenance cost, and a risk that it will do the wrong thing faster than a person would. "Should not be automated" means the expected benefit is smaller than those costs, or the task needs human judgment, or a rule requires a person, or the best move is to remove the task rather than speed it up. The skill is to run a short, ordered set of questions, write down the answers with numbers, and be ready to offer something useful when the answer is "not yet" or "not all of it".
The framework, in the order I would apply it
- Eliminate or simplify first. Why does this task exist? Is the report read by anyone? Is an approval step ever refused? Can the upstream cause be fixed so the task disappears? Removing a step costs nothing to maintain, and automating a pointless step makes the waste permanent. Simplifying a process often captures most of the benefit for a fraction of the cost.
- Volatility of the process. How often do the steps, the systems or the policy change? A process that is redesigned every few months will break the automation each time, and the maintenance cost swallows the savings. Stable and repetitive is good; unstable is a warning.
- Frequency and size of the saving. Hours saved per year = occurrences per year x minutes per occurrence / 60. Low frequency means a small prize.
- Break-even including maintenance. Net hours saved per year = hours saved per year - maintenance hours per year. Payback in years = build hours / net hours saved per year. If the net is zero or negative, the automation never pays back. Ignoring maintenance overstates the payoff.
- Potential for harm. What happens if it does the wrong thing at full speed? Consider blast radius (how much it can touch if it goes wrong, for example one customer or every customer), reversibility (can you undo it) and detectability (how soon would you notice). High harm and low reversibility argue for a human in the loop (a person who reviews or approves the action before it takes effect).
- Regulatory and policy constraints. Some processes require a named person to review or approve, or require separation of duties (the person who requests or prepares an action may not be the one who approves it, so no single person, or single program, can carry out a risky step alone). Check with the compliance owner. Where a rule demands a human decision, you can still automate the preparation around it, but not remove the decision.
- Judgment and exceptions. If most cases need a person to interpret context, a rule-based automation will either escalate constantly or decide badly.
If a task fails questions 1, 2, 4, 5 or 6, I would not automate it end to end. Failing question 3 alone means it is simply not a priority.
Worked example (assumed numbers)
The sponsor is the senior person who asked for the automation and owns the budget or the outcome. Case A, a rare exception process. A procurement team handles contract-renewal exceptions 6 times a year at 90 minutes each. Hours saved per year = 6 x 90 / 60 = 9 hours. An automation would cost 80 hours to build and 25 hours per year to maintain, because the contract rules change often. Net = 9 - 25 = -16 hours per year. It never pays back, and the maintenance alone exceeds the work it replaces. Decision: do not automate; write a checklist.
Case B, a weekly task with a short shelf life. A weekly reconciliation takes 30 minutes: 52 x 30 / 60 = 26 hours per year. Assume a full automation costs 40 hours and 10 hours per year to maintain: net 26 - 10 = 16 hours per year, payback 40 / 16 = 2.5 years. Assume the process is redesigned about once a year. The automation would be rebuilt before it paid back: after one year the total is 16 - 40 = -24 hours. Decision: do not build the full version.
Middle path for Case B. Automate only the data-gathering step, which is about 40% of the effort (to estimate such a share, time each step once or twice: if gathering the data takes 12 of the 30 minutes, that is 12 / 30 = 40%): 26 x 0.4 = 10.4 hours per year saved. Assume 8 hours to build and 2 hours per year to maintain: net 10.4 - 2 = 8.4 hours per year, payback 8 / 8.4 = 0.95 years (about 11 months). Because it is a small, simple piece, it also survives a redesign better. The checking and the sign-off stay with a person.
Holding the line when a sponsor insists
- Ask what outcome they want. "Automate this" usually stands for "stop wasting the team's time", "reduce errors" or "show we are modern". Those outcomes may have cheaper routes.
- Show the numbers, not an opinion. Put the break-even table in front of them, with maintenance and the volatility assumption stated, and invite them to challenge the inputs. If their inputs differ (more volume, a stable process), the answer may genuinely change. For Case B it could look like this (the figures are the ones worked above):
| Option | Build (hours) | Maintenance (hours/year) | Saved (hours/year) | Net (hours/year) | Payback |
|---|---|---|---|---|---|
| Full automation | 40 | 10 | 26.0 | 16.0 | 2.5 years, but the process is redesigned yearly, so it is rebuilt first |
| Automate data-gathering only | 8 | 2 | 10.4 | 8.4 | 0.95 years |
| Checklist, no automation | 0 | 0 | 0 | 0 | not applicable |
And in words: "I would like this to work for you, so here is what I found. The full build does not pay back before the process changes. The small piece does, in about 11 months. What would change your mind, and do these inputs look right to you?"
3. Offer options. A checklist or template now; automation of the single stable step; a time-boxed pilot of two to four weeks with a stop rule; or the full build with the maintenance budget named and signed by the sponsor.
4. Agree a revisit trigger (a stated condition that reopens the decision, so "no" means "not yet"). For example: reconsider if volume exceeds 3 times the current level, or if the process has not changed for two quarters, or if an error causes a loss above an agreed size.
5. Record the decision with date, inputs, owner and trigger, so the debate does not restart from zero.
6. Know when to defer. If the sponsor accepts the maintenance cost with eyes open and the risk is bounded, the decision is theirs. If the harm or the rule question is real, escalate to the risk or compliance owner rather than yielding.
Judgment
I would say no to end-to-end automation in Case A and Case B, yes to the small stable piece of Case B, and I would put the decision and the revisit trigger in writing. What would flip it: a tenfold rise in volume, a stable process, or an automation that removes a human error risk with a real cost (the harm test can argue for automation too).
Common mistakes
- Treating "no" as the end of the conversation instead of offering a smaller step.
- Quoting break-even without maintenance.
- Automating an approval that nobody reads rather than questioning why it exists.
- Refusing on principle without numbers, which sounds like resistance.
- Forgetting that the case for automation can strengthen later, and not setting a trigger to look again.
Before a Terraform or CloudFormation change ever reaches apply, what automated checks would you want running in the pipeline, and at what stage would each one run? Talk through what kind of mistake each check is actually meant to catch.
Sample Answer
Direct answer
Run checks in a layered pipeline ordered from cheapest to most expensive: format and lint first (seconds, no cloud access), then static policy/security scanning against the plan or template (still no cloud access), then anything that actually stands up real resources (integration tests, plan review with real credentials), and finally post-deploy verification against the live environment. Each layer is designed to catch a different class of mistake, and putting the cheap checks first means a typo never has to wait for an expensive real-resource test to fail.
The two fundamentally different kinds of check
Before mapping tools to stages, it's worth naming the split explicitly: some checks are fast, syntax- or policy-level, and need no cloud access at all; others genuinely stand up real (usually short-lived) infrastructure to prove it actually works. Confusing the two, or skipping straight to the expensive kind, is the most common mistake in a pipeline like this.
| Stage | Check | What mistake it catches | Provisions real resources? |
|---|---|---|---|
| Pre-commit / local | terraform fmt, cfn-lint, ansible-lint | Style drift, malformed syntax, obviously invalid template schema | No |
| CI: fast lint | terraform fmt -check, tflint | Provider-specific misuse, deprecated arguments, obvious logic errors | No |
| CI: static policy/security | checkov, cfn_nag, OPA/Sentinel against the plan JSON | Security misconfiguration (public S3 bucket, overly broad IAM), missing required tags, policy violations | No, reads the plan or template, never calls the cloud provider to create anything |
| CI: unit tests | Module output assertions, template rendering tests | Wrong variable defaults, broken output wiring, logic bugs in the module itself | No |
| CI: plan review and gating | terraform plan posted to the PR, human or automated diff review | Unexpected destroy/replace actions before they ever reach a real environment | No, it's a dry run |
| CI: integration tests | Terratest, Molecule against a container or real cloud instance | Whether the resource actually gets created correctly, whether runtime configuration is right, whether the API actually accepts what you declared | Yes, real (usually ephemeral) resources |
| Post-deploy | Smoke tests, health checks against the deployed environment | Whether the deployed service is actually reachable and healthy in this specific environment | Yes, against the live environment |
Worked example: a pipeline definition
jobs:
fmt-and-lint:
steps:
- run: terraform fmt -check -recursive
- run: tflint
policy-scan:
needs: fmt-and-lint
steps:
- run: checkov -d . --framework terraform
plan:
needs: policy-scan
steps:
- run: terraform plan -out=plan.tfplan
- run: terraform show -json plan.tfplan > plan.json
# a script here fails the job if plan.json contains an unreviewed delete/replace
integration-test:
needs: plan
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- run: go test ./test/... -run TestModule -timeout 30m
# this job is the one that actually provisions and tears down real infra
apply:
needs: integration-test
environment: production # requires manual approval
steps:
- run: terraform apply plan.tfplan
The ordering matters: fmt-and-lint and policy-scan run on every commit because they're free and fast; integration-test, which provisions real infrastructure, is scoped to run only on merges to main, not on every push to a feature branch, to bound cost and time.
Trade-offs and pitfalls
- Skipping straight to integration tests (or relying on them to catch what a linter would have caught in seconds) is slow and expensive for no extra safety, put the cheap checks first and let them fail fast.
- Running the real-resource layer on every commit, rather than on merge or nightly, is the single most common way teams accidentally burn cloud spend on a testing pipeline.
- Static policy scanning only catches what it has rules for; it gives false confidence if the rule set isn't kept current with new resource types the team starts using.
- A plan-review gate that only a human reads doesn't scale, encode the "never allow an unreviewed delete on a protected resource" rule as an automated check on the plan JSON, not just a habit.
Create a cost-optimized capacity plan for an online retailer expecting unpredictable traffic spikes like Black Friday. What mix of provisioning strategies, caching, and testing would you use to control cost without risking availability, what are the cost versus risk trade-offs of the choices you'd make, and what would your operational runbook for handling a live surge look like?
Sample Answer
Framing
Black Friday is a known date with an unpredictable magnitude: you know exactly when the spike hits, but not precisely how large it will be. The plan needs to control cost the rest of the year while accepting that availability risk on this single day is far more expensive than a comparable amount of unused capacity.
Provisioning mix
Keep the normal reserved or committed baseline sized to ordinary daily traffic year-round, that part of the cost model does not change for one event. Ahead of the event, manually pre-scale a known-event buffer rather than trusting reactive autoscaling alone: a 10 to 50 times traffic multiplier can outpace autoscaler reaction time, cold-start latency, and the capacity limits of dependent services (database connection limits, payment gateway throughput) faster than a purely reactive system can respond. Layer on-demand and spot autoscaling above that pre-scaled floor for the unpredictable tail, keeping spot capacity restricted to stateless, safely-retryable tiers only, never the checkout or payment path, where a preemption mid-transaction is unacceptable.
Caching
Static and catalog content (product pages, listings, images) typically dominates request volume during a shopping spike far more than checkout does, so push it aggressively to the CDN edge. Use short-TTL, stale-while-revalidate caching for semi-dynamic content like stock badges, so a slightly stale "in stock" flag is an acceptable trade for not hitting the origin on every page view. Cache expensive read paths (inventory counts, computed pricing) in an application-level cache to keep origin database load roughly flat even as total request volume spikes.
Testing
Load test at 1.5 to 2 times your worst-case forecast, not just the expected case, well before the event, and test the FULL dependent chain, not just your own service: a payment gateway sandbox, the inventory service, database connection limits under sustained concurrency. Run a soak test over a sustained multi-hour window, not just a short burst, to catch memory leaks and connection-pool exhaustion that only appear under prolonged load. Run a deliberate failure exercise, simulating the loss of one availability zone or region during a simulated peak, to confirm failover actually holds up under real load, not just under idle conditions where every test usually happens.
Cost versus risk trade-offs
Pre-provisioning ahead of the event costs real money for capacity that may sit partly unused if the actual spike undershoots the forecast. Under-provisioning risks lost sales during the single highest-revenue day of the year, where lost sales plus reputational damage from an outage on THAT day vastly outweigh the cost of some idle pre-scaled capacity. The risk-adjusted answer is to deliberately over-provision the floor for this one event, even though the same choice would be wasteful as a year-round default.
Operational runbook for a live surge
- Predefined escalation thresholds mapped to predefined actions, for example if p99 latency exceeds twice normal for 5 minutes, manually trigger the pre-approved emergency scale-out template rather than waiting on the reactive autoscaler alone.
- A feature-flag kill switch to shed non-critical functionality (recommendation widgets, reviews, non-essential background jobs) under load, protecting the core browse-to-purchase path first.
- A named on-call and escalation chain for the event window specifically, with clear ownership of the decision to invoke each runbook step, so no one is improvising a decision tree live.
- A deploy freeze for the event window, with a documented, pre-approved emergency-change process as the only exception, so a routine deploy is never the thing that destabilizes the system during the surge.
Write a concise Go CLI program that accepts three inputs: (1) a JSON array of build inputs (file paths + SHA256), (2) a JSON array of outputs (file paths + SHA256), and (3) a PEM-format private key file path. The program should produce a JSON provenance attestation containing inputs, outputs, timestamp, builder ID (from BUILDER_ID env var), and a base64 signature field signing the attestation. Use only Go standard library packages. Include comments to explain deterministic JSON serialization choices.
Sample Answer
A provenance attestation is fundamentally a signed statement, so the implementation has two halves that both have to be exactly right: building a deterministic payload to sign, and signing it in a way a verifier can independently reproduce and check.
package main
import (
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"crypto/x509"
"encoding/base64"
"encoding/json"
"encoding/pem"
"fmt"
"os"
"time"
)
type FileDigest struct {
Path string `json:"path"`
Sha256 string `json:"sha256"`
}
// Field order is fixed by the struct definition, which is what makes
// json.Marshal deterministic for this payload: the same logical content
// always produces the same bytes to sign and to re-verify against.
type Attestation struct {
Inputs []FileDigest `json:"inputs"`
Outputs []FileDigest `json:"outputs"`
Timestamp string `json:"timestamp"`
BuilderID string `json:"builderId"`
Signature string `json:"signature"`
}
func signPayload(payload []byte, priv *rsa.PrivateKey) (string, error) {
digest := sha256.Sum256(payload)
sig, err := rsa.SignPKCS1v15(rand.Reader, priv, crypto.SHA256, digest[:])
if err != nil {
return "", fmt.Errorf("signing attestation payload: %w", err)
}
return base64.StdEncoding.EncodeToString(sig), nil
}
func loadPrivateKey(pemPath string) (*rsa.PrivateKey, error) {
data, err := os.ReadFile(pemPath)
if err != nil {
return nil, fmt.Errorf("reading key file: %w", err)
}
block, _ := pem.Decode(data)
if block == nil {
return nil, fmt.Errorf("no PEM block found in %s", pemPath)
}
key, err := x509.ParsePKCS1PrivateKey(block.Bytes)
if err != nil {
return nil, fmt.Errorf("parsing private key: %w", err)
}
return key, nil
}
func buildAttestation(inputsPath, outputsPath, keyPath string) (*Attestation, error) {
inputsRaw, err := os.ReadFile(inputsPath)
if err != nil {
return nil, fmt.Errorf("reading inputs file: %w", err)
}
var inputs []FileDigest
if err := json.Unmarshal(inputsRaw, &inputs); err != nil {
return nil, fmt.Errorf("parsing inputs JSON: %w", err)
}
outputsRaw, err := os.ReadFile(outputsPath)
if err != nil {
return nil, fmt.Errorf("reading outputs file: %w", err)
}
var outputs []FileDigest
if err := json.Unmarshal(outputsRaw, &outputs); err != nil {
return nil, fmt.Errorf("parsing outputs JSON: %w", err)
}
builderID := os.Getenv("BUILDER_ID")
if builderID == "" {
return nil, fmt.Errorf("BUILDER_ID environment variable is not set")
}
priv, err := loadPrivateKey(keyPath)
if err != nil {
return nil, err
}
unsigned := Attestation{
Inputs: inputs,
Outputs: outputs,
Timestamp: time.Now().UTC().Format(time.RFC3339),
BuilderID: builderID,
}
payload, err := json.Marshal(unsigned)
if err != nil {
return nil, fmt.Errorf("canonicalizing payload: %w", err)
}
sig, err := signPayload(payload, priv)
if err != nil {
return nil, err
}
unsigned.Signature = sig
return &unsigned, nil
}
func main() {
if len(os.Args) != 4 {
fmt.Fprintln(os.Stderr, "usage: provenance <inputs.json> <outputs.json> <private_key.pem>")
os.Exit(2)
}
att, err := buildAttestation(os.Args[1], os.Args[2], os.Args[3])
if err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
out, _ := json.MarshalIndent(att, "", " ")
fmt.Println(string(out))
}
Deterministic JSON serialization
The struct's field order is fixed at compile time by its definition, so json.Marshal always emits fields in the same order for the same logical content; this is why the payload is built as a typed Attestation struct rather than a map[string]interface{}, since Go's JSON encoding of a map sorts keys alphabetically by default but a struct preserves declaration order, either of which is deterministic on its own, but mixing the two within one payload risks a verifier reconstructing a different byte layout than the signer used. The signature field itself is excluded from the signed payload (set to empty string, or omitted, at signing time) since the signature obviously can't be part of what it's signing over.
Verified
Compiled with go build. Generated a real RSA keypair with OpenSSL, ran the program to produce a signed attestation, then wrote an independent Go verifier that re-reads the attestation, strips the signature field, re-marshals the remaining struct exactly as the signer did, and calls rsa.VerifyPKCS1v15 against the public key: verification succeeded. A tamper test, flipping one character in an input's SHA-256 digest and re-running verification, correctly failed with a signature-mismatch error, confirming the scheme actually detects tampering rather than passing regardless of content.
Trade-offs
Using PKCS1v15 padding and a single RSA key here is simple and fully supported by the Go standard library alone (no external dependency), matching the question's constraint; a production system would more likely use Sigstore's keyless signing (short-lived, OIDC (OpenID Connect)-backed certificates) to avoid the operational burden of protecting a long-lived private key file: that file has to be generated once and then protected for its entire lifetime, encrypted at rest, access-restricted, rotated on a schedule, and revoked immediately if it is ever exposed, and if it does leak, whoever holds it can forge valid attestations indefinitely, or at least until the leak is discovered and the key revoked, with no built-in record of who actually produced a given signature. Keyless signing removes that persisted secret entirely: at sign time the CI runner exchanges a short-lived OIDC token (proof that this exact signing request came from this exact workflow run) for a certificate from a public certificate authority (Sigstore's Fulcio), signs with an ephemeral key that is discarded the moment signing completes, and records the signature alongside the certificate and a transparency-log entry (Rekor) that anyone can later audit. There is no long-lived key file to steal, back up, or rotate, at the cost of depending on the OIDC identity provider and Sigstore's infrastructure being reachable at sign time. Container image signing, discussed separately in this topic, makes the identical trade-off: a persisted key you must guard forever versus an ephemeral, OIDC-backed identity with nothing to steal.
Recommended Additional Resources
- The Site Reliability Workbook (Google) - Practical guide to implementing SRE principles
- Designing Data-Intensive Applications by Martin Kleppmann - Essential for understanding distributed systems
- Learning Modern Linux by Michael Hausenblas - Foundation for systems administration knowledge
- Google Cloud Platform SRE fundamentals course - Free cloud infrastructure and reliability concepts
- Kubernetes official documentation - Essential for container orchestration understanding
- Prometheus documentation and tutorials - Hands-on monitoring and metrics collection
- Grafana dashboarding best practices - Practical observability visualization
- SANS SRE fundamentals guide - Comprehensive overview of SRE practices
- Meta engineering blog (engineering.fb.com) - Insights into Meta's infrastructure challenges
- Incident.io and Postmortem Culture resources - Learning from post-incident processes
- LeetCode system design questions - Practice designing systems for reliability and scale
- YouTube: 'Top 25 SRE Interview Questions and Answers for 2025' - Comprehensive SRE concept review
- Blind and Levels.fyi SRE community discussions - Real candidate experiences and tips
Search Results
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 Engineering Mock Interviews (for Google, Meta ...
Practice mock interviews with an SRE interview expert. Get clear, honest feedback and learn exactly how top companies expect you to answer.
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