Home Interview Linux & SRE Interview Questions: Advanced DevOps Guide
Advanced 3 min · July 13, 2026

Linux & SRE Interview Questions: Advanced DevOps Guide

Master Linux and SRE interview questions with real-world scenarios, debugging guides, and production incident analysis.

N
Naren Founder & Principal Engineer

20+ years shipping production code across the stack, with years spent interviewing engineers. Everything here is grounded in real deployments.

Follow
Production
production tested
July 13, 2026
last updated
2,165
articles · all by Naren
Before you start⏱ 20-25 min read
  • Basic knowledge of Linux command line and system administration.
  • Familiarity with DevOps concepts and tools like Docker, Kubernetes.
  • Understanding of monitoring and alerting fundamentals.
 ● Production Incident 🔎 Debug Guide ⚙ Triage Commands
Quick Answer
  • Master Linux system internals: processes, memory, filesystems, and networking.
  • Understand SRE principles: SLIs, SLOs, error budgets, and incident management.
  • Practice debugging production issues using strace, perf, and systemd.
  • Be ready to explain trade-offs in reliability vs. feature velocity.
  • Know common interview questions on load balancing, logging, and monitoring.
✦ Definition~90s read
What is Linux and SRE Interview Questions?

Linux and SRE interview questions test your ability to manage and troubleshoot Linux systems and apply reliability engineering principles to keep services running smoothly.

Think of Linux as the engine of a car and SRE as the pit crew.
Plain-English First

Think of Linux as the engine of a car and SRE as the pit crew. Linux interview questions check if you know how the engine works—how to start it, fix it, and tune it. SRE questions check if you can keep the car running smoothly during a race, handle crashes, and make sure the driver (user) has a great experience. You need both skills to be a top DevOps engineer.

Linux and Site Reliability Engineering (SRE) are the backbone of modern DevOps. In an interview, you'll be tested not just on commands but on deep understanding of system internals, troubleshooting methodologies, and reliability principles. This guide covers advanced topics like process management, memory analysis, filesystem debugging, networking, and SRE concepts such as SLIs, SLOs, error budgets, and incident response. We'll walk through real interview questions with solutions, production incidents, and debugging cheat sheets. By the end, you'll be ready to ace any Linux or SRE interview and demonstrate your ability to keep large-scale systems reliable.

1. Linux Process Management

Process management is a core Linux interview topic. You need to understand process states, signals, and how to troubleshoot. Common questions: 'How do you find a process using the most memory?' or 'What is a zombie process and how do you fix it?' Use ps, top, htop, and /proc filesystem. For example, to list top memory consumers: ps aux --sort=-%mem | head. A zombie process is a child that has terminated but its parent hasn't reaped it. You can kill the parent or send SIGCHLD. In an interview, explain the process lifecycle: fork, exec, wait. Also discuss signals like SIGTERM, SIGKILL, and SIGSTOP. Practical tip: Use strace to trace system calls of a process. Example: strace -p 1234 -e trace=network to see network calls.

process_monitor.shBASH
1
2
3
4
5
6
7
8
9
#!/bin/bash
# Find top CPU consuming processes
ps -eo pid,ppid,cmd,%cpu,%mem --sort=-%cpu | head -10

# Check for zombie processes
ps aux | awk '{if ($8 == "Z") print $0}'

# Trace system calls of a process (replace PID)
strace -p 1234 -e trace=open,read,write 2>&1 | head -20
Output
PID PPID CMD %CPU %MEM
1234 1 /usr/bin/python3 45.2 2.1
5678 1234 /usr/bin/python3 12.3 1.5
...
💡Interview Tip
📊 Production Insight
In production, a process stuck in D state can cause load spikes. Check dmesg for I/O errors.
🎯 Key Takeaway
Master ps, top, strace, and /proc to debug processes. Understand zombie and orphan processes.

2. Memory Management and Analysis

Memory issues are common in production. Interviewers ask: 'How do you check memory usage?' or 'What is swap and when is it used?' Use free -m, vmstat, and /proc/meminfo. Understand the difference between virtual and resident memory. A memory leak can be detected by monitoring top over time. Use pmap -x PID to see memory mapping. In an interview, explain the OOM killer: when memory is exhausted, the kernel kills a process based on oom_score. You can adjust oom_score_adj to protect critical services. Example: echo -1000 > /proc/PID/oom_score_adj. Also discuss swap: swap is used when physical memory is full. High swap usage indicates memory pressure. Use swapon --show to see swap usage.

memory_check.shBASH
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
# Check memory usage
echo "=== Memory Usage ==="
free -h

# Check swap usage
echo "=== Swap ==="
swapon --show

# Top memory consuming processes
echo "=== Top Memory Processes ==="
ps aux --sort=-%mem | head -5

# Detailed memory map for a process (replace PID)
# pmap -x 1234 | tail -20
Output
total used free shared buff/cache available
Mem: 15Gi 10Gi 1.2Gi 0.5Gi 3.8Gi 4.0Gi
Swap: 2.0Gi 0.5Gi 1.5Gi
...
⚠ Common Pitfall
📊 Production Insight
Set up alerts on memory usage trends. Use oom_score_adj to protect critical services from being killed.
🎯 Key Takeaway
Monitor memory with free, vmstat, and pmap. Understand OOM killer and swap behavior.

3. Filesystem and Disk Management

Filesystem questions test your knowledge of disk usage, inodes, and mount points. Common: 'How do you find large files?' or 'What is an inode?' Use df -h for disk usage, du -sh * for directory sizes, and ls -i for inode numbers. To find files older than 30 days: find / -type f -mtime +30. Understand filesystem types: ext4, XFS, Btrfs. In an interview, discuss the difference between hard links and soft links. Hard links share the same inode; soft links are pointers. Also discuss lsof to find open files. Example: lsof | grep deleted shows files that are deleted but still held open, causing disk space not to be freed.

disk_usage.shBASH
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
# Check disk usage
echo "=== Disk Usage ==="
df -h

# Find large files (>100MB)
echo "=== Large Files ==="
find / -type f -size +100M -exec ls -lh {} \; 2>/dev/null

# Check inode usage
echo "=== Inode Usage ==="
df -i

# Find open deleted files
echo "=== Open Deleted Files ==="
lsof | grep deleted
Output
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 40G 10G 80% /
...
🔥Did You Know?
📊 Production Insight
In production, a full disk can cause service outages. Set up disk usage alerts at 80% and 90%.
🎯 Key Takeaway
Use df, du, find, and lsof for disk troubleshooting. Understand inodes and links.

4. Networking Fundamentals

Networking is critical for SRE. Interviewers ask: 'How do you check listening ports?' or 'How do you troubleshoot connectivity issues?' Use ss -tlnp to see listening TCP ports, netstat (deprecated but still used), and tcpdump for packet capture. Understand the OSI model and TCP/IP stack. Common tools: ping, traceroute, mtr, nslookup, dig. For performance, use iperf to test bandwidth. In an interview, explain how to check for packet loss: netstat -s | grep -i loss. Also discuss socket states: LISTEN, ESTABLISHED, TIME_WAIT. Many TIME_WAIT sockets can indicate connection pooling issues. Example: ss -s shows socket statistics.

network_check.shBASH
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
# Check listening ports
echo "=== Listening Ports ==="
ss -tlnp

# Check socket statistics
echo "=== Socket Stats ==="
ss -s

# Capture packets on port 80 (run with sudo)
# tcpdump -i eth0 port 80 -c 10

# Test connectivity
echo "=== Ping Test ==="
ping -c 4 google.com
Output
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 0.0.0.0:80 0.0.0.0:*
...
💡Interview Tip
📊 Production Insight
High number of TIME_WAIT sockets can exhaust ephemeral ports. Tune net.ipv4.tcp_tw_reuse and tcp_tw_recycle (deprecated).
🎯 Key Takeaway
Master ss, tcpdump, and ping. Understand socket states and packet loss detection.

5. Systemd and Service Management

Modern Linux uses systemd. Interviewers ask: 'How do you create a systemd service?' or 'How do you view logs?' Use systemctl to manage services: systemctl start|stop|restart|status. Logs are viewed with journalctl. Example: journalctl -u nginx -f to follow logs. Understand unit files: location /etc/systemd/system/. A simple service file includes [Unit], [Service], [Install] sections. In an interview, explain the difference between Type=simple and Type=forking. Also discuss dependencies: After=network.target. For debugging, use systemd-analyze blame to see boot time.

myapp.serviceBASH
1
2
3
4
5
6
7
8
9
10
11
12
13
[Unit]
Description=My Custom Application
After=network.target

[Service]
Type=simple
User=myapp
ExecStart=/usr/local/bin/myapp
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
🔥Systemd Tips
📊 Production Insight
Set Restart=always for critical services. Use RestartSec to avoid rapid restart loops.
🎯 Key Takeaway
Know systemctl and journalctl. Understand unit file structure and service types.

6. SRE Principles: SLIs, SLOs, and Error Budgets

SRE interviews focus on reliability metrics. SLI (Service Level Indicator) is a measurement, e.g., latency. SLO (Service Level Objective) is a target, e.g., 99.9% of requests under 200ms. Error budget is the allowed failure: 1 - SLO. Interviewers ask: 'How do you define an SLO?' or 'What happens when error budget is exhausted?' Explain that error budget is a tool to balance reliability and feature velocity. When budget is exhausted, development slows down to focus on reliability. Use monitoring tools like Prometheus to track SLIs. Example: latency SLI = p99 latency. In an interview, discuss trade-offs: tighter SLO means less room for error but higher reliability.

slo_calculation.pyPYTHON
1
2
3
4
5
6
7
# Example: Calculate error budget
slo = 0.999  # 99.9%
error_budget = 1 - slo  # 0.001 (0.1%)
# For a 30-day window:
total_seconds = 30 * 24 * 3600
allowed_failure_seconds = total_seconds * error_budget
print(f"Allowed downtime: {allowed_failure_seconds} seconds ({allowed_failure_seconds/60:.1f} minutes)")
Output
Allowed downtime: 2592.0 seconds (43.2 minutes)
💡Interview Tip
📊 Production Insight
Use burn rate alerts to detect when error budget is being consumed too fast. Example: 5% budget consumed in 1 hour.
🎯 Key Takeaway
Understand SLI, SLO, error budget. Explain how they drive reliability decisions.

7. Incident Management and Postmortems

SREs handle incidents. Interviewers ask: 'Describe your incident response process.' or 'What is a blameless postmortem?' Explain the stages: detection, response, mitigation, resolution, follow-up. Use tools like PagerDuty for alerting. A blameless postmortem focuses on system failures, not people. Example: 'The deployment caused a config error; we added automated validation.' In an interview, emphasize communication: status updates, escalation paths. Also discuss runbooks: documented procedures for common incidents. Use incident.io or similar.

incident_response.shBASH
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Example: Quick incident checklist
# 1. Acknowledge alert
# 2. Assess severity
# 3. Communicate status
# 4. Mitigate (rollback, scale up, etc.)
# 5. Root cause analysis
# 6. Postmortem

echo "Incident response steps:"
echo "1. Acknowledge"
echo "2. Assess"
echo "3. Communicate"
echo "4. Mitigate"
echo "5. RCA"
echo "6. Postmortem"
Output
Incident response steps:
1. Acknowledge
2. Assess
3. Communicate
4. Mitigate
5. RCA
6. Postmortem
⚠ Common Mistake
📊 Production Insight
Automate incident response with ChatOps (e.g., Slack bots) to reduce time-to-acknowledge.
🎯 Key Takeaway
Know incident response stages and blameless culture. Practice writing postmortems.

8. Monitoring and Alerting

Monitoring is key. Interviewers ask: 'What metrics do you monitor?' or 'How do you set up alerts?' Use Prometheus for metrics, Grafana for dashboards, and Alertmanager for alerts. Understand the four golden signals: latency, traffic, errors, saturation. Example: alert on p99 latency > 500ms for 5 minutes. In an interview, discuss alert fatigue: too many alerts cause desensitization. Use proper thresholds and aggregation. Also discuss logging: ELK stack (Elasticsearch, Logstash, Kibana) or Loki. Structured logging helps in debugging.

prometheus_alert.ymlYAML
1
2
3
4
5
6
7
8
9
10
groups:
  - name: example
    rules:
      - alert: HighLatency
        expr: histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m])) > 0.5
        for: 5m
        labels:
          severity: critical
        annotations:
          summary: "High latency detected"
🔥Golden Signals
📊 Production Insight
Use multi-window, multi-burn-rate alerts for SLO-based alerting.
🎯 Key Takeaway
Understand Prometheus, Grafana, and alerting. Avoid alert fatigue with proper thresholds.
● Production incidentPOST-MORTEMseverity: high

The Silent Memory Leak That Took Down a Microservice

Symptom
Users reported intermittent timeouts; pods were being OOMKilled every few hours.
Assumption
The developer assumed it was a traffic spike and scaled up replicas.
Root cause
A Python service had a memory leak due to unclosed database connections in a background thread.
Fix
Added connection pooling and ensured connections were closed in finally blocks. Also added memory monitoring with alerts.
Key lesson
  • Always monitor memory usage trends, not just spikes.
  • Use tools like top, ps, and /proc/meminfo to identify leaks.
  • Implement proper resource cleanup in code.
  • Set up alerts on OOMKill events.
  • Use load testing to simulate long-running scenarios.
Production debug guideSymptom to Action5 entries
Symptom · 01
High CPU usage on a server
Fix
Run top or htop to find the process. Use perf top to see kernel/hot functions. Check for infinite loops or high context switching.
Symptom · 02
Out of memory (OOM) kills
Fix
Check dmesg | grep -i oom for OOM killer logs. Use free -m and vmstat to see memory usage. Identify process with ps aux --sort=-%mem.
Symptom · 03
Disk I/O bottleneck
Fix
Use iostat -x 1 to see I/O stats. Identify processes with iotop. Check for swap usage with swapon --show.
Symptom · 04
Network latency or packet loss
Fix
Use ping, traceroute, and mtr to diagnose. Check netstat -s for errors. Use tcpdump to capture packets.
Symptom · 05
Service unresponsive
Fix
Check systemd logs with journalctl -u servicename. Use strace -p PID to see system calls. Verify port listening with ss -tlnp.
★ Quick Debug Cheat SheetCommon symptoms and immediate actions for Linux/SRE issues.
Process stuck (zombie)
Immediate action
Identify zombie PID with `ps aux | grep Z`
Commands
kill -SIGCHLD <parent_pid>
If that fails, kill parent process
Fix now
Restart parent service
Disk full+
Immediate action
Run `df -h` to see usage
Commands
du -sh /* | sort -rh | head -10
Find large files with `find / -type f -size +100M`
Fix now
Delete unnecessary files or extend disk
High load average+
Immediate action
Run `uptime` and `top`
Commands
ps -eo pid,ppid,cmd,%cpu,%mem --sort=-%cpu | head
Check I/O wait with `iostat -x 1`
Fix now
Kill or renice offending process
Service not starting+
Immediate action
Check systemd status: `systemctl status servicename`
Commands
journalctl -xe -u servicename
Check config syntax with service-specific command
Fix now
Fix config file and restart
ToolPurposeExample Command
topReal-time process monitoringtop -o %MEM
psSnapshot of processesps aux --sort=-%cpu
straceTrace system callsstrace -p PID -e trace=network
ssSocket statisticsss -tlnp
journalctlSystemd logsjournalctl -u nginx -f
⚙ Quick Reference
8 commands from this guide
FileCommand / CodePurpose
process_monitor.shps -eo pid,ppid,cmd,%cpu,%mem --sort=-%cpu | head -101. Linux Process Management
memory_check.shecho "=== Memory Usage ==="2. Memory Management and Analysis
disk_usage.shecho "=== Disk Usage ==="3. Filesystem and Disk Management
network_check.shecho "=== Listening Ports ==="4. Networking Fundamentals
myapp.service[Unit]5. Systemd and Service Management
slo_calculation.pyslo = 0.999 # 99.9%6. SRE Principles
incident_response.shecho "Incident response steps:"7. Incident Management and Postmortems
prometheus_alert.ymlgroups:8. Monitoring and Alerting

Key takeaways

1
Master Linux process, memory, filesystem, and networking debugging tools.
2
Understand SRE principles
SLIs, SLOs, error budgets, and incident management.
3
Practice with real-world scenarios
strace, perf, systemd, and monitoring stacks.
4
Be ready to explain trade-offs and demonstrate systematic troubleshooting.

Common mistakes to avoid

3 patterns
×

Using `netstat` instead of `ss`

×

Ignoring OOM killer logs

×

Setting too many alerts

INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01SENIOR
Explain the Linux boot process from BIOS to systemd.
Q02SENIOR
How would you debug a high load average on a server?
Q03JUNIOR
What is the difference between a hard link and a soft link?
Q04SENIOR
How do you set up a systemd service that restarts on failure?
Q05SENIOR
Explain the four golden signals of monitoring.
Q01 of 05SENIOR

Explain the Linux boot process from BIOS to systemd.

ANSWER
The boot process: 1) BIOS/UEFI initializes hardware and loads bootloader (GRUB). 2) Bootloader loads kernel and initramfs. 3) Kernel initializes devices, mounts root filesystem, and starts init process (PID 1). 4) systemd runs default target units, starting services. Key points: GRUB configuration, kernel parameters, systemd targets.
FAQ · 3 QUESTIONS

Frequently Asked Questions

01
What is the difference between a zombie process and an orphan process?
02
How do you find which process is using a specific port?
03
What is an error budget and how is it used?
N
Naren Founder & Principal Engineer

20+ years shipping production code across the stack, with years spent interviewing engineers. Everything here is grounded in real deployments.

Follow
Verified
production tested
July 13, 2026
last updated
2,165
articles · all by Naren
🔥

That's DevOps Interview. Mark it forged?

3 min read · try the examples if you haven't

Previous
Prometheus and Grafana Interview Questions
8 / 9 · DevOps Interview
Next
Ansible Interview Questions