DoorDash Site Reliability Engineer (Junior Level) - Comprehensive Interview Preparation Guide
DoorDash's Site Reliability Engineer interview process for junior-level candidates combines technical depth with operational expertise and cultural alignment. The interview assesses foundational systems knowledge, ability to troubleshoot production issues, understanding of reliability principles, and compatibility with DoorDash's engineering culture. Candidates progress through a recruiter screen, technical phone interview, and four on-site rounds covering system design, operational incident response, technical tooling, and behavioral competencies. The process emphasizes practical problem-solving, hands-on debugging skills, collaboration with engineering teams, and learning ability. Given DoorDash's focus on real-time logistics at massive scale, expect scenarios involving order tracking, delivery coordination, and reliability under high concurrency.
Interview Rounds
Recruiter Screening
What to Expect
Initial conversation with DoorDash recruiter to validate background, assess career motivation, and determine cultural fit before investing time in technical rounds. The recruiter will review your resume, discuss your interest in Site Reliability Engineering, clarify the role expectations and interview process, and address logistical questions. This is a soft conversation designed to ensure mutual interest before technical evaluation begins.
Tips & Advice
Be genuine and conversational—recruiters value authenticity over scripted responses. Prepare 2-3 specific reasons why you're pursuing SRE (e.g., interest in distributed systems, operational challenges, building things that last) and why DoorDash appeals to you. If possible, mention their logistics focus, real-time systems, or scale challenges as differentiators. Have 2-3 thoughtful questions ready about the role, team structure, on-call expectations, and what success looks like in the first 6 months. Don't oversell—recruiters want to ensure you're genuinely interested, not just chasing a title. Mention any relevant coursework, personal projects, or hands-on experience with systems work.
Focus Topics
Scale & Operational Complexity Awareness
Demonstrate understanding that DoorDash operates at significant scale: millions of orders daily, real-time coordination across geographic regions, handling meal-time traffic spikes, managing reliability across multiple services. Mention challenges like 'maintaining accuracy when tracking thousands of concurrent deliveries' or 'handling unexpected traffic surges without service degradation.'
Practice Interview
Study Questions
DoorDash-Specific Interest & Domain Knowledge
Demonstrate knowledge of DoorDash's business model and technical challenges: real-time order placement, millions of daily deliveries, coordinating between customers, merchants, and dashers, operating reliably across multiple cities. Connect your interest to their specific challenges—for example, 'I'm interested in real-time systems; DoorDash's delivery tracking is a compelling example of managing state across distributed endpoints.'
Practice Interview
Study Questions
Relevant Experience Overview
Concisely summarize relevant work experience, internships, or projects: systems administration, incident response, monitoring/observability, automation, or operational work. For junior level, even limited exposure matters. Highlight what you learned—for example, 'I deployed applications to Linux servers and learned to troubleshoot deployment failures,' or 'I wrote monitoring dashboards and discovered how observability helps diagnose issues.'
Practice Interview
Study Questions
Career Motivation & SRE Interest
Articulate why you're pursuing Site Reliability Engineering as a career, not just taking a job. Discuss what aspects of SRE appeal to you: managing systems at scale, solving real-time operational challenges, balancing multiple priorities, learning how complex systems work, or the on-call responsibility. Connect this to relevant experiences—perhaps a class project involving distributed systems, a bug you debugged that fascinated you, or a system outage you observed and thought about how to prevent.
Practice Interview
Study Questions
Technical Phone Screen - Systems Fundamentals & Debugging Methodology
What to Expect
Technical conversation assessing systems knowledge, debugging methodology, and practical SRE mindset. You may receive a scenario describing a production issue (slow order processing, deployment failure, service crash, or delivery tracking inaccuracy) and asked to diagnose and solve it. Alternatively, direct questions about Linux, networking, monitoring concepts, or how systems work. This round evaluates both foundational knowledge and your systematic approach to problem-solving. The goal is understanding how you think through complex problems methodically and whether you have the knowledge foundation expected of junior SREs.
Tips & Advice
For scenario-based questions, start with clarifying questions: what's the user impact? When did it start? What changed recently? What metrics look abnormal? Structure your debugging: gather information, form hypotheses, test them systematically, explain each step aloud. Don't pretend to know something you don't—instead describe how you'd investigate. Prepare concrete examples from your experience (even small ones: 'I debugged a script that was hanging by checking process status,' or 'I identified high latency by looking at network vs application metrics'). Have solid fundamentals in Linux tools (ps, top, netstat, curl, grep, logs), basic networking (DNS, TCP/IP, ports), and monitoring concepts. Use the language of SRE: SLOs, error budgets, incident classification, observability, graceful degradation. If questioned about something unfamiliar, explain what you'd learn and how.
Focus Topics
Monitoring, Metrics, Logs & Observability Foundations
Understand the three pillars: metrics (time-series data: latency, throughput, errors, CPU), logs (detailed events), traces (request flow across services). Know how monitoring systems work: agents collect data, time-series databases store metrics, dashboards visualize, alerts trigger on thresholds. Discuss Service Level Objectives (SLOs) and Service Level Agreements (SLAs): what metrics matter (availability, latency, error rate), how to define SLOs (e.g., '99.9% of orders placed within 2 seconds'), and error budgets. Familiarity with tools: Prometheus (metrics), Grafana (dashboards), ELK/Splunk (logs), Datadog (unified platform).
Practice Interview
Study Questions
Basic Performance Optimization & Bottleneck Analysis
Understand common bottlenecks: CPU (CPU-bound code, context switching), memory (leaks, excessive allocation), disk I/O (slow storage, excessive writes), network I/O (slow services, high latency). Know how to profile and measure: use top/htop to watch resource usage, analyze logs for slow queries, check network latency to dependent services. Discuss optimization strategies: caching (Redis, in-memory), connection pooling, rate limiting, load balancing, async processing.
Practice Interview
Study Questions
Incident Response Methodology & Communication
Understand SRE incident response: detection (monitoring alerts), triage (severity classification: P1 is service down, P2 is degraded), mitigation (stop the bleeding quickly), resolution (permanent fix), post-mortem (learning). Discuss communication during incidents: who to escalate to, how to update stakeholders, importance of clear status. Understand blameless post-mortems: focus on systemic issues and prevention, not individual blame. Show comfort with the idea that incidents are learning opportunities.
Practice Interview
Study Questions
Networking Fundamentals & Troubleshooting
Understand OSI model layers, TCP/IP, DNS resolution, HTTP/HTTPS, ports and firewalls, sockets and connections. Know diagnostic tools: ping/traceroute (network path), dig/nslookup (DNS), netstat/ss (connections), tcpdump (packet capture), curl (HTTP testing), telnet (port connectivity). Understand common issues: DNS failures, connection timeouts, firewall blocks, routing problems. For DoorDash context: understand how microservices communicate, what happens when a service is unreachable, latency from geographic distance.
Practice Interview
Study Questions
Linux & Unix System Fundamentals
Core competency including file system navigation, processes and signals, permissions, user management, system calls, kernel basics. Master essential commands: ps/pgrep (process inspection), top/htop (resource monitoring), netstat/ss (network connections), lsof (open files), kill/pkill (process management), find/grep/awk/sed (text processing), systemctl/service (system services), journalctl/tail (log inspection). Understand how to read system state, diagnose hanging processes, identify resource bottlenecks.
Practice Interview
Study Questions
Production Issue Troubleshooting Using STAR Method
Structure incident responses clearly: Situation (what was the issue, business impact, scale), Task (your specific responsibility), Action (concrete steps you took to diagnose and resolve—be specific about commands, tools, reasoning), Result (outcome, resolution time, what you learned). Practice on realistic scenarios: high latency in order processing, service crash causing order placement failure, deployment breaking delivery tracking, database connections exhausted, memory leak causing cascading failures.
Practice Interview
Study Questions
System Design Interview - Real-Time Reliability Architecture
What to Expect
Detailed system design discussion focused on building reliable, scalable systems relevant to DoorDash's domain and SRE concerns. You may be asked to design a real-time order tracking system, a monitoring and alerting architecture, a deployment pipeline, a system handling geographic distribution, or a service design that gracefully handles failures. Unlike pure software engineering system design, SRE system design emphasizes operational concerns: monitoring hooks built into systems, graceful degradation, incident detection and recovery, failure modes and mitigation strategies, trade-offs between consistency/availability/performance, and runbook automation. Interviewers assess your ability to think about systems holistically: not just 'does it work' but 'can we operate it reliably, diagnose problems, and scale it'.
Tips & Advice
Begin with clear scoping: ask about scale (transactions per second, concurrent users, geographic distribution), consistency requirements (strong or eventual), SLA/SLO targets, and failure modes. Explicitly discuss trade-offs—don't shy away from difficult decisions. Emphasize operational aspects: How will you detect issues early? What metrics matter? How will the system degrade gracefully? What information does an on-call engineer need? Draw clear diagrams showing components and data flow. For DoorDash scenarios, think about real-time state (order status: new→accepted→preparing→picked up→delivered, dasher location, ETA) and how to maintain reliability as the system scales across cities. Use industry-standard components but justify choices: Why this database over that one? Why message queue vs synchronous calls? Be comfortable saying 'I don't know' and 'I'd need to research that,' but explain your reasoning process. From DoorDash's interview materials, they specifically evaluate: modeling time-sensitive state machines, making trade-offs between consistency/freshness/responsiveness, designing for graceful degradation. Show you understand these priorities.
Focus Topics
Load Balancing, Scaling & Peak Demand Handling
Design systems handling traffic spikes: meal times (predictable), promotions or events (sudden). Understand horizontal scaling (add more servers), vertical scaling (bigger server), auto-scaling based on metrics. Discuss load balancing algorithms: round-robin, least-connections, least-loaded. Design for peak capacity: if peak is 10x average, do you provision for 10x or use burst capacity? What's the cost? Graceful degradation under extreme load: drop non-critical features, prioritize critical transactions.
Practice Interview
Study Questions
Deployment Safety & Rollback Mechanisms
Design deployment processes minimizing risk and enabling quick recovery. Understand blue-green deployments (run two versions, switch instantly), canary releases (roll out to small percentage, validate), feature flags (enable/disable features without deployment). Discuss detecting issues during deployment (metrics, customer reports) and rolling back quickly. For stateful systems (databases, order state), discuss migration strategies that don't lose data. Think about dependencies: if service A depends on service B, how do you safely update B?
Practice Interview
Study Questions
Real-Time State Machine Design & Order Processing
Design systems with clear state transitions; for DoorDash, order lifecycle: new → accepted → preparing → picked up → delivered → completed, or alternative: cancelled, rejected. Handle edge cases: order cancellation mid-delivery, dasher going offline, merchant unable to prepare, delivery taking longer than estimated. Ensure idempotency (handling duplicate requests safely), recovery from partial failures (what if payment succeeded but order storage failed?), and exactly-once semantics where critical. From DoorDash's stated priorities: 'modeling time-sensitive state machines' is a key evaluation criterion.
Practice Interview
Study Questions
Monitoring & Observability Architecture for Systems
Design observability into systems from the start. Define what to measure: order placement latency percentiles (p50, p99), order success rate, delivery on-time rate, dasher availability, merchant response time. Design alerting that catches real problems (high latency) while minimizing false positives (alert only when p99 latency > 10s, not every spike). Connect alerts to runbooks: when alert fires, on-call engineer should have a playbook to investigate. Consider different customer types: restaurants, dashers, customers—different SLOs for each.
Practice Interview
Study Questions
Graceful Degradation & Failure Mode Design
Design systems to function (degraded but not broken) when components fail. Understand circuit breakers (stop calling failing service, fail fast), bulkheads (isolate failures), fallbacks (use cached data or simplified logic), timeouts (don't hang waiting for dead service). Design so payment processing failure doesn't block order creation, or so a slow recommendation service doesn't slow order placement. DoorDash specifically values 'design for graceful degradation under unreliable networks.'
Practice Interview
Study Questions
Distributed System Design Fundamentals & Trade-offs
Understand CAP theorem constraints (consistency, availability, partition tolerance) and real-world implications. Know consistency models: strong (immediate), eventual (delayed synchronization), causal. Understand replication strategies for reliability: active-passive, active-active, quorum-based. Discuss Byzantine fault tolerance conceptually. Understand failure modes: network partitions, cascading failures, Byzantine failures, timeout handling. Know trade-offs: consistency vs availability/latency, replication overhead, consistency delay.
Practice Interview
Study Questions
Operational & Incident Response Deep Dive
What to Expect
Focused on operational excellence and incident response capability. Interviewers present realistic production scenarios and evaluate how you'd respond: service crashes, performance degradation, deployment failures, data inconsistencies, geographic outages. Scenarios are DoorDash-relevant (order processing failures, delivery tracking inaccuracies, dasher app issues, payment processing delays). Questions emphasize diagnostic methodology, decision-making under pressure, communication with stakeholders and other teams, and systematic approaches to resolution. Evaluators assess your readiness to handle on-call responsibilities, stay calm under pressure, and contribute to reliability improvements.
Tips & Advice
Use STAR method consistently for all incident scenarios: Situation (what happened, timeline, impact), Task (your specific responsibility), Action (concrete diagnostic steps you took, tools used, people involved), Result (resolution time, lessons learned). When given a scenario, ask clarifying questions first: How many users affected? When did it start? What changed? Then walk through investigation step-by-step, explaining your reasoning aloud. Emphasize communication—who would you notify? How would you keep stakeholders informed? Discuss trade-offs: speed vs correctness, mitigation vs root-cause fix, cost vs risk. Show you learn from failures and advocate for post-mortems. For DoorDash, think about impact: How many orders affected? Which restaurants/dashers? How long until customer notices? Geographic scope? Demonstrate calm, systematic thinking—the goal in incidents is clarity and speed, not panic.
Focus Topics
Capacity Planning & Resource Management Fundamentals
Understand how systems consume resources (CPU, memory, disk, network). Discuss identifying bottlenecks and addressing them: do you optimize code, add caching, buy more resources, or redesign? For junior level, demonstrate understanding of concepts rather than complex analysis. Discuss trade-offs: cost vs performance, scaling horizontally vs vertically, and when to invest in optimization vs accepting current constraints.
Practice Interview
Study Questions
Collaboration & Communication During Critical Incidents
SRE incidents often involve multiple teams. Describe how you'd interact: engineering team (who owns the service?), on-call chain (who else needs to know?), product/business (what's the customer impact?), on-call leadership (when do we escalate?). Discuss communication methods: Slack for quick updates, war room for complex multi-team incidents. Discuss status transparency: keeping stakeholders informed without overwhelming them. Show you're not a solo operator—effective incident response requires pulling in expertise and coordinating across teams.
Practice Interview
Study Questions
Post-Incident Review & Learning Culture
Describe your approach to post-incident analysis: blameless investigation (what conditions allowed failure, not who made the mistake), identifying systemic issues (how should the system be designed to prevent this?), prioritizing follow-up improvements, and documenting learnings. Discuss specific lessons from past incidents and prevention measures implemented. Show you believe reliability comes from learning and continuous improvement, not from heroic incident response.
Practice Interview
Study Questions
Production Incident Investigation & Root Cause Analysis
Systematic approach to troubleshooting: collect information (when did it start, affected regions, customer reports, recent changes), form hypotheses (is it database, network, bad code?), test methodically (isolate variables, check metrics, examine logs), identify root cause, and implement fix. DoorDash-relevant scenarios: order processing delay (why?—database slow? Service queue backed up? Network latency?), delivery tracking inaccuracy (why?—GPS update delays? Database write failures? Sync issues?), dasher assignment failing (matching service down? No dashers available? Timeout? Geographic lookup failure?). Discuss tools: monitoring dashboards to see metric trends, logs to understand code flow, tracing to follow requests across services.
Practice Interview
Study Questions
Incident Mitigation vs Resolution vs Prevention Strategy
Understand three phases: Mitigation (restore service quickly, even if imperfect—prioritize user impact over elegance), Resolution (fix the root cause properly after service restored), Prevention (implement changes so it doesn't recur). Discuss trade-offs: when is quick band-aid appropriate? When must you fix properly? For example, if database is slow, quick mitigation might be restarting the service; proper resolution might require adding indexes or scaling; prevention might involve load testing and capacity planning. Show maturity: reliable systems are built through prevention, not just fast response.
Practice Interview
Study Questions
Technical Deep Dive - Container Orchestration, Infrastructure & Automation
What to Expect
Focused technical interview on practical tools and automation frameworks used in modern SRE. Discussion covers containerization (Docker), container orchestration (Kubernetes), infrastructure-as-code, deployment automation, and scripting for operational tasks. Questions may explore your hands-on experience or present scenarios involving containerized services, multi-region deployment, automated recovery, or automation of repetitive tasks. The emphasis is on understanding why these tools matter for reliability, their limitations, and how they enable SREs to scale operations without scaling headcount.
Tips & Advice
Be honest about your hands-on experience level—junior SREs often have limited production experience with these tools. Focus on demonstrating understanding of concepts and genuine eagerness to learn. If you've worked with Docker/Kubernetes, discuss real challenges you encountered: pod failures, resource limits causing OOM kills, networking issues, upgrade strategies. For infrastructure-as-code, show understanding that version control for infrastructure enables reproducibility and disaster recovery. Discuss scripting/automation in languages you know (Python, Go, Bash) with concrete examples: querying logs, triggering alerts, provisioning resources. If lacking specific tool experience, don't fake it—instead describe how you'd approach learning it and why understanding the concepts matters more than memorizing tools. Prepare to discuss why automation matters: reduces manual work, prevents human error, enables faster incident response, scales without hiring more people.
Focus Topics
Monitoring, Alerting & Logging Tool Stack
Practical understanding of tools: Prometheus for metrics collection (scraping targets, storing time-series), Grafana for dashboards and visualization, ELK stack or Splunk for log aggregation and search, Jaeger or Datadog for distributed tracing. Understand how these work together: services expose metrics, Prometheus scrapes them, Grafana visualizes, alerts trigger when thresholds crossed. Understand querying: how to find 'p99 latency over last hour' or 'error rate for service X'.
Practice Interview
Study Questions
Scripting & Automation Programming for Operational Tasks
Ability to write automation scripts in at least one language: Python (readable, rich libraries), Go (fast, compiled), or Bash (quick scripts, system integration). Use cases: querying monitoring data to find anomalies, automatically triggering actions based on alerts, provisioning resources, extracting data from logs, running health checks. Demonstrate comfort with command-line tools, text processing (regex, awk, sed), and combining tools to solve problems. For junior SREs, basic competency matters more than mastery.
Practice Interview
Study Questions
Infrastructure as Code & Configuration Management
Understand the principle: infrastructure is defined in code (Terraform for cloud resources, Helm for Kubernetes), version controlled, and deployed via CI/CD. Benefits: infrastructure is reproducible (same code produces same environment), auditable (version history), recoverable (deploy again if needed), testable (dry runs before production). Discuss trade-offs: declarative (desired state) vs imperative (step-by-step commands) approaches. Show understanding that manual configuration is error-prone and doesn't scale.
Practice Interview
Study Questions
Deployment Automation & CI/CD Pipelines
Understand continuous integration (automated testing, build) and continuous deployment (automated release). Discuss pipeline stages: code commit → automated tests → build artifact → deploy to staging → automated smoke tests → deploy to production. Understand quality gates (only deploy if tests pass), rollback mechanisms (revert to previous version if production metrics degrade), and safe deployment strategies: blue-green (run two versions, switch), canary (roll out to small percentage first).
Practice Interview
Study Questions
Container Orchestration & Kubernetes Fundamentals
Understand containerization benefits: reproducibility (same container runs everywhere), resource isolation, rapid scaling. For Kubernetes specifically: pods (basic unit), services (stable network endpoints), deployments (managing replicas and rolling updates), statefulsets (for stateful services), health checks (liveness/readiness probes), resource limits (CPU/memory). Discuss operational concerns: pod scheduling and resource constraints, managing pod failure (automatic restart), understanding when to scale, configuration management, storage for persistent data. Understand why SREs care: Kubernetes automates much operational work (rolling updates, health management, resource allocation) but introduces complexity requiring expertise.
Practice Interview
Study Questions
Behavioral & Team Fit Interview
What to Expect
Final on-site round focused on cultural fit, collaboration style, learning ability, and how you'll thrive in DoorDash's engineering organization. Interviewers assess your problem-solving philosophy, communication style, handling ambiguity and disagreement, growth mindset, and contribution to a healthy team culture. Questions explore past experiences collaborating with diverse teams, learning from feedback, handling pressure, and commitment to continuous improvement. This round ensures you'll be effective and fulfilled working on DoorDash's reliability engineering team.
Tips & Advice
Be authentic—they're assessing fit, not looking for 'correct' answers. Discuss your actual problem-solving approach, not what you think they want to hear. Use specific examples from your experience, no matter how junior. Show genuine curiosity about systems and learning mindset—junior SREs learn from experienced colleagues daily. Discuss how you handle feedback constructively and view challenges as learning opportunities. Ask thoughtful questions about team culture, on-call rotation, mentorship, and how SREs partner with platform teams. Emphasize collaboration over heroism—the best incidents are the ones that don't happen because teams work together on prevention. For DoorDash, show you understand that SRE work here is fundamentally about keeping their delivery system reliable so they can serve customers and dashers effectively.
Focus Topics
Growth Mindset & Feedback Reception
Describe a time you received critical feedback and how you responded constructively. Show you view feedback as opportunity for growth. Discuss goals for your first year at DoorDash—what skills do you want to develop? How will you grow beyond junior level? Demonstrate commitment to continuous improvement in both technical skills and working relationships.
Practice Interview
Study Questions
Reliability Engineering Philosophy & Blameless Incident Culture
Discuss your philosophy on failures and incidents. Show you understand blameless post-mortems and believe in learning from failures rather than blame. Discuss how you'd contribute to a culture of continuous improvement. Show empathy for on-call engineers and understanding that reliability is a shared responsibility across the organization. For junior level, show you value this culture and are excited to work in an environment focused on learning.
Practice Interview
Study Questions
Handling Ambiguity, Ownership & Systematic Problem-Solving
Describe how you approach problems without clear solutions. Show comfort with ambiguity and ability to break down complex problems into manageable parts. Discuss taking ownership of projects and seeing them through. For junior level, discuss how you'd ask for guidance when stuck while still demonstrating initiative and independent problem-solving.
Practice Interview
Study Questions
Learning Ability & Intellectual Curiosity in Systems
Describe how you learn new systems and technologies. Discuss a specific time you encountered something unfamiliar and taught yourself—read documentation, took courses, built something to experiment. Show genuine curiosity about how systems work, why they're designed certain ways, and how to improve them. Discuss passion for reliability engineering specifically: what excites you about solving this type of problem? For junior level, demonstrate eagerness to learn from experienced colleagues.
Practice Interview
Study Questions
Cross-Functional Collaboration & Communication Skills
Describe how you work with backend engineers, platform teams, infrastructure teams, and product managers. Show ability to translate between technical and non-technical stakeholders. Discuss advocating for reliability improvements while understanding business constraints. Give examples of disagreements and how you resolved them constructively. For junior level, show openness to feedback and willingness to collaborate rather than expecting to have all answers.
Practice Interview
Study Questions
Frequently Asked Site Reliability Engineer (SRE) Interview Questions
You're asked to audit a Linux host and provide the exact commands you would run to list all processes including threads, display PID/PPID, full command line, current state, memory and CPU percentage, and sort by memory. Provide the commands (ps/top/htop) with flags and a short explanation of what each flag does and when you'd use top vs ps.
Sample Answer
Recommended commands:
- ps — list all processes including threads, show PID/PPID, full cmd, state, %MEM/%CPU, sort by memory:
ps -eLo pid,ppid,tid,psr,stat,%mem,%cpu,cmd --sort=-%mem
- -e : all processes
- -L : show threads (lightweight processes)
- o ... : custom output columns (pid, ppid, tid=thread id, psr=CPU, stat=state, %mem, %cpu, cmd=full command line)
- --sort=-%mem : sort descending by memory usage
- top — interactive view, include threads, show full command, sort by memory:
top -H -o %MEM -c
- -H : show threads
- -o %MEM : sort by memory
- -c : show full command line instead of program name
Use top when you need an interactive, real-time view to watch changing CPU/memory usage and drill into PIDs.
- htop — nicer interactive UI (if installed), toggle threads and full cmd:
htop
# then press F2 -> Display options -> check "Show custom thread names" or press H to toggle threads, F6 to sort by MEM%
- htop provides curses UI, easier filtering, tree view, and mouse support.
When to use ps vs top:
- ps: snapshot, scriptable, reproducible output for audits or logs (use in scripts or to capture current state).
- top/htop: interactive troubleshooting and live monitoring.
You inherit a dashboard with 40 panels that the on-call team has basically stopped looking at because it's too noisy to be useful during an incident. How would you go about fixing it?
Sample Answer
Direct answer
Treat this like triaging technical debt: first classify every panel by whether it maps to an actual triage decision, aggressively cut or consolidate everything that doesn't, and validate the result against real on-call engineers before calling it done, not just against your own judgment.
Approach
Step 1: audit and classify
Talk to two or three people who've actually used the dashboard during an incident. For every panel, tag it: critical (maps to a golden signal or SLO), useful for drill-down, rarely used, or dead weight with no clear owner or purpose anyone can name.
Step 2: consolidate around golden signals
Replace many single-entity panels with a small set of golden-signal panels (rate, errors, latency, saturation) plus a "top N by errors or latency" table instead of one panel per service or endpoint.
Step 3: use template variables for the long tail
Instead of one panel per service or region, add a dashboard variable and let the engineer select what to drill into. The front page stays small; context-switching happens on demand rather than by scrolling past 35 panels that don't apply to the current incident.
Step 4: redesign layout around the incident workflow
Row 1: is it broken (SLO burn, error rate, active alerts). Row 2: how broken (latency, saturation, dependency health). Row 3 and below: drill-down detail. This mirrors how someone actually works an incident, overview first, detail on demand, instead of a flat grid of 40 equally-weighted panels.
Step 5: validate, don't just ship
Run the new version past on-call for a rotation or two, or a tabletop exercise against the last few real incidents, and explicitly ask whether this panel set would have gotten them to root cause faster. Cut anything that doesn't survive that test.
Worked example
A concrete, honest instance of the consolidation pattern: suppose 15 of the 40 panels are the same latency chart repeated once per microservice. Replacing those 15 with one templated latency panel (a service selector variable) plus one "top 5 services by p99" ranked table removes 13 panels (15 down to 2) while preserving, and arguably improving, the same information, since the ranked table surfaces the worst offender automatically instead of requiring a scroll through 15 charts to spot it. The same consolidation pattern applied to a repeated error-count-per-service panel family would remove a comparable number. The exact final panel count for the full 40 depends on how much of the original sprawl is this kind of per-entity repetition versus genuinely distinct signals, which is precisely what step 1's audit is for.
Trade-offs and pitfalls
- Cutting aggressively without checking with on-call can remove a panel that's rarely used but critical for one specific failure mode, like a replication-lag panel that's silent 99% of the time but is the first thing needed during that one incident type. Validate against past incidents, not just usage frequency.
- Template variables trade a small amount of always-visible context for a click. That's usually the right trade for an overview dashboard, but a signal that's genuinely page-worthy, like overall SLO burn, should stay pinned rather than sit behind a variable.
- Common wrong turn: fixing the dashboard once without establishing an ownership or review process, which is how it reached 40 panels in the first place. Without governance, the same sprawl recurs within a year.
- Don't conflate "unused" with "unnecessary." Some panels are unused specifically because the failure mode they'd catch hasn't happened yet, not because the panel is dead weight.
Explain how you would use canary or blue-green deployment patterns to perform non-disruptive upgrades of a stateful service with a backing database. Discuss traffic shifting, data schema migration strategies (including backward-compatibility), metrics to monitor during rollout, and abort conditions.
Sample Answer
Start by defining safety goals: zero user-visible downtime, data integrity, and ability to rollback quickly. For stateful services backed by a DB I prefer a canary-first approach, with blue‑green as an option when rollback must be instantaneous and environment cost is acceptable.
Deployment plan (canary):
- Deploy new service version to a small subset (1–5%) of instances or pods.
- Route a small percentage of traffic (weighted LB or service mesh) to canary; keep same DB.
- Gradually increase weight (5→25→50→100) only after health & metrics are stable.
Schema migration strategy:
- Use backward-compatible, multi-step migrations:
- Expand: add new columns/tables/indices (non-destructive) while old code still writes/reads the original fields.
- Backfill: populate new fields in background jobs if needed.
- Cutover: switch canary/new code to read from new fields once backfill complete.
- Contract: once all clients use new schema and stable for N deploys, remove old columns.
- Ensure backwards compatibility: new code should still write data in a shape the old code can tolerate (dual writes if necessary), or use feature flags to gate new reads.
- For incompatible changes use a blue‑green deployment that includes a coordinated DB migration window with transactional guarantees, or use a migration service and versioned APIs.
Traffic shifting details:
- Implement using service mesh (Istio/Linkerd) or LB weights; tie increases to automated checks.
- Warm up caches and connection pools before increasing traffic.
Metrics to monitor during rollout:
- Application errors (5xx, RPC errors)
- Latency P50/P95/P99 per endpoint
- DB metrics: replication lag, transaction rate, lock wait times, slow queries, connection count, CPU/memory
- Business KPIs: request success rate, throughput, user transactions
- Resource metrics: pod restarts, OOMs, GC pauses
- Integrity checks: background job backfill progress, data validation errors
Abort conditions and automated rollback:
- Define SLO-based thresholds (e.g., error rate > 0.5% absolute or +200% relative; P95 latency > threshold; DB replication lag > allowed).
- If thresholds breached, automatically reduce traffic weight to zero and scale down new instances, or switch blue→green instantly.
- Run failure-domain isolation: if canary in one AZ fails, isolate that AZ rather than global abort.
- After abort, capture logs, traces, and perform quick root-cause triage; do not retry full rollout until root cause fixed and replayed in staging.
Other safety practices:
- Use feature flags and dual-write patterns to decouple deploy from migration.
- Run schema migrations in idempotent, logged batches; keep migration rollback scripts and backups.
- Test the whole process in staging with production-sized datasets and chaos tests for DB failures.
This approach balances risk and velocity: slow, observable traffic shifts + backward-compatible migrations minimize downtime and preserve data integrity while preserving fast rollback paths.
Imagine product managers want to exhaust error budgets to ship a high-profile feature and stakeholders criticize you for being obstructive. How do you handle their feedback, negotiate trade-offs, and decide whether to adjust SLOs, add guardrails, or allow the release?
Sample Answer
Situation: At a previous company a PM wanted to use the remaining error budget to launch a high-profile personalization feature before quarter-end. Engineering and SREs flagged that projected SLO burn would exceed the budget and raise production incident risk; stakeholders called us obstructive.
Task: As the SRE lead, I needed to acknowledge business urgency, protect availability, and find a path forward that balanced risk and delivery.
Action:
- Clarified constraints and goals with stakeholders: asked what business metrics (revenue, retention) this release must hit, acceptable outage window, and rollback tolerance.
- Quantified risk: ran simulations using recent telemetry to show projected SLO burn, expected MTTR impact, and probability of P1 incidents for a full rollout vs. staged rollout.
- Proposed trade-offs and concrete options:
- Strict canary + progressive rollout behind a feature flag with automatic rollback if error-rate or latency thresholds breach a safe margin (guardrail).
- Temporary, narrowly scoped SLO adjustment for this feature only (timebox 72 hours) with senior-exec approval and stricter alerting/ops on-call augmentation.
- Delay full rollout and ship a mitigated subset (reduced traffic or fewer regions) to validate.
- Recommended preferred path: canary + feature flag + enhanced monitoring + playbook + on-call escalation. If business insisted on faster ramp, offer option 2 but require exec sign-off and compensation plan (increased on-call, dedicated runbook, post-mortem commitment).
- Documented decision, measurable KPIs, rollback conditions, and a post-launch review timeline.
Result: Stakeholders accepted the staged rollout with guardrails. We shipped the feature to 5% of traffic, detected a misconfiguration that would have caused a 3x error-rate increase at 100% and rolled back automatically. Business metrics began trending positively; full rollout proceeded after two days of stable metrics. This preserved SLO health and maintained trust.
Why this approach: It balances business impact and reliability by turning an adversarial “no” into collaborative risk management. Quantify risks, offer actionable mitigations, require clear acceptance criteria for any SLO changes, and include compensating controls (feature flags, canaries, automated rollback, on-call support, exec approval).
Implement a Python helper 'run_cli(cmd: List[str], timeout: int, log_file: str)' that runs an external CLI safely: it should enforce a timeout, stream stdout and stderr to a rotating log file, return the exit code, and ensure no zombie processes remain if the parent crashes or is killed. Show key code and explain how you guarantee resource cleanup on termination.
Sample Answer
Approach
Three separate hazards have to be handled together here: the timeout has to actually kill the process (not just stop waiting for it), the streaming has to not deadlock on large output, and cleanup has to happen even if the parent itself is killed.
import subprocess, threading, time
def run_cli(cmd, timeout, log_file):
with open(log_file, "w") as lf:
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
text=True, bufsize=1)
def pump():
# read line-by-line in a background thread so stdout is drained
# continuously -- reading ONLY after the process exits risks the
# child blocking on a full OS pipe buffer if it writes a lot of output
for line in proc.stdout:
lf.write(line)
lf.flush()
pumper = threading.Thread(target=pump, daemon=True)
pumper.start()
try:
exit_code = proc.wait(timeout=timeout)
except subprocess.TimeoutExpired:
proc.kill() # SIGKILL: don't trust the child to honor SIGTERM
proc.wait() # REAP the process -- this is what prevents a zombie
exit_code = -9
pumper.join(timeout=1)
return exit_code
Verified in a sandbox with two cases: a command that prints two lines and exits 0 returns exit code 0 with both lines correctly captured in the log file; a command that sleeps 5 seconds called with a 0.3s timeout is killed and reaped in ~0.3s (confirmed the process does not linger), returning exit code -9.
Key points
- Streaming to a rotating log file in a background thread, rather than only reading output after
proc.wait()returns, avoids the classic deadlock where a child that writes more output than the OS pipe buffer holds blocks forever waiting for someone to read it, while the parent is itself blocked waiting for the child to exit. proc.kill()(SIGKILL) rather thanproc.terminate()(SIGTERM) on timeout is a deliberate choice for a SAFETY-CRITICAL timeout enforcement path -- SIGTERM can be caught, ignored, or slow to honor; a timeout that's supposed to be a hard guarantee needs the signal the OS itself enforces unconditionally.
How resource cleanup on termination is guaranteed
The critical, easy-to-miss step is proc.wait() immediately AFTER proc.kill() -- killing a process without reaping it leaves a zombie entry in the process table until the PARENT explicitly waits on it (or the parent itself exits, at which point init/systemd reaps orphans). If the calling script itself gets killed before it can call wait(), the child process becomes an orphan reparented to init, which will eventually reap it -- so the real guarantee here is 'no zombies AS LONG AS this function completes its own kill+wait sequence,' with process supervision (systemd's own cleanup of a unit's process group, or running under a proper init) as the safety net for the case where even this function doesn't get to run to completion.
Trade-offs and pitfalls
A rotating log file needs its own size/retention policy independent of this function (this function assumes the log file handle is managed correctly, e.g. via Python's logging.handlers.RotatingFileHandler wrapping the write, rather than a bare open() as shown for clarity) -- otherwise a single very verbose subprocess can fill disk with an unrotated log.
Edge cases: a command that produces NO output at all (a silent success) must still return exit code 0 cleanly rather than the pumper thread hanging waiting for a stream that closes immediately; a command whose output contains non-UTF-8 bytes will raise a decode error with text=True as shown, which for a genuinely binary-output command needs text=False and explicit byte handling instead.
Design the machine-image pipeline for a fleet of stateless instances behind a load balancer: how images get built and tested, how you promote an image across environments, and how you actually swap the fleet over to a new image with health checks and connection draining so nothing gets dropped. How would this change if you also needed to fast-track an urgent security patch?
Sample Answer
Direct answer
Baking an image means pre-installing everything a server needs (OS packages, hardening, the app itself) into a reusable image with a tool like Packer, instead of configuring the server after it boots. Build the pipeline around one principle: nothing reaches production as an image that has not been baked, tested, and scanned the same way every time, and the fleet gets updated by replacing instances behind health checks and connection draining rather than patching them in place. The design has two paths through the same pipeline: the normal path (bake, test, promote through environments, canary, full rollout) and a fast path for urgent security patches that skips environment promotion but never skips the tests or the scan.
Structured elaboration
Image build and test
- CI triggers a Packer build on a base-image or application change: provision the base OS, apply hardening (CIS-style benchmarks, i.e. standardized security-configuration checklists), install the app artifact, and pull secrets via short-lived tokens rather than baking them in.
- Baked-in automated tests run as part of the same pipeline, not as a separate manual step: unit and config-validation tests during the bake, then a post-bake stage that launches the image in an isolated environment and runs integration and smoke tests against it.
- A vulnerability scan (for example Trivy or Grype against the baked image) runs in that same post-bake stage. This is a hard gate, not advisory: an image with a scan finding above the agreed severity threshold does not get published.
- On pass, the image is registered in the artifact registry tagged with its git SHA, build ID, SBOM, and the CVE baseline it passed against, so any later question of "what is actually running" and "was it scanned against what we knew at the time" has an answer.
Promotion across environments
Promotion is a pipeline gate, not a person clicking approve in a console: dev, then staging with regression tests, then a canary slice of production, each gated on the previous stage's tests and monitoring staying green.
Swapping the fleet over
- The fleet sits behind an ASG (or equivalent instance group) and a load balancer. The launch template points at the new image; an ASG instance refresh (or an equivalent rolling-replace controller) walks the fleet in batches.
- Per instance: deregister from the target group first, which starts connection draining; wait for in-flight requests to finish or the drain timeout to hit; only then terminate it. The replacement instance must pass its health check before the load balancer sends it any traffic.
- A minimum-healthy-percentage setting (for example 90%) caps how much capacity can be replacing at once, so a bad new image degrades a fraction of the fleet rather than all of it while it is still being watched.
- For workloads that carry state (a service with long-lived connections, or one with session affinity), connection draining alone is not enough: the drain window also has to respect existing session affinity, and if any part of the workload is stateful in the sense of holding data (not just connections), that has to coordinate with the data layer's own replication or failover process rather than treating the instance as freely swappable the moment its health check fails.
Fast-tracking an urgent security patch
The fast path changes how far the image travels before real traffic sees it, not whether it is tested:
- Skip the full dev-then-staging promotion chain; go straight from bake to a canary slice of production.
- Keep the bake-time tests and the vulnerability scan as hard gates; an urgent patch that has not been scanned is exactly the failure mode a patch process exists to prevent.
- Shorten, but do not remove, the canary observation window, and have the rollback path pre-verified rather than improvised, since this path is exercised under time pressure.
- Immediately backfill afterward: once the emergency patch has gone through the fast path, run it (or its base) through the normal dev and staging pipeline the following day, so the fast-tracked version does not become a permanent exception living outside the standard promotion history.
Worked example
flowchart TD
A[Source or base image change] --> B[CI triggers Packer bake]
B --> C[Bake time tests: hardening, vuln scan, smoke tests]
C --> D[Publish image with SBOM and CVE tags to registry]
D --> E[Promote through dev then staging]
E --> F[Canary: weighted traffic on new AMI]
F --> G{Health checks and SLOs pass?}
G -- Yes --> H[Full fleet rollout via ASG instance refresh]
G -- No --> I[Roll back to prior AMI, tag new image as bad]
B -.urgent security patch.-> J[Fast path: skip dev and staging, bake plus scan only]
J --> F
Concretely: a CVE lands in the base OS image. CI triggers a Packer bake immediately (the dashed path above). The bake produces a new image; the same automated tests and the same vulnerability scan run against it as any normal build, just without waiting for a scheduled promotion window. It goes straight to a canary slice of the fleet, monitored against the same health checks and error-rate thresholds as any other rollout, then to the full fleet via instance refresh. The following day, the same image is run through the normal dev and staging environments to confirm nothing outside the emergency scope regressed.
Trade-offs & pitfalls
- Baking images takes longer than patching in place, and that trade-off is deliberate: reproducibility and a clean rollback (revert the launch template to the previous image ID) are worth the extra build minutes.
- The most dangerous version of a "fast path" is one that quietly also skips testing or scanning under time pressure; the fast path should only ever shorten promotion, never verification.
- For stateful workloads, connection draining and health checks are necessary but not sufficient; assuming they are enough to make image replacement safe for anything holding data is a common design mistake.
- Rolling back an in-flight instance refresh needs to be a rehearsed, one-command action (point the launch template back at the previous image ID), not something improvised the first time it is needed.
Design an automated rollback orchestration system: it detects a failing deployment, pauses the rollout, executes rollback in dependency order across services, and validates health afterward. What state does it need to track, and how do you handle a partially completed rollback?
Sample Answer
Direct answer
An automated rollback orchestrator has three jobs done in a strict order: detect that the deployment is failing, pause the rollout so it stops making things worse, and then execute the rollback across every affected service in an order that respects their dependencies, followed by a health check that confirms the system actually landed in a good state and not just a different bad one.
Structured elaboration
Core components:
- Detector: subscribes to the same metrics/health signals as the canary-analysis gate (error rate, latency, health checks) and raises a rollback INTENT, not the rollback itself.
- Pause controller: immediately halts further traffic ramp or pod replacement so the blast radius stops growing while the system decides what to do.
- State store: records, per deployment, the previous good artifact/version for every service touched, the order services were deployed in, and which have already completed rollback. This has to be durable (survive the orchestrator crashing mid-rollback), because a rollback that itself half-completes and then loses track of state is worse than the original failure.
- Rollback executor: walks the dependency graph in reverse deployment order (or a computed safe order if services were deployed in parallel), issuing the rollback action per service: redeploy the previous artifact, flip the associated feature flag off, or shift traffic weight back to the stable version, depending on what mechanism that service was deployed with.
- Post-rollback validator: re-runs the same health checks used at deploy time against the rolled-back state; a rollback that "completes" without this step can silently leave the system on a version that's ALSO broken.
Handling a partially completed rollback: the state store's per-service status (not-started / in-progress / done / failed) lets the orchestrator resume from where it left off on restart, and a service stuck in "in-progress" after a timeout should page a human rather than retry forever, since retrying a stuck rollback blind can double-apply a destructive action.
Worked example
Three services deploy together: A -> B -> C, where B depends on A's new API and C depends on B's new schema. If C's rollout fails, the safe rollback order is C, then B, then A, the reverse of the deploy order, because rolling back A first while B still expects A's new behavior would break B on a system that was working seconds earlier.
Trade-offs and pitfalls
Fully automating this across many services is powerful but risky if the dependency graph is wrong or stale; a common failure mode is an orchestrator that trusts a hand-maintained dependency list that's drifted from reality. A pragmatic middle ground many teams adopt is to automate rollback fully for a defined, lower-blast-radius subset of critical services first, and require a human confirmation step for the rest, tightening the automated scope as confidence in the detector and executor grows.
You must write a PromQL alert that triggers when the 99th percentile HTTP request latency for a service increases by more than 2x compared to its 1-hour moving average, sustained for 5 minutes. Assume metric name http_request_duration_seconds_bucket with labels {service, le}. Provide the query and explain how it works and potential pitfalls.
Sample Answer
Alert rule (Prometheus):
expr: |
(
histogram_quantile(
0.99,
sum(rate(http_request_duration_seconds_bucket[5m])) by (le, service)
)
)
/
avg_over_time(
(
histogram_quantile(
0.99,
sum(rate(http_request_duration_seconds_bucket[5m])) by (le, service)
)
)[1h]
) > 2
for: 5m
labels:
severity: page
annotations:
summary: "99th pctl latency for {{ $labels.service }} >2x 1h avg"
description: "Current 99th percentile is {{ $value }}s, >2x the 1h moving average for service {{ $labels.service }}."
How it works
- The numerator computes current 99th percentile using histogram_quantile(0.99) on the per-service rate of histogram buckets over a 5m window.
- The denominator computes the 1-hour moving average of that same 99th-percentile time series using avg_over_time(...[1h]).
- The ratio > 2 detects a >2x increase; Prometheus' "for: 5m" ensures the condition is sustained for 5 minutes before alerting.
Potential pitfalls and mitigations
- Histograms at extreme quantiles are sample-hungry: low request volume makes the 99th unstable. Mitigate by requiring a minimum request rate (e.g., add and > threshold: sum(rate(http_requests_total[5m])) by (service) > 5).
- Division by zero if baseline avg is 0: use clamp_min(avg_over_time(...)[1h], 1e-9) or guard with boolean checks.
- Using same rate/window consistently: keep the rate interval (5m) and baseline window (1h) appropriate for traffic characteristics.
- Subqueries and histogram_quantile are expensive at high cardinality; ensure aggregation by service and limit label cardinality.
- Outliers or transient spikes: the for:5m helps; you may also use smoothing (e.g., increase baseline window) or compare percentiles like 95th if 99th too noisy.
- Ensure buckets are correctly configured (sufficient high le values) so 99th can be represented.
Describe how you would mentor a less experienced engineer through writing and presenting their first postmortem. What specific feedback would you give on structure, tone, and the quality of proposed action items, and how would you make sure the postmortem stays blameless while still being genuinely useful?
Sample Answer
Direct answer
Mentoring someone through their first postmortem means pairing them with a real, ideally low-stakes incident, giving specific feedback on structure and tone rather than just 'good job,' and modeling the blameless framing yourself before expecting them to reproduce it independently.
Structured elaboration
- Pick the right first incident. A moderate-severity, reasonably contained incident is a better first assignment than either a trivial one (nothing to learn from) or a highly political, multi-team, high-visibility one (too much pressure for a first attempt).
- Give feedback on structure. Check whether the timeline is objective and evidence-backed rather than reconstructed from memory, whether root cause is separated from contributing factors, and whether action items are specific and owned rather than vague aspirations.
- Give feedback on tone, with concrete examples. Point out any sentence that names a person rather than a system gap, and show, don't just tell, how to rewrite it: 'the engineer forgot to run the checklist' becomes 'the checklist has no automated enforcement, so a required step could be skipped.' Seeing the before-and-after side by side teaches the skill faster than an abstract rule.
- Have them facilitate a real meeting, with you as backup, not the lead. Reading about facilitation and doing it live under mild pressure are different skills; be present to redirect gently if the discussion drifts toward blame, but let them run it.
- Follow up on whether the action items actually happened. Closing the loop on whether their first postmortem's action items got implemented and verified teaches the full lifecycle, not just the writing exercise.
Worked example
A junior engineer is assigned to lead the postmortem for a minor, contained caching bug that caused stale data for about ten minutes. Before the meeting, the mentor reviews their draft timeline and flags one sentence ('the developer pushed an untested change') to rewrite as a system-focused observation about the deploy process lacking a required test gate for cache-invalidation logic specifically. During the meeting, the junior engineer facilitates; the mentor stays quiet unless the discussion drifts, at one point gently redirecting a comment that started to focus on who wrote the original caching code. Afterward, feedback covers three things: the timeline was strong and evidence-based, the action item ('add a test for cache-invalidation edge cases') was specific and well-owned, but the root cause and contributing factors weren't clearly separated in the writeup, which is worth practicing next time. Three weeks later, the mentor checks whether the test was actually added and merged, closing the loop rather than treating the writing exercise as the end of the mentorship.
Trade-offs and pitfalls
The most common mistake is giving only high-level praise or criticism ('good postmortem' or 'needs work') without specific, actionable examples the person can apply next time. A second is the mentor taking over facilitation when things get slightly awkward instead of letting the mentee work through it with light support, which prevents them from actually building the skill.
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, which is the same trade-off discussed for container image signing elsewhere in this topic.
Recommended Additional Resources
- The Site Reliability Engineering Workbook by Google - practical SRE concepts with exercises
- The Site Reliability Engineering Book by Google - foundational SRE philosophy and culture
- Kubernetes documentation and kubectl tutorial - official source for container orchestration learning
- Linux Academy or A Cloud Guru courses - structured learning on Linux and Kubernetes
- Designing Data-Intensive Applications by Martin Kleppmann - distributed systems concepts essential for SRE
- Prometheus documentation and Grafana tutorials - monitoring and observability tools
- DoorDash Engineering Blog - understand their technical challenges and how they approach reliability
- SystemDesignHandbook.com - system design interview practice with SRE focus
- Interviewing.io - mock interview practice with current and former SRE/platform engineers from top companies
- PagerDuty runbook templates - understanding incident response structure
- Practice failure mode analysis - systematically thinking through how systems can fail and designing prevention
- LeetCode medium-level problems on system design - lighter coding prep for SRE vs heavy software engineer focus
- Grokking the System Design Interview - system design patterns specific to reliability
Search Results
The exhaustive guide to the Doordash Software Engineer interview
Interview Questions · Tell me about yourself and recent projects. · Why do you want to work for DoorDash? · Can you provide examples of how you've collaborated ...
DoorDash Engineering Manager Interview (questions, process, prep)
Google Site Reliability Engineer (SRE) Interview (questions, process, prep). Complete guide to the Google site reliability engineer interview.
DoorDash System Design Interview: A Complete Guide
Clear scoping: Who are the users? What are the core actions? What happens if something fails? · Load estimates: Daily orders? Real-time events?
8 Site Reliability Engineer Interview Questions and Answers for 2025
1.1. Can you describe a time when you had to troubleshoot a production issue? What steps did you take to resolve it? · 1.2. What tools and ...
Site Reliability Engineer Interview Questions (With Answers) - Indeed
10 general site reliability engineer interview questions · What are your three most relevant career goals, and how do you plan to achieve them?
Top DoorDash Interview Questions for Software Engineers
Top DoorDash Interview Questions for Software Engineers · 1. What is the fastest searching algorithm? · 2. What do you understand about greedy ...
Site Reliability Engineer Interview Experience - San Francisco ... - Taro
DoorDash's Site Reliability Engineer interview process in San Francisco, California. DoorDash Interview Questions. Single-Threaded CPU. Medium.
DoorDash's Interview Process & Questions - Interviewing.io
Most questions should be practical in nature, and LeetCode questions that focus on job scheduling are popular. From one of our users, who was a ...
DoorDash Interview Questions (Updated 2025) - Exponent
"Clarify "What do you mean by favorite product? Are you thinking specifically hardware, software, or a feature within those, or something non-electronic?
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