Spotify Site Reliability Engineer (Mid-Level) Interview Preparation Guide
Spotify's Site Reliability Engineer interview process is a rigorous, multi-stage evaluation designed to assess both technical depth and operational excellence. The process combines phone-based technical assessments with comprehensive on-site interviews covering infrastructure automation, system design, incident response, and cultural alignment. For mid-level candidates, the emphasis is on demonstrated experience building reliable systems, strong collaboration skills, and the ability to own projects end-to-end with some mentorship of junior team members.
Interview Rounds
Recruiter Screening
What to Expect
Your initial contact with Spotify's recruitment team via video or phone call. This 30-45 minute conversation focuses on understanding your background, career motivations, and alignment with Spotify's culture and the SRE role. The recruiter will discuss the position, team dynamics, and expectations. This is your opportunity to demonstrate communication skills, enthusiasm for reliability engineering, and understanding of what makes Spotify's infrastructure unique at scale.
Tips & Advice
Research Spotify's engineering culture and recent infrastructure initiatives before the call. Prepare 2-3 concrete examples of projects where you've improved system reliability or reduced operational overhead. Be specific about your role and impact—use metrics when possible (e.g., 'reduced incident response time from 30 minutes to 5 minutes'). Clarify expectations around on-call responsibilities and incident response. Demonstrate curiosity about Spotify's tech stack and challenges at scale. The recruiter is gauging communication clarity and cultural fit, so be authentic and enthusiastic.
Focus Topics
Communication & Collaboration Skills
Be clear and concise when explaining technical concepts. Demonstrate how you communicate with development teams, incident commanders during outages, and stakeholders about operational changes.
Practice Interview
Study Questions
Concrete Project Examples
Prepare 2-3 specific examples from your SRE work that demonstrate impact: infrastructure improvements, automation projects that reduced toil, incident response improvements, or capacity planning initiatives. Have metrics ready (downtime reduced, cost savings, response time improvements).
Practice Interview
Study Questions
Spotify Culture & Values Alignment
Familiarity with Spotify's engineering culture, their approach to distributed systems, and how they balance speed with reliability. Understand their philosophy around blameless incident response and continuous improvement.
Practice Interview
Study Questions
Career Motivation & SRE Path
Understanding why you're interested in reliability engineering and specifically interested in joining Spotify. Be prepared to discuss your journey into SRE, what excites you about the role, and how your past experience aligns with Spotify's infrastructure needs.
Practice Interview
Study Questions
Technical Phone Screen
What to Expect
A focused 60-minute phone interview assessing your Linux systems knowledge, operational understanding, and ability to solve infrastructure problems. An experienced Spotify engineer will ask questions about system fundamentals, shell scripting, networking, and basic infrastructure operations. You may be asked to explain how you'd approach operational scenarios or discuss your hands-on experience with systems administration and automation.
Tips & Advice
Brush up on Linux command-line proficiency and system administration fundamentals. Be ready to discuss your experience with shell scripting (bash) for automation. Understand networking basics (TCP/IP, DNS, load balancing concepts) and how they apply to distributed systems. When answering questions, walk through your thinking process aloud and ask clarifying questions if scenarios are vague. For mid-level candidates, demonstrating practical hands-on experience and the ability to architect simple automation solutions matters more than theoretical depth. Have examples ready of scripts or tools you've built to reduce operational toil.
Focus Topics
Container & Orchestration Basics
Foundational knowledge of containerization (Docker concepts), container image management, and container orchestration platforms (particularly Kubernetes). Understand how containers simplify deployment and enable infrastructure automation.
Practice Interview
Study Questions
Incident Response Basics
Experience responding to production incidents. Understand escalation procedures, communication during incidents, and the importance of detailed observation and hypothesis testing. Be ready to discuss a challenging incident you've handled.
Practice Interview
Study Questions
Networking Fundamentals
Understanding of TCP/IP stack, DNS resolution and caching, HTTP/HTTPS protocols, load balancing concepts, routing, and firewalls. Know how to diagnose network issues using tools like ping, traceroute, netstat, and tcpdump. Understand the differences between TCP and UDP and when each is appropriate.
Practice Interview
Study Questions
System Performance & Troubleshooting
Ability to diagnose performance bottlenecks using tools like top, vmstat, iostat, and perf. Understand CPU, memory, disk I/O, and network metrics. Know how to identify and resolve common performance issues like high context switching, memory leaks, or disk saturation.
Practice Interview
Study Questions
Shell Scripting & Automation
Practical experience writing bash scripts for operational tasks. Be able to write simple scripts for file processing, log analysis, system monitoring, and deployment automation. Understand common scripting patterns and best practices. Be ready to discuss limitations of shell scripts and when to choose other languages.
Practice Interview
Study Questions
Linux Systems & Administration
Deep knowledge of Linux operating systems including process management, file systems, permissions, user management, networking configuration, and system monitoring. Be comfortable with commands like ps, top, iostat, netstat, and systemd. Understand how processes, threads, and resource management work at the OS level.
Practice Interview
Study Questions
System Design Phone Screen
What to Expect
A 60-minute technical phone interview focused on your ability to design reliable, scalable systems. You'll be presented with infrastructure design problems (e.g., 'Design a monitoring and alerting system for Spotify', 'How would you architect a deployment pipeline for high-frequency releases?'). This round assesses your understanding of distributed systems principles, trade-offs between reliability and complexity, scalability patterns, and how to design systems that handle Spotify's scale. You're expected to think through design choices, ask clarifying questions, and discuss trade-offs clearly.
Tips & Advice
Start by asking clarifying questions to understand the problem scope, scale, and constraints. Work through the design systematically: begin with simple architecture, identify bottlenecks, and incrementally add components (monitoring agents, data collectors, alert processors, storage backends). Draw diagrams if possible (even ASCII art over phone). Discuss trade-offs explicitly: consistency vs. availability, latency vs. durability, cost vs. performance. For mid-level candidates, demonstrate solid understanding of reliability patterns, scaling techniques, and the ability to design systems that handle millions of events. Reference real-world examples (e.g., how you'd apply similar patterns from your experience). Be ready to justify design decisions and adapt your design when given new constraints.
Focus Topics
SLOs, SLIs, and Error Budgets
Understanding Service Level Objectives (SLOs) and how to design systems to meet them. Know how SLIs (Service Level Indicators) measure success and how error budgets guide operational decisions. Understand how to balance feature velocity with reliability.
Practice Interview
Study Questions
Reliability Patterns & Fault Tolerance
Understanding patterns for building fault-tolerant systems: redundancy, failover, circuit breakers, bulkheads, graceful degradation, and retry strategies. Know how to design systems that degrade gracefully under load or failures rather than cascading failures.
Practice Interview
Study Questions
Trade-offs in System Design
Ability to articulate trade-offs in architectural decisions: consistency vs. availability, latency vs. durability, cost vs. performance, operational simplicity vs. feature richness. Demonstrate that you think pragmatically about these trade-offs.
Practice Interview
Study Questions
Building Scalable Infrastructure
Principles for scaling systems to handle 10x or 100x traffic growth. Understand horizontal vs. vertical scaling, load distribution, database partitioning/sharding, caching strategies, and how to identify and address bottlenecks. Discuss real-world capacity planning.
Practice Interview
Study Questions
Designing Monitoring & Alerting Systems
Architecture for collecting metrics from thousands of services, storing time-series data efficiently, processing alerts, and notifying on-call engineers. Consider data collection mechanisms (push vs. pull), storage backends, query performance, retention policies, and alert routing strategies. Understand common tools and their trade-offs.
Practice Interview
Study Questions
On-Site Round 1: Infrastructure & Automation
What to Expect
A 60-minute on-site interview focused on infrastructure automation, Infrastructure as Code (IaC), and your ability to build tools that reduce operational toil. You may be asked to write code (in your preferred language or Python/Go), discuss past automation projects, or solve infrastructure automation problems. The interviewer will assess your software engineering practices applied to infrastructure: code quality, testability, documentation, and ability to build maintainable systems.
Tips & Advice
Be prepared to write code in a language you're comfortable with. Focus on code clarity, error handling, and practical solutions over clever code. If asked to code infrastructure tools, demonstrate good practices: modularity, testability, logging, and handling edge cases. Discuss your approach to Infrastructure as Code—templates, configuration management, versioning, and testing. Walk through a real infrastructure automation project you've built: what problems it solved, how you designed it, challenges you faced, and lessons learned. For mid-level candidates, the expectation is that you can architect solutions and write clean, maintainable code, not necessarily perfectly optimized code. Be ready to discuss trade-offs in your design decisions.
Focus Topics
Programming for Operations
Writing code for operational tasks with proper error handling, logging, monitoring, and testing. Discuss code patterns that make operational code reliable and maintainable. Know when to use different languages (Python for rapid iteration, Go for performance-critical tools).
Practice Interview
Study Questions
Configuration Management
Strategies for managing configurations across many systems. Understand the difference between infrastructure configuration and application configuration. Discuss secrets management, environment-specific configurations, and configuration validation.
Practice Interview
Study Questions
Deployment Automation & Orchestration
Experience with deployment pipelines, CI/CD systems, and orchestrating complex deployments. Understand canary deployments, blue-green deployments, and rollback strategies. Be ready to discuss how you handle deployments at scale and minimize downtime.
Practice Interview
Study Questions
Infrastructure as Code (IaC)
Experience with tools like Terraform, CloudFormation, or Ansible. Understand how to define infrastructure declaratively, version control it, test it, and apply changes safely. Know patterns for managing environments, secrets, and configurations. Discuss how IaC reduces manual errors and enables reproducible infrastructure.
Practice Interview
Study Questions
Automation Frameworks & Tools
Experience building automation using tools like Ansible, Chef, Puppet, or custom frameworks. Understand idempotency, error handling, and orchestrating multi-step deployments. Be comfortable writing automation code in languages like Python, Go, or bash.
Practice Interview
Study Questions
On-Site Round 2: System Design & Reliability Architecture
What to Expect
A 60-minute on-site interview diving deep into system design and architectural thinking. You'll discuss how to architect reliable systems at Spotify's scale. The interviewer may present a complex infrastructure design challenge: 'Design a distributed cache system for Spotify's music catalog', 'How would you architect a system to handle real-time streaming to millions of users?', or similar. This round evaluates your ability to think about systems holistically, understand trade-offs, discuss scalability and reliability patterns, and explain your design rationale clearly.
Tips & Advice
Take time to understand the requirements and constraints before jumping into design. Ask clarifying questions about scale, latency requirements, consistency requirements, and failure scenarios. Start with a simple design and incrementally add components as you identify bottlenecks. Use diagrams to communicate your design clearly. For each major component, discuss why it exists, what it does, and how it contributes to reliability and performance. Discuss trade-offs explicitly: Is this design consistent or available? Synchronous or asynchronous? Push or pull? Discuss real-world examples from your experience where similar patterns apply. Be prepared to handle 'what if' scenarios: 'What if this component fails?', 'How do you handle 10x traffic growth?'. For mid-level SREs, demonstrate solid understanding of distributed systems principles and ability to design systems that balance multiple concerns.
Focus Topics
Database Scaling Strategies
Approaches to scaling databases: replication, sharding, read replicas, and handling distributed transactions. Understand the trade-offs between different approaches and when each is appropriate. Discuss backup and disaster recovery strategies.
Practice Interview
Study Questions
Caching & Content Delivery Strategy
Different caching layers (in-process, Redis, CDN), cache invalidation strategies, and patterns like write-through, write-back, and write-around. Understand when caching helps and when it adds complexity. Discuss CDN architecture for global content distribution.
Practice Interview
Study Questions
High Availability Patterns
Architectural patterns for achieving high availability: active-active replication, automated failover, circuit breakers, retry logic with exponential backoff. Understand how to design systems that minimize downtime and recover quickly from failures.
Practice Interview
Study Questions
Distributed Systems Design
Understanding of distributed system principles: CAP theorem, eventual consistency, fault tolerance, and communication patterns. Be comfortable designing systems with multiple independent components that communicate over the network. Understand challenges like network partitions and clock synchronization.
Practice Interview
Study Questions
Scalability & Performance Architecture
Designing systems that scale horizontally to handle massive load. Understand partitioning strategies, load distribution, connection pooling, and resource management. Know how to identify and eliminate single points of failure and bottlenecks.
Practice Interview
Study Questions
On-Site Round 3: Incident Response & Operations
What to Expect
A 60-minute on-site interview focused on operational excellence, incident response, and troubleshooting. You may be asked behavioral questions about incidents you've handled, presented with complex troubleshooting scenarios, or asked how you'd approach operational challenges. The interviewer assesses your problem-solving approach, how you think under pressure, communication during incidents, and your ability to learn from failures. This round emphasizes practical operational skills and judgment.
Tips & Advice
Prepare 3-4 detailed incident examples using the STAR method: Situation (what was the incident?), Task (what were you responsible for?), Action (what did you do?), Result (what was the outcome?). Focus on complex incidents where your problem-solving and collaboration made a difference. Include metrics: How did you detect it? How quickly was it resolved? What did you learn? Be ready to discuss a past incident in detail: timeline, what you tried, dead ends you pursued, how you finally resolved it. Discuss your approach to post-incident reviews (blameless, focusing on systems improvements). Talk about how you balance incident response with preventing similar incidents. For mid-level candidates, show initiative in taking on complex troubleshooting and mentoring others during incidents.
Focus Topics
Capacity Planning & Resource Management
Understanding system resource usage patterns, forecasting growth, and ensuring sufficient capacity. Know how to balance cost with reliability. Discuss strategies for detecting resource constraints early.
Practice Interview
Study Questions
System Monitoring & Observability
Designing monitoring and observability systems that help detect and diagnose problems. Understand metrics, logs, traces, and how they work together. Know what to monitor and what alert thresholds make sense. Discuss alerting best practices (avoiding alert fatigue).
Practice Interview
Study Questions
Post-Incident Reviews
Conducting blameless post-incident reviews focused on systems improvements rather than individual blame. How to document incidents, identify action items, and drive systemic improvements. Understand how post-incident reviews support organizational learning.
Practice Interview
Study Questions
Incident Response & Troubleshooting
Systematic approach to diagnosing and resolving production incidents. Know how to identify the blast radius, isolate the problem, implement temporary mitigations, and work toward permanent solutions. Understand escalation procedures and communication protocols. Be ready to discuss complex incidents you've handled.
Practice Interview
Study Questions
Root Cause Analysis
Systematic approach to understanding why incidents occurred. Techniques for drilling down from symptoms to underlying causes. Understanding the difference between immediate causes and systemic issues. Learn to ask 'why' multiple times to find root causes and systemic improvements.
Practice Interview
Study Questions
On-Site Round 4: Behavioral & Spotify Values
What to Expect
A 60-minute on-site interview focused on behavioral assessment and cultural fit. You'll be asked about how you work in teams, handle conflicts, approach learning and growth, and align with Spotify's values. This is your opportunity to demonstrate that you're a strong collaborator, can mentor others, and embrace Spotify's culture of autonomy, experimentation, and learning. The interviewer is assessing whether you'll thrive in Spotify's environment and contribute positively to team dynamics.
Tips & Advice
Research Spotify's values and culture thoroughly before the interview. Common themes include autonomy, experimentation, learning from failure, collaboration, and ownership. Prepare 3-4 examples using the STAR method that demonstrate these values: times you took ownership, learned from failures, collaborated effectively, mentored someone, or made decisions with incomplete information. Use Spotify's language and values when describing your examples. Be specific about metrics and outcomes. Show curiosity about Spotify's approach to these values. For mid-level candidates, demonstrate mentorship and cross-functional collaboration. Discuss how you balance operational excellence with enabling others to learn. Be ready to discuss a time you failed and what you learned. Be genuine and authentic—interviewers can spot if you're just saying what you think they want to hear.
Focus Topics
Communication & Influence
Clear communication of technical concepts to both technical and non-technical audiences. Ability to influence without direct authority. Examples of explaining complex problems to stakeholders or driving changes through persuasion.
Practice Interview
Study Questions
Growth Mindset & Learning
Demonstrating curiosity and commitment to continuous learning. Examples of learning new technologies, adapting to changing requirements, or growing in your role. Discuss how you mentor junior team members or help others grow.
Practice Interview
Study Questions
Problem-Solving & Decision-Making
Your approach to complex problems with incomplete information. Examples of decisions you've made under uncertainty, how you weigh trade-offs, and how you involve others in decision-making. Show comfort with pragmatism over perfection.
Practice Interview
Study Questions
Teamwork & Collaboration
Demonstrating strong collaboration skills: working effectively with development teams, product managers, and other SREs. Examples of breaking down silos, improving communication, or bridging different teams. Discuss how you approach disagreements and build consensus.
Practice Interview
Study Questions
Spotify Values & Culture Fit
Understanding Spotify's engineering culture and values including autonomy (empowering teams to make decisions), experimentation (testing ideas and learning from failures), collaboration (breaking down silos), and ownership (taking responsibility for outcomes). Be ready to discuss how your approach aligns with these values.
Practice Interview
Study Questions
Frequently Asked Site Reliability Engineer (SRE) Interview Questions
Tell me about a time you took something you already knew and applied it somewhere it had not been used before, either in a different stack or on a different kind of problem. How did you work out what carried over and what did not, and how did you check the result was sound?
Sample Answer
Direct answer
I separate what's actually being transferred, the underlying principle, from what's incidental to the old context, the specific implementation and its defaults, and I re-verify the parts that depend on the new context's specifics rather than assuming a straight port. I check soundness by comparing the new result against an independent ground truth or the new domain's own baseline, not just against "it ran without error."
Structured elaboration
- Identify the transferable core versus the context-bound specifics. The underlying idea, an algorithm, a statistical method, a design pattern, usually carries over. The exact parameters, library defaults, and assumptions baked into the old context often don't, even when everything looks superficially the same.
- Watch for the mechanical trap. Reimplementing what looks like "the same" logic in a different toolchain can silently produce a different answer because of quiet differences in defaults: numeric precision, random seeds, how a library breaks ties, or off-by-one conventions that never mattered before because you never had to think about them.
- Watch for the conceptual trap. A method borrowed from a neighboring field brings assumptions baked into it, tuned for a particular scale, data distribution, or failure mode, that may not hold in the new one, and needs deliberate adapting rather than a straight relabel.
- Validate against something independent. A known-answer test case, an existing simpler baseline already trusted in the new domain, or a manual spot-check by someone who knows the new context well, so you're checking that the result is right, not just that it executed.
- Only trust the transfer once it holds up against the new domain's own baseline, measured on its own terms, not against the numbers you got in the old context.
Worked example
I ported a feature-engineering pipeline that had been prototyped in a small, single-machine data-analysis library over to a distributed processing toolchain meant to scale it up. I assumed the aggregation logic, grouping records and summing a value within each group, would produce identical output, since it was "the same" calculation. Before trusting it, I ran both versions on a fixed, unchanged sample and diffed the outputs directly rather than assuming a match. They disagreed slightly, and it turned out the distributed version summed floating-point numbers in a different order across its workers, which changed the result by a tiny but real amount for a few groups, and it also handled missing values differently by default than the original library had. Because I'd deliberately checked instead of trusting the port, I caught both before the new pipeline went anywhere near a real report, fixed the null handling to match intentionally, and documented the small floating-point discrepancy as expected and acceptable rather than a bug, since I understood its actual cause instead of just noticing a mismatch.
Trade-offs and pitfalls
The clearest trap is assuming "same logic, different tool" automatically means "same answer," when defaults and edge-case handling frequently differ between implementations in ways that only show up once you actually check. A close second is skipping validation because the transfer feels obvious or low-risk, which is exactly when a quiet discrepancy is most likely to go unnoticed. And carrying an assumption over from the source domain without re-examining whether it still holds, rather than deliberately adapting it, is how a borrowed method ends up quietly wrong in its new setting.
How do you define measurable acceptance criteria for a corrective action, and what verification plan confirms the fix actually reduced recurrence rather than just looking plausible on paper? Walk through an example: reducing a service's timeout rate from a higher baseline to a specific target over a defined window.
Sample Answer
Direct answer
Acceptance criteria for a corrective action should be a specific, measurable, time-boxed statement of what 'fixed' looks like, defined before the work starts, not after. A verification plan then confirms that criterion is actually met using real data, not just confidence that the fix was implemented correctly.
Structured elaboration
- Define the metric and target explicitly. Not 'reduce timeouts' but 'reduce the service's timeout rate from its current baseline to a specific target percentage, measured over a specific window.' A vague criterion can't be verified; a specific one can.
- Set a monitoring window long enough to be meaningful. Too short a window risks declaring success on noise; too long delays knowing whether the fix worked. The right window depends on the incident's natural frequency, for example enough days to capture a representative mix of peak and off-peak traffic.
- Separate short, medium, and long-term verification. Immediately after deploying the fix: a targeted test or synthetic check confirms the mechanism works as intended. Over the following weeks: real production monitoring against the target metric confirms it holds under real conditions, not just in a controlled test. Longer term: a periodic audit or scheduled re-check confirms the improvement is durable and hasn't quietly regressed.
- Define what "success" and "failure" mean numerically in advance, including what would trigger reopening the item if the target isn't met, so there's no ambiguity or motivated reasoning once the data comes in.
- Name who signs off, so verification isn't just a self-assessment by whoever implemented the fix.
Worked example
A corrective action targets reducing a service's timeout rate from 0.5% to 0.05% within 30 days. Acceptance criteria: timeout rate, measured as a 7-day rolling average, must be at or below 0.05% for two consecutive weeks within the 30-day window, using the same monitoring dashboard and definition of 'timeout' used to measure the original 0.5% baseline. Verification plan: short-term, a synthetic load test immediately after deploy confirms the fix reduces timeout rate under simulated peak load; medium-term, the real 7-day rolling average is checked weekly against the target for the full 30 days; long-term, the metric is re-checked at 90 days to confirm it hasn't quietly crept back up as traffic patterns shift. If the 30-day window ends with the metric at 0.15%, that's a defined failure, not an ambiguous 'mostly worked,' and it triggers a re-investigation of whether the fix addressed the actual root cause or only a symptom.
Trade-offs and pitfalls
The most common mistake is defining acceptance criteria loosely enough that almost any outcome can be called success, which defeats the purpose of having criteria at all. A second is skipping the longer-term recheck: many fixes look successful in the first two weeks and then quietly regress as conditions change, and without a scheduled longer-term verification, that regression goes unnoticed until the incident recurs.
What's the difference between a full rollback and a partial rollback? Give one concrete scenario where you'd choose each.
Sample Answer
Direct answer
A full rollback reverts every service or component involved in a release back to its previous version; a partial rollback reverts only some of them, leaving others on the new version. You choose partial when only some of the changed components are actually implicated in the problem and reverting the rest would be unnecessary churn or would itself introduce risk (for example, if a later component now depends on an earlier one's new behavior).
Structured elaboration
- When full rollback makes sense: a single service deployed a bad change, or several services were released together as one coupled unit where partial reversion would leave them in an inconsistent, untested combination.
- When partial makes sense: a coordinated multi-service release where only ONE service's new version is misbehaving, and the others are backward-compatible enough to keep running against either the old or new version of the problem service.
- Risk in partial rollback: you have to be confident the services you're leaving on the new version don't assume the now-reverted service's new behavior; if they do, a partial rollback trades one outage for a different, subtler one.
Worked example
Full: three tightly coupled microservices (auth, session, and API-gateway) deploy together as one release because the API gateway's new version assumes session's new token format; a bug anywhere means reverting all three together, since a partial revert would leave a token-format mismatch between them.
Partial: a release touches a recommendations service and a completely independent notifications service in the same deploy window purely for scheduling convenience; if only recommendations regresses, rolling back just that service and leaving notifications on its (unrelated, unaffected) new version is the right call, since reverting notifications too would be pure unnecessary churn.
Trade-offs and pitfalls
Partial rollback is faster and less disruptive when it's safe, but the judgment call of "is it actually safe to leave X on the new version" is exactly where mistakes happen; teams that don't explicitly map service dependencies before a coordinated release often discover the hard way, mid-incident, that two "independent" services weren't as independent as assumed.
Describe how you would debug a Heisenbug: an intermittent race condition that disappears when you add logging or run under a debugger. Provide reproducibility strategies and non-invasive instrumentation techniques that minimize perturbation of timing.
Sample Answer
Investigating a heisenbug requires accepting the standard toolkit (logging, attaching a debugger) is off the table, since both perturb the exact timing you need to observe.
Non-invasive strategies, roughly in order of overhead
- Kernel/low-level tracing (
ftrace, eBPF,perf): observe scheduling and syscall timing with far less perturbation than application-level logging, since they don't run inside the process's own critical path the same way. (ftraceis Linux's built-in kernel function tracer; eBPF lets you run small sandboxed programs inside the kernel to observe events cheaply;perfis Linux's low-overhead sampling profiler; all three watch the system from outside the process rather than adding code inside it.) - Hardware watchpoints: a CPU-level trap that fires when a specific memory address is written, letting you catch the exact write that corrupts shared state without instrumenting the code path at all.
- Record-and-replay (
rr) (Mozilla's open-source record-and-replay debugger): capture one real occurrence (including all syscalls and nondeterministic inputs) once, then replay it deterministically as many times as needed in a full debugger session, which sidesteps the observer-effect problem entirely after the initial capture. - Increase trigger probability instead of adding instrumentation: run under heavier concurrent load, or add artificial scheduling pressure (deliberately delay specific operations) to make the natural race window occur more often, without touching the code path being investigated.
Confirmed generalization
The same four techniques apply whether the observing party is a human with a debugger, or an application's own logging framework: anything that runs synchronously in the critical section changes its timing. This is why four independent worked cases across roles (SRE, general engineering, systems engineering, QA) all converge on the same toolset: rr/record-and-replay, kernel-level tracing (ftrace/eBPF), perf sampling, and GDB used only against a replayed/captured session rather than the live race.
Trade-offs and pitfalls
These tools have a real learning curve and setup cost (eBPF and rr both require specific kernel/OS support and practice); the payoff is a heisenbug that would otherwise burn days of guess-and-check becomes a captured, replayable artifact you can step through as many times as needed, which is usually worth the setup cost for anything that recurs.
In a system with caches, a primary database, and a search index (e.g., Elasticsearch), describe common consistency pitfalls when updating entities (for example user profile changes). Propose an ordered update workflow that minimizes stale reads across layers and supports failure recovery, and explain trade-offs involved.
Sample Answer
Direct answer
When a cache, a primary database, and a search index all hold a copy of the same entity, an update has to reach all three, and the order they are updated in determines what inconsistent intermediate state a concurrent reader might see; design the update sequence deliberately rather than firing updates to all three independently.
Structured elaboration
- The core pitfall: three independent copies means three independent chances to be out of sync at any given moment; a naive "update DB, then update cache, then update search index" sequence has a window after each step where a reader hitting a different layer sees a different, momentarily-inconsistent view of the same entity.
- An ordered update workflow: write to the primary database first (the source of truth), then propagate to the cache and search index, ideally via the same mechanism (an event derived from the database's own write, e.g., change data capture, CDC) rather than the application independently, and possibly inconsistently, updating each one itself.
- Minimizing stale reads across layers: invalidate (or update) the cache promptly after the database write; the search index, which is often inherently eventually consistent by nature (indexing takes measurable time), should be treated with a wider, explicitly acknowledged staleness tolerance rather than expected to match the database's freshness.
- Failure recovery: if the propagation to the cache or search index fails partway (the database write succeeded but the cache invalidation did not), the system needs to detect and correct that drift, either via a reconciliation job that periodically compares layers, or by treating the CDC-based propagation as the single source of truth for keeping all downstream copies in sync (so a failure there is a well-understood, monitorable gap, not a silent one).
- Trade-offs involved: driving every downstream update from the database's own change stream (rather than each application code path independently updating cache and search index) is more work to set up but eliminates entire classes of "we updated the DB and cache but forgot the search index in this one code path" bugs.
Worked example
A user profile update: the database write succeeds; a CDC-derived event then triggers both a cache invalidation and a search-index update. A reader hitting the cache immediately after the database write (before the CDC event has propagated) sees a brief stale read from the cache, bounded by the CDC pipeline's typical propagation latency (often under a second); a search query against the index during that same window might return the OLD profile data in search results for slightly longer, since indexing itself typically has its own additional latency beyond simple cache invalidation, an acceptable, well-understood difference in staleness across layers as long as it is explicit and monitored.
Trade-offs and pitfalls
Independently updating cache and search index from application code (rather than from a single CDC-derived event stream) is a common source of "we forgot this one code path" bugs, where some write paths correctly update all three layers and others silently miss one; centralizing propagation removes that class of bug at the cost of needing CDC infrastructure. Treating all downstream layers as needing the SAME freshness guarantee is usually wrong; a search index's inherent indexing latency is a different, and typically wider, staleness budget than a cache's invalidation latency, and conflating the two leads to either wasted effort over-optimizing the index or an unrealistic freshness expectation for it.
Write a Bash script that securely accepts a filename parameter from a user and ensures it does not escape a predefined base directory (prevent directory traversal). The script should handle symlinks safely (i.e., ensure the resolved path stays inside the base directory) and explain limitations such as TOCTOU races and potential mitigations.
Sample Answer
Approach: canonicalize both the configured BASE_DIR and the user-supplied path (resolving symlinks) and verify the resolved path is a descendant of BASE_DIR. Note: strict prevention of TOCTOU and symlink races requires kernel-level flags (O_NOFOLLOW) or openat-based checks; a pure Bash script is best-effort and must be paired with safer helpers for production.
#!/usr/bin/env bash
set -euo pipefail
BASE_DIR="/srv/app/data" # trusted base directory (absolute)
usage() { echo "Usage: $0 <relative-or-absolute-filename>"; exit 2; }
[ $# -eq 1 ] || usage
user_input="$1"
Resolve canonical absolute path of base (no trailing slash)
base_canon="$(realpath -m -- "$BASE_DIR")"
Resolve the user path relative to BASE_DIR if not absolute
if [[ "$user_input" != /* ]]; then
candidate="$base_canon/$user_input"
else
candidate="$user_input"
fi
Resolve symlinks and get canonical path; fail if doesn't exist
if ! target_canon="$(realpath -- "$candidate" 2>/dev/null)"; then
echo "Error: target does not exist or cannot be resolved" >&2
exit 3
fi
Ensure target is inside base (prefix check)
case "$target_canon" in
"$base_canon" | "$base_canon"/*)
;;
*)
echo "Error: path escapes base directory" >&2
exit 4
;;
esac
Safe action example: open for read-only and print first lines
Note: this still follows symlink at open time; see limitations below.
if [ -f "$target_canon" ]; then
echo "Opening: $target_canon"
head -n 10 -- "$target_canon"
else
echo "Error: not a regular file" >&2
exit 5
fi
Key points and limitations:
- We use realpath to Canonicalize (resolving .. and symlinks) and a prefix check to ensure containment.
- TOCTOU race: an attacker can swap symlinks between the time you resolve path and the time you open it. Bash and realpath can't prevent this atomically.
- Symlink / open races: opening the resolved path may still follow a different symlink if attacker replaces targets after resolution.
Mitigations:
- Prefer using low-level APIs: openat2/openat + O_NOFOLLOW | O_CLOEXEC, fstat to verify inode/device, or implement in C/Go/Python using os.open with O_NOFOLLOW and fstat comparisons.
- Use a sandboxed helper running with reduced privileges (chroot, user namespace) or run the operation as a dedicated unprivileged user with the base directory as its root.
- If possible, keep filenames immutable (only administrators can create/delete in BASE_DIR) and audit/write-protect directories.
- For critical paths, perform checks and open using the same tool that supports atomic flags (e.g., a small C helper).
After a TCP connection closes, the socket that initiated the close sits in TIME_WAIT for a period before the port is reusable. Explain why TIME_WAIT exists, what a half-open connection is, and how you would detect an unusually large number of sockets stuck in TIME_WAIT on a busy server. What are the trade-offs of the common mitigations for socket exhaustion caused by this?
Sample Answer
Direct answer
TIME_WAIT is the state the side that sent the FINAL ACK of a connection close sits in for a fixed period (commonly twice the maximum expected segment lifetime, often around 60 seconds on Linux) before the connection's resources are fully released. It exists so a delayed, duplicate packet from an old connection can't be mistaken for part of a brand-new connection reusing the same address/port pair. A half-open connection is one where only one side still believes the connection is alive; the other side has already reset, crashed, or otherwise abandoned it without a clean FIN exchange.
Structured elaboration
TIME_WAIT exists to protect two things: (1) it guarantees the final ACK the closing side sent actually gets through, by giving time to retransmit it if the peer's FIN gets retransmitted (meaning the ACK was lost); (2) it prevents a stray, delayed packet from a previous incarnation of a connection (same 4-tuple: source IP, source port, destination IP, destination port) from being delivered into a brand new connection that happens to reuse the same 4-tuple before the old segments have had time to disappear from the network.
To detect a large number of sockets stuck in TIME_WAIT on Linux, ss -tan state time-wait | wc -l (or the older netstat -ant | grep TIME_WAIT | wc -l) gives a live count; watching this metric over time distinguishes a normal, self-draining backlog from a genuine problem.
Worked example
A server that closes millions of short-lived outbound connections per hour (for instance, a service making one HTTP call per request to an upstream) can exhaust its available ephemeral source ports if TIME_WAIT sockets accumulate faster than they expire, because each TIME_WAIT socket still holds its port reserved. The two standard mitigations are: raise the number of available client-side (ephemeral) ports and/or reuse connections via keepalive/connection pooling so fewer connections churn through TIME_WAIT in the first place; and, on the SERVER side specifically, enabling SO_REUSEADDR and, where safe, tcp_tw_reuse lets a new outgoing connection reuse a TIME_WAIT 4-tuple once TCP timestamps confirm it's safe to do so, rather than waiting out the full timer.
Trade-offs & pitfalls
Disabling or drastically shortening TIME_WAIT globally (rather than tuning port ranges or reuse settings) is the wrong fix: it reintroduces the exact correctness problem TIME_WAIT was designed to prevent, stray old packets landing in a new connection and corrupting it. The safe levers are reducing HOW MANY connections churn through the state (pooling, keepalive) and widening the ephemeral port range, not shrinking the safety window itself.
Describe how GPU provisioning works in Kubernetes using node labeling, device plugins, and resource requests. Provide a minimal example YAML snippet for a pod that requests one NVIDIA GPU. Explain what must be present in the cluster (device plugin, NVIDIA runtime) for scheduling to succeed.
Sample Answer
GPU scheduling in Kubernetes works through three cooperating pieces: the device plugin framework, a kubelet-side extension mechanism that advertises non-standard hardware as an allocatable resource, the resulting extended resource name a pod requests, and optional node labels used for affinity. None of it works out of the box; the cluster needs a working NVIDIA driver, a GPU-aware container runtime, and the NVIDIA device plugin running before any pod can actually get scheduled onto a GPU.
How the pieces fit together
- Node prerequisites. Every GPU node needs the NVIDIA driver installed at the kernel level, and the container runtime, containerd or CRI-O, since Docker itself was removed as a supported Kubernetes container runtime in version 1.24, configured with the NVIDIA Container Toolkit so a container can actually use the device, not just have it requested.
- Device plugin. The NVIDIA device plugin runs as a DaemonSet, one copy per GPU node, and registers with the kubelet over the device plugin API, advertising each GPU as a unit of the extended resource
nvidia.com/gpu. Only after this registration doeskubectl describe nodeshownvidia.com/gpuunder that node's allocatable resources. - Resource request. A pod requests a GPU the same way it requests CPU or memory, by naming the extended resource under
resources.limits. GPUs are requested as a whole-number limit, not split fractionally the way CPU can be; a container either gets a whole GPU or none. - Node labels. Labels such as
nvidia.com/gpu.presentor a GPU-model label are typically populated automatically by an NVIDIA feature-discovery component (part of the NVIDIA GPU Operator), not applied by hand; they exist so a pod can usenodeSelectoror node affinity to target GPU-capable nodes, or a specific GPU generation, rather than relying on the extended-resource request alone to imply placement.
Minimal pod requesting one GPU
apiVersion: v1
kind: Pod
metadata:
name: gpu-pod
spec:
containers:
- name: cuda-test
image: nvidia/cuda:12.4.1-base-ubuntu22.04
resources:
limits:
nvidia.com/gpu: 1
Worked example: why a GPU request can go Pending
Suppose kubectl describe node gpu-node-1 shows the following, an illustrative example rather than a live cluster:
Capacity:
nvidia.com/gpu: 4
Allocatable:
nvidia.com/gpu: 4
Allocated resources:
Resource Requests Limits
-------- -------- ------
nvidia.com/gpu 3 3
Free capacity on this node is
4−3=1
GPU. A new pod requesting nvidia.com/gpu: 2 cannot fit here even though the node exists and is healthy; if it is the only GPU node, or the only one with free capacity, the pod stays Pending, and kubectl describe pod on it shows an Insufficient nvidia.com/gpu scheduling event, the extended-resource equivalent of the far more common insufficient-CPU or insufficient-memory Pending cause.
Trade-offs and pitfalls
- Whole-GPU requests only: unlike CPU, a container cannot request half a GPU through the base device plugin; workloads that only need a fraction of a GPU's capacity either waste the rest or need NVIDIA's Multi-Instance GPU (MIG) partitioning on hardware that supports it, current-generation data-center GPUs, which exposes each partition as its own schedulable unit.
- Forgetting a node label, when policy requires one, while the device plugin resource is present still lets the pod schedule anywhere with free
nvidia.com/gpucapacity, which is not always the intended node if a cluster mixes GPU generations. - This is a genuinely narrow, machine-learning-infrastructure-specific mechanism; a general Kubernetes operations interview is unlikely to probe device plugins in depth, but it is a real and common question in ML-platform-focused loops.
You're responsible for optimizing NFS performance for a build farm that has many small file reads. What kernel-level and mount-option settings would you consider changing on the client and server to improve throughput and reduce latency? Explain trade-offs.
Sample Answer
Goal: optimize many small-file reads for build farm.
Client-side mount options:
- Use NFSv4 or v4.1 with async read caching: mount -o rsize=131072,wsize=131072,async,noatime,actimeo=1
- Enable attribute caching tuning: actimeo lower for consistency trade-off or set noac to reduce stale reads (but increases server load).
Server-side/kernel-level: - Increase nr_open/file-max and RPC thread pools (rpc.nfsd threads) to handle many concurrent ops: echo 64 > /proc/fs/nfsd/threads
- Use aio and increase readahead for metadata-heavy workloads: echo 128 > /sys/block/<device>/queue/read_ahead_kb
- Ensure NFS server uses XFS ext4 with tuned inode/cache settings; increase dentry cache (vm.vfs_cache_pressure) and inode cache sizes.
Other strategies: - Use FS cache (cachefilesd) or memcached-based caching (fs-cache) to reduce RPCs for small files.
- Consider using a distributed object cache (s3/ceph) or copy local caches on build nodes (ccache) to avoid repeated small reads.
Trade-offs: increasing caching speeds builds but risks stale data; async and larger readahead improves throughput but can increase memory and harm consistency. Best practice: measure with iostat, nfsstat, and tune incrementally; prefer local caching layers for small files.
Design global traffic routing across three regions so that when one region fails, traffic redirects to a healthy region within about a minute for most clients. Walk through your health-check and DNS/load-balancer configuration, and what happens to long-lived connections during the cutover.
Sample Answer
Direct answer
Meeting a roughly 60-second reroute target for most clients means combining health-check-driven DNS failover (to redirect clients as they re-resolve) with Anycast routing at the network layer (to redirect clients immediately, independent of DNS caching behavior), because DNS alone can't guarantee a hard bound once client-side resolver caching is accounted for.
Architecture
flowchart TD
Client -->|Anycast IP| Edge[Anycast Edge and CDN]
Edge --> GSLB[GSLB Health-Aware DNS]
GSLB -->|healthy| R1[Region 1]
GSLB -->|healthy| R2[Region 2]
GSLB -->|healthy| R3[Region 3]
HC[Active Health Checkers] -->|probe every 5s| R1
HC -->|probe every 5s| R2
HC -->|probe every 5s| R3
HC -->|update after 3 consecutive fails| GSLB
R1 -.fails.-> HC
GSLB (Global Server Load Balancing, shown in the diagram) is DNS that returns different regional IPs depending on which regions are currently healthy, the mechanism the DNS/load-balancer layer below relies on.
Health checks: active probes (HTTP and TCP, from multiple external vantage points) hit each region every 5 seconds, requiring 3 consecutive failures before a region is marked unhealthy, to avoid flapping on a single transient blip.
DNS/load-balancer configuration: authoritative DNS TTL for the service record is set low, 30 seconds, so clients that honor TTLs re-resolve quickly after a region is marked unhealthy. Anycast IPs are advertised from all three regions simultaneously; when a region fails, its BGP (Border Gateway Protocol: the protocol that advertises which network paths lead to a given IP address) announcement is withdrawn, which reroutes traffic to a healthy region at the network layer almost immediately, without waiting on any client's DNS cache to expire at all.
Worked example: does this hit the 60-second target?
Detection time, the health checker's confirmation that a region is actually down:
tdetect=5×3=15 sFor clients relying on DNS re-resolution, the worst case adds the full TTL window on top of detection, since a client could have just refreshed its cache right before the failure:
tworst=15+30=45 s≤60 s target (15 s margin)That leaves 15 seconds of margin against the 60-second target for clients that honor the TTL correctly, covering the large majority of traffic (public recursive resolvers like major DNS providers generally respect low TTLs closely). For the remaining slice of clients behind resolvers that cache more aggressively than the stated TTL (some enterprise resolvers and certain mobile carrier networks), the Anycast BGP withdrawal is what actually gets them under the target: it operates at the network layer and doesn't depend on DNS caching behavior at all, so those clients are rerouted within the same roughly 15-second detection window, not the 45-second DNS-bound one. Combining the two mechanisms is what makes hitting the target for "most clients" (rather than only the well-behaved subset) achievable.
Long-lived connections during cutover
Neither DNS re-resolution nor an Anycast BGP withdrawal preserves an existing TCP connection or WebSocket session that was already established to the failed region; a BGP route change mid-flow actually breaks those connections rather than gracefully migrating them, since the new route doesn't carry the old connection's state. Clients holding long-lived connections need their own reconnect logic (detect the drop, re-resolve or reconnect, resume from the new region) and any in-flight request that was interrupted needs to be safely retryable, which pushes the requirement for idempotent write handling on the server side, since a client that reconnects and retries an interrupted request must not have that retry double-process the original attempt.
Trade-offs & pitfalls
A lower DNS TTL improves worst-case failover time but increases query volume against the authoritative DNS servers and, for high-traffic services, real cost; 30 seconds is a reasonable middle ground rather than pushing to something extremely aggressive like 5 seconds. Anycast gives fast, DNS-independent failover but requires BGP-level control over IP announcements, which is a meaningfully bigger operational lift than DNS alone and isn't available on every cloud platform without specific networking products. The most common mistake in this kind of design is validating the 60-second target only against health-check and DNS timers on paper, without ever measuring how real clients across different resolver populations actually behave in practice, which is the only way to know the theoretical margin actually holds up.
Recommended Additional Resources
- Designing Data-Intensive Applications by Martin Kleppmann - comprehensive coverage of distributed systems, databases, and scalability
- The Site Reliability Engineering Book by Google - foundational SRE principles and practices used industry-wide
- Release It! by Michael Nygard - practical patterns for building reliable systems
- System Design Interview by Alex Xu - detailed guide to system design problems and solutions
- Grokking System Design Interview - interactive platform for practicing system design problems
- Spotify Engineering Blog - insights into Spotify's technical decisions and architecture approaches
- GitHub Open Source Projects - study reliable systems: etcd, Kubernetes, Prometheus, and other infrastructure tools
- Production Readiness Review guides - checklists for ensuring operational excellence
- LeetCode System Design section - practice problems to prepare for design interviews
- AWS Well-Architected Framework - principles for designing reliable, secure, performant, and cost-effective systems
- Linux Academy / Pluralsight - hands-on Linux and infrastructure courses
- Kubernetes Official Documentation - container orchestration increasingly relevant for SREs
- Incident Response Best Practices - study post-incident reviews and blameless culture frameworks
Search Results
The 2025 Spotify Software Engineer interview guide | Prepfully
The Spotify Software Engineer interview process can take anywhere from 1 to 3 months, and consists of 4-5 main rounds that assess various aspects of the ...
Service Reliability Engineer Interview Experience - Spotify - Taro
Spotify's interview process for their Service Reliability Engineer roles are extremely selective, failing the vast majority of engineers.
Spotify System Design Interview: The Complete Guide
Master Spotify System Design interview questions with this detailed guide. Learn catalogs, search, streaming, caching, and mock interview ...
Spotify Software Engineer Interview Guide | Sample Questions (2025)
The interview process at Spotify is typically between 2–5 weeks, with some higher-level or international candidates mentioning waiting around 2 months to hear a ...
Spotify Site Reliability Engineer Interview Questions - NodeFlair
Our tool generates tailored interview questions based on your industry, role, and experience. Practice and receive feedback on your answers in real time!
Site Reliability Engineering Interview Questions - MentorCruise
Master your next Site Reliability Engineering interview with our comprehensive collection of questions and expert-crafted answers.
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.
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