Linux Interview Questions for DevOps and SRE Roles | OfferBull

Linux Interview Questions for DevOps and SRE Roles
They don’t start with “what is a process.” They say: “SSH in. The API is timing out, load looks high, and someone already sent kill -9 at the worker. What do you do first?”
If you recap process versus thread and stop, you have not answered. They want what you’d type, what the numbers actually mean, and whether you’d reach for SIGKILL first.
That is what linux interview questions feel like for DevOps and SRE loops. This is a spoken question bank about the host: processes and signals, filesystems and disk, the networking commands people still use, and a “server is slow” triage you can walk through out loud. It is not a computer-science chapter on scheduling or virtual memory. When that theory follow-up shows up, use operating systems and memory management interview questions. For the broader study plan, use how to prepare for DevOps and SRE interviews. If you have to decide whether the host or a container is at fault, Docker interview questions is the closer page. Sometimes this started as a user ticket that already went through help desk interview questions. On this page, stay on the box.
The sample answers are illustrative, not a script from a real loop. Say them out loud anyway. The weak lines only show up when you have to finish the sentence.
Processes, signals, and what is running
A process is a running program with its own address space, file descriptors, and a process ID. They rarely want more definition than that. They want you to find it, read it, and stop it without making the outage worse.
I’d start with a live view. top or htop shows who is using CPU and memory right now. ps aux or ps -ef is the snapshot I can filter. /proc/<pid>/cmdline, status, and fd expose the same facts as files: the command, the state, and the open descriptors. I treat /proc as a live view the kernel already publishes, not as a debugger I invented.
Load average is the three numbers in uptime or top: roughly the 1-, 5-, and 15-minute averages of how much work is queued. On Linux, that includes runnable processes and processes in uninterruptible sleep, which is often I/O. It is not a CPU percentage. Compare it to the number of CPUs (nproc). A load of 8 on an 8-core box and a load of 8 on a 2-core box are different stories.
Process state is the other half. R is running or ready. S is ordinary sleep. D is uninterruptible sleep, often a process stuck on disk or a hung mount, and a signal will not fix that. Z is a zombie: the process has exited, and the parent has not collected the status yet. Killing a zombie does nothing useful. If load is high and CPU is idle, I look for D state before I blame a process that is actually waiting.
Signals are where people get sloppy. SIGTERM (15) can be caught, so the process can flush, close connections, and exit on its own. SIGKILL (9) cannot be caught or ignored. The kernel tears it down immediately, with no chance to clean up. My default is a graceful stop first: systemctl stop for a unit under systemd, or kill <pid>, which sends SIGTERM. Then wait, and only then kill -9 if it is still there and I can explain why. Jumping to kill -9 is the common trap.
Most modern distributions use systemd, so systemctl status, stop, restart, and journalctl -u are fair game. I would not pretend every shop is systemd. Some boxes still run another supervisor. I’d check how the service is actually managed before I assume a unit file exists.
Niceness only comes up if they ask how you’d make a heavy batch job less of a bully. nice starts a process with a lower priority. renice changes one already running. The range is -20 (higher priority) to 19 (lower). I would not treat that as the fix for a runaway production worker.
A spoken version I’d actually use:
“I’d look at top or htop and at the load averages against the CPU count, not as a percent. Then I’d identify the process with ps and /proc: command, state, and open files. If I need to stop it, I send SIGTERM first, or systemctl stop if it’s a unit, and I wait. SIGKILL is the last resort because the process doesn’t get to clean up.”
Filesystems, permissions, and disk
Disk questions in these loops are usually “why is the box full” or “why can’t this user write here,” not a lecture on journaling.
An inode holds a file’s metadata: owner, permissions, timestamps, and pointers to data blocks. The filename is just a directory entry pointing at that inode. You can run out of inodes while df -h still shows free space, especially with a huge number of tiny files. df -i is the check. If inodes are exhausted, deleting a few large files will not help. You have to remove many small ones, or stop whatever is creating them.
df and du disagree more often than people expect. df reports what the filesystem believes is used. du walks the visible directory tree. The classic trap is a deleted file that a process still has open: du no longer counts it, but the space is not released until that last file descriptor closes. lsof is how I’d find the holder (lsof | grep deleted, or a similar check). Then I restart or stop that process, or truncate the file if that is the agreed fix.
Permissions are the everyday rwx bits for owner, group, and others, plus ownership (chown, chgrp). If a service can’t write a log directory, I check the process user, the directory owner and mode, and whether a parent directory is blocking traversal. The sticky bit on a directory, the t you see on /tmp, means only the file’s owner, the directory’s owner, or root can delete or rename that file. setuid on an executable runs the process with the file owner’s privileges. I would not enable it as a trick to “fix a permission issue.”
Mounts belong in the same conversation. findmnt or /proc/mounts shows what is mounted where, and whether a filesystem is read-only. A full disk and a read-only remount after errors look similar from the app’s point of view: writes start failing. dmesg or the journal is where I’d look for those I/O errors.
A spoken version I’d use:
“If df says the disk is full and du on the obvious directories doesn’t add up, I look for a deleted file that’s still open, usually with lsof, and I deal with the process holding it. If space is free but creates fail, I check inodes with df -i. Permissions I debug from the process user outward, and I don’t chmod 777 to make it go away.”

Talk through the host as a set of checks: what is running, what the disk is doing, and what you’d type first.
Networking commands interviewers still use
I’d lead with the current tools, and I’d mention the older names once because interviewers still say them.
ip addr and ip link are how I look at interfaces and addresses. ip route is the routing table. ss -lptn shows listening TCP ports and the process that owns them. ifconfig and netstat are the older names from net-tools. I can still read them, and I would not correct an interviewer who says “netstat.” I’d just use ip and ss when I pick the command.
DNS is not one universal binary. dig is the tool I reach for when it is installed. On a box using systemd-resolved, resolvectl query is the native check. getent hosts goes through the same name service switch the machine uses, which matters when /etc/hosts or nsswitch is involved. I would not pretend every image has dig, and I would not treat “connection refused” as DNS before I check whether anything is listening.
A reachability walkthrough I’d actually use, in order: is the interface up, and does it have an address. Do I have a route. Does the name resolve to the address I think it does. Is a process listening on the port I am hitting. Then firewall rules, and only then the far end. ping tells you about ICMP, not about a TCP service. A box that answers ping and still refuses port 443 is not a mystery.
If they handed you a cloud VM and the interesting part is the path to a managed database or a private endpoint, AWS interview questions or Azure interview questions may be the other half. On the box itself, I’d still start with the same host checks. If the process is in a pod and the question turns into Services or CoreDNS, that is a Kubernetes conversation.
A spoken version I’d use:
“I’d check ip addr and ip route first, then ss to see if the process is listening, then name resolution with dig or resolvectl, depending on what’s on the box. I wouldn’t start at the firewall, and I wouldn’t treat a successful ping as proof that the service is up.”
“The server is slow” (and similar troubleshooting)
This is the question they are saving. They want a path, not a favorite command.
I’d walk CPU, memory, disk I/O, and network, then the application. I would not start in the app logs just because I know the service name, and I would not start with a reboot.
Uptime and load averages give me the first shape, compared to CPU count. top or htop tells me whether I am looking at a CPU hog, a memory hog, or a lot of processes waiting. vmstat is a compact loop: run queue, swap, and CPU time in user, system, idle, and I/O wait. In free, I trust the available column more than the raw “free” number. Linux will use RAM for cache, so a low “free” figure is not, by itself, a memory emergency.
For disk, iostat (from sysstat, when it is installed) shows utilization and wait. A high I/O wait with processes in D state is a storage story, not a CPU story. df -h and df -i catch the boring failures: the disk is full, or the inodes are gone. dmesg and journalctl -xe are where I’d look for the OOM killer, a filesystem remounted read-only, or a NIC that keeps flapping.
Network is next, not first, unless the ticket already says “timeouts to one dependency.” ss, packet errors on ip -s link, and a DNS check are usually enough to see whether the box is the problem or just the place people SSH into.
Then the application: its logs, a downstream dependency, a worker pool that is exhausted, or a deploy that landed twenty minutes ago. If the workload is a container and I cannot tell whether the host is saturated or the container is mis-sized, I say so and look at both.
The order I’d say out loud: CPU, memory, disk, network, then the app. Reboot is not a step on this list.
A spoken walkthrough I’d rehearse:
“I’d start with load versus CPU count, then top and vmstat to see if this is CPU, memory, or I/O wait. free for available memory and swap, df and df -i for space and inodes, and dmesg or journalctl for OOM or disk errors. Network after that, unless the symptom is already a timeout to one host. Only then would I go into the application logs. I wouldn’t reboot first, and I wouldn’t kill -9 a stuck D-state process and call that a disk fix.”
Night-before drill
I’d run these out loud, timer on, no notes after the first pass:
- Load average versus CPU count, and what
Dstate is telling you - SIGTERM versus SIGKILL, and why a graceful stop comes first
dfversusdu, inode exhaustion, and a deleted file that is still openipandssversusifconfigandnetstat, plus a name-resolution check- The “server is slow” path: CPU, memory, disk, network, then the application
If a line sounds like a slogan (“I’d just check the logs” or “I’d restart it”), say it again until it names a command, a state, or a number you’d actually look at.
Practicing with OfferBull
A list of commands will not tell you whether you paused before sending SIGKILL.
OfferBull is an AI mock interview app, available on iOS and Android. A voice interviewer asks questions aloud. You answer by speaking. Paste a DevOps, SRE, or Linux-heavy job description, or upload a resume, for tailored questions. Follow-ups based on what you said and what’s on the resume. While you practice, you get answer suggestions and STAR structures. English and Chinese. It’s for rehearsal before the interview, not a helper during one.
FAQ
What’s the difference between SIGTERM and SIGKILL? SIGTERM can be caught, so the process can shut down cleanly. SIGKILL cannot be caught or ignored; the kernel stops the process immediately. I’d send SIGTERM first, or use the service manager, and keep SIGKILL for a process that will not exit.
Why don’t df and du agree?
df reports filesystem usage. du adds up visible files. A common gap is a file that was deleted but is still held open, so the space is not freed yet. lsof is how I’d find the process still holding it.
Is load average a CPU percentage? No. It’s an average of how much work is queued, over 1, 5, and 15 minutes. On Linux that includes runnable processes and some uninterruptible sleep. Compare it to the number of CPUs, not to 100%.
Do I have to use ip and ss, or are ifconfig and netstat still acceptable?
Interviewers still say the older names. I’d recognize them, then use ip and ss when I pick the command. I wouldn’t spend the round correcting the interviewer’s vocabulary.
Is every Linux shop on systemd?
No. Most modern distributions are, so systemctl and journalctl are fair defaults. Some environments use another supervisor. I’d check how the service is actually managed.
Practice This Out Loud
Tonight, talk through SIGTERM versus SIGKILL, the df/du mismatch, and a listening-port check, each in under a minute. Then do the “server is slow” path with no man pages in front of you: CPU, memory, disk, network, and what you would not reboot or kill first. Record it and listen for filler, and for answers that stop at a command name. After that, run the same questions in a voice mock that pushes back, and close the app before any real interview. → Practice Now
Take Control of Your Career Path:
- Official Site: www.offerbull.net/mock-interview
- iOS App: Download for iPhone/iPad
- Android App: Download for Android