CareerByteCode
ByteBlogby CareerByteCode

SRE Interview Questions Answered with Hands-On Labs

What you build: 8 SRE interview answers proved on one Linux VM: error budgets, burn rate, p99, load average, OOM, a full disk, restart vs reload. Every step tested.

SRE Interview Questions Answered with Hands-On Labs

✍️ Translate this blog into Hindi, Tamil or Telugu

SRE interviews mix numbers and Linux: how much downtime does 99.9 percent allow, what is a burn rate, why p99, what does load average mean, what happens when memory or disk runs out, restart or reload? In this post, 8 classic questions are answered and each answer is proved on one small Linux VM on Google Cloud with real commands and real output, including two failures we cause on purpose and fix.

Who it is for: anyone preparing for SRE, DevOps or platform interviews. Time: about 45 minutes. Cost: one small VM for about 10 minutes, covered by the free trial credit.

Every command below was run for real by the CareerByteCode Team, and every output is the real result we got. The VM was created with gcloud from a Cloud Shell-like Linux machine; everything else ran on the VM over SSH.

🧪⭐ Recommended by CareerByteCode · ByteLabs project bundleCloud and DevOps Realtime Starterโ‚น499Build the projects →

The lab behind the answers

One Debian VM (e2-small: 2 vCPUs, 2 GB memory) with nginx (a web server to test) and ab (ApacheBench, a simple load tester).

The lab
One VM: nginx under load from ab, a memory limit, a tiny test disk, and the system journal for the timeline
# One small Debian VM for every question in this lab
gcloud compute instances create sre-vm --zone=us-east1-b --machine-type=e2-small --image-family=debian-12 --image-project=debian-cloud --boot-disk-size=20GB > /dev/null 2>&1 && echo "sre-vm created"
until gcloud compute ssh sre-vm --zone=us-east1-b --tunnel-through-iap --command="true" > /dev/null 2>&1; do sleep 10; done; echo "SSH works"
sre-vm created
SSH works
# Tools: nginx (a web server to test), apache2-utils (ab, a load tester)
sudo apt-get update -qq > /dev/null && sudo apt-get install -y -qq nginx apache2-utils > /dev/null 2>&1; /usr/sbin/nginx -v 2>&1; ab -V | head -1
nginx version: nginx/1.22.1
This is ApacheBench, Version 2.3 <$Revision$>

Q1 and Q2. What does an SLO allow, and what is a burn rate?

Answer: an SLO of X percent over 30 days allows (100 - X) percent of the time to be bad: that is the error budget. The burn rate is how fast you spend it: 1 means it lasts exactly 30 days. A common "page now" alert fires at a burn rate of 14.4 for 1 hour, which spends 2 percent of the month's budget in that hour.

Proof:

# Q1 and Q2. SLO math: how much downtime does each SLO allow, and what is a burn rate?
python3 -c "
for slo in (99.0, 99.5, 99.9, 99.95, 99.99):
    m = 30 * 24 * 60 * (100 - slo) / 100
    print(f'SLO {slo:>6}% -> error budget {m:7.1f} minutes per 30 days ({m * 60 / 30:6.0f} s a day)')
print('burn rate 14.4 for 1 hour = 2% of a 30-day budget gone in that hour (the classic page-now alert)')
print('check: 14.4 x 1 h / 720 h =', round(14.4 / 720 * 100, 1), '% of the budget')"
SLO   99.0% -> error budget   432.0 minutes per 30 days (   864 s a day)
SLO   99.5% -> error budget   216.0 minutes per 30 days (   432 s a day)
SLO   99.9% -> error budget    43.2 minutes per 30 days (    86 s a day)
SLO  99.95% -> error budget    21.6 minutes per 30 days (    43 s a day)
SLO  99.99% -> error budget     4.3 minutes per 30 days (     9 s a day)
burn rate 14.4 for 1 hour = 2% of a 30-day budget gone in that hour (the classic page-now alert)
check: 14.4 x 1 h / 720 h = 2.0 % of the budget

Every extra "9" divides the budget by ten: 99.9 percent leaves 43 minutes a month, 99.99 percent only 4.

Q3. Why look at p99 and not the average?

Answer: an average hides the slowest requests, and the slowest requests are what users notice. Percentiles show them: p50 is the typical request, p99 the slowest 1 in 100.

Proof: nginx serves a 100 KB file to 20 clients at once:

# Q3. Why p99 and not the average? nginx serves a 100 KB file to 20 clients at once: compare the median with the slowest 1 percent
sudo bash -c 'head -c 100000 /dev/urandom > /var/www/html/file.bin'
ab -q -l -n 2000 -c 20 http://127.0.0.1/file.bin 2>/dev/null | grep -E "^Requests per second|^Failed|^  50%|^  90%|^  99%|^ 100%|Time per request.*mean\)$"
Failed requests:        0
Requests per second:    5501.08 [#/sec] (mean)
Time per request:       3.636 [ms] (mean)
  50%      4
  90%      4
  99%      5
 100%      7 (longest request)

On a healthy, idle server the spread is small (p50 4 ms, p99 5 ms, worst 7 ms). In production, the gap between p50 and p99 is where problems show up first; our Grafana and observability labs show a case where the average looked fine while p99 was over 2 seconds.

Q4. What does load average mean?

Answer: load average counts processes running or waiting for a CPU (and on Linux also those waiting for disk). Compare it with the number of CPUs: load 3 on 2 CPUs means one process is always waiting. It is a moving average, so it rises slowly.

Proof: 3 busy loops on a 2-vCPU VM for about a minute:

# Q4. Load average vs CPU usage: 2 busy processes on a 2-vCPU VM. Load counts the WAITING queue too
for i in 1 2 3; do (timeout 70 sh -c 'while :; do :; done' &) ; done; sleep 65
echo "CPUs: $(nproc) | load average (1 min): $(cut -d' ' -f1 /proc/loadavg) | CPU idle now: $(top -bn1 | grep '%Cpu' | awk -F, '{print $4}' | awk '{print $1}')%"
echo "3 busy loops on $(nproc) CPUs: load near 3 means 1 is always waiting for a CPU"
CPUs: 2 | load average (1 min): 2.04 | CPU idle now: 0.0%
3 busy loops on 2 CPUs: load near 3 means 1 is always waiting for a CPU

The CPU is 0 percent idle and the 1-minute load is 2.04 and still rising towards 3: after one minute, the moving average has only covered part of the way.

Q5. What happens when a process uses more memory than it may?

Answer: the kernel's OOM killer (out of memory) kills it. In containers and systemd services, the limit is the cgroup's MemoryMax (Kubernetes: resources.limits.memory); the process is killed even if the machine has free memory. Kubernetes shows it as OOMKilled.

Proof: a 200 MB limit and a Python program that wants 400 MB:

# Q5. What happens when a process uses more memory than it may? A 200 MB limit, a program that wants 400 MB
sudo systemd-run --unit=memhog --property=MemoryMax=200M --property=MemorySwapMax=0 python3 -c "x = bytearray(400 * 1024 * 1024); print('allocated')" > /dev/null 2>&1; sleep 5
systemctl show memhog -p Result -p ExecMainStatus 2>/dev/null | tr '\n' ' '; echo
sudo journalctl -u memhog --no-pager -q | grep -oE "Failed with result '[a-z-]+'|oom[a-z-]*|A process of this unit has been killed by the OOM killer" | head -2
Result=oom-kill ExecMainStatus=9 
A process of this unit has been killed by the OOM killer
Failed with result 'oom-kill'

Result=oom-kill, exit signal 9 (SIGKILL): the program never finished.

SLO math, percentiles, load, OOM
Error budgets per SLO, p50 4 ms and p99 5 ms, load 2.04 on 2 CPUs, and a process killed by the OOM killer

Q6. The disk is full. What do apps see, and how do you fix it safely?

Answer: writes fail with No space left on device; databases stop, logs stop, sometimes the app crashes. Find the biggest files, and for a log a process still writes, truncate it instead of deleting it (a deleted file that is still open keeps using the space until the process closes it).

Break it: a 50 MB test disk (a file used as a disk), filled by a "runaway log":

# Q6. Disk full: a 50 MB disk (a file used as a disk), filled by a runaway log. What do apps see?
sudo fallocate -l 50M /srv/small.img && sudo mkfs.ext4 -q /srv/small.img && sudo mkdir -p /mnt/small && sudo mount -o loop /srv/small.img /mnt/small
sudo dd if=/dev/zero of=/mnt/small/app.log bs=1M count=100 2>&1 | grep -oE "No space left on device" | head -1
df -h /mnt/small | tail -1 | awk '{print "used " $3 " of " $2 " (" $5 ")"}'
echo "hello" | sudo tee /mnt/small/new-file.txt 2>&1 | grep -oE "No space left on device"
No space left on device
used 41M of 42M (100%)
No space left on device
📝⭐ Recommended by CareerByteCode · Certification examGoogle Analytics Certification (GA4) PracticeTake the examTake the exam →

Fix it: find the biggest file, truncate it, check again:

# Q6. Fix it: find the biggest file, truncate it (do not delete a log a process still writes), check again
sudo du -ah /mnt/small 2>/dev/null | sort -h | tail -2
sudo truncate -s 0 /mnt/small/app.log && df -h /mnt/small | tail -1 | awk '{print "after truncate: used " $3 " of " $2 " (" $5 ")"}'
sudo umount /mnt/small && sudo rm /srv/small.img && echo "test disk removed"
41M	/mnt/small
41M	/mnt/small/app.log
after truncate: used 14K of 42M (1%)
test disk removed

From 100 percent to 1 percent, and new writes work again.

Q7. Restart or reload?

Answer: a restart stops the process and starts a new one: connections in flight are cut. A reload tells the running process to read its config again, with new workers taking over gracefully (nginx, HAProxy, gunicorn and many others support it). Prefer reload for config changes.

Proof: 40,000 requests with 20 at a time; one second in, we restart nginx, then do the same with reload:

# Q7. Restart or reload? Hit nginx with load and restart it in the middle, then do the same with reload
ab -q -l -r -n 40000 -c 20 http://127.0.0.1/ > restart.txt 2>&1 & sleep 1; sudo systemctl restart nginx; wait
ab -q -l -r -n 40000 -c 20 http://127.0.0.1/ > reload.txt 2>&1 & sleep 1; sudo systemctl reload nginx; wait
for f in restart reload; do echo "$f during load: $(grep -E '^Failed requests|^Complete requests' $f.txt | awk -F: '{gsub(/ /, "", $2); printf "%s=%s ", $1, $2}') $(grep -A1 '^Failed requests' $f.txt | grep -oE '[(]Connect.*[)]')"; done
restart during load: Complete requests=40000 Failed requests=215  (Connect: 0, Receive: 128, Length: 0, Exceptions: 87)
reload during load: Complete requests=40000 Failed requests=0

Restart: 215 failed requests (connections reset while receiving, and exceptions). Reload: 0.

Q8. How do you build an incident timeline?

Answer: from the system's own records, not from memory: the journal, deploy logs, metrics. Every line has a timestamp.

Proof: what happened to nginx in the last 15 minutes:

# Q8. Build an incident timeline from the logs: what happened to nginx, and when?
sudo journalctl -u nginx --since "-15 min" --no-pager -o short-iso | grep -E "Stopp|Start|Reload" | sed -E 's/ sre-vm systemd\[1\]://' | tail -6
2026-11-19T09:08:39+0000 Stopping nginx.service - A high performance web server and a reverse proxy server...
2026-11-19T09:08:39+0000 Stopped nginx.service - A high performance web server and a reverse proxy server.
2026-11-19T09:08:39+0000 Starting nginx.service - A high performance web server and a reverse proxy server...
2026-11-19T09:08:39+0000 Started nginx.service - A high performance web server and a reverse proxy server.
2026-11-19T09:08:43+0000 Reloading nginx.service - A high performance web server and a reverse proxy server...
2026-11-19T09:08:43+0000 Reloaded nginx.service - A high performance web server and a reverse proxy server.

The restart (stop and start in the same second) and the reload four seconds later, with exact times, ready for the postmortem.

Disk, restart and timeline
A full disk fixed with truncate, 215 failures on restart against 0 on reload, and the timeline from the journal

Clean up (delete everything)

# Clean up: delete the VM
gcloud compute instances delete sre-vm --zone=us-east1-b --quiet 2>&1 | tail -1
echo "lab VMs left: $(gcloud compute instances list --filter='name=sre-vm' --format='value(name)' | wc -l)"
Deleted [https://www.googleapis.com/compute/v1/projects/your-project-id/zones/us-east1-b/instances/sre-vm].
lab VMs left: 0

Quick answers to remember

QuestionOne-line answerProved in
Error budget(100 - SLO) percent of the time; 99.9 = 43 minutes a monthQ1
Burn rateSpeed of spending the budget; page at 14.4 for 1 hourQ2
p99The slow requests users feel; the average hides themQ3
Load averageRunning plus waiting processes, compared with CPUsQ4
Out of memoryThe OOM killer stops the process at its limitQ5
Disk fullNo space left; truncate open logs, do not deleteQ6
Restart or reloadReload keeps connections; restart drops themQ7
TimelineFrom the journal and logs, with timestampsQ8

What next

Prepared by the CareerByteCode Team from our tested lab, with AI help for the write-up.

Read next →Chaos Engineering on Kubernetes with Chaos Mesh⏱ 12 min

⭐ Keep learning with CareerByteCode

Hand-picked to go deeper on this topic
News, guides and updates from the CareerByteCode team
🏅 Expert writer

The CareerByteCode team writes about what is new on careerbytecode.in: courses, labs, exams, events and the community, which is free to join for influencers and content creators in tech.

Get CareerByteCode Team's next blog by email

One email a week when they publish. Add the weekly Best of ByteBlog too. No spam, unsubscribe with one click.

We email you once to confirm. By subscribing you agree to the privacy policy.

💬 Comments (0)

Top · Newest

Sign in to comment

Related blogs

🧪⭐ Recommended by CareerByteCode · ByteLabs project bundleCloud and DevOps Realtime Starterโ‚น499Build the projects →