A strong Linux interview answer explains how you would narrow a server failure using evidence. Naming a command is the beginning: explain what its output establishes, what remains uncertain, and how you would check recovery after a change.
The questions below are original fictional practice scenarios, with constructed output. They are not claimed questions from any employer. Commands assume a Linux host with systemd, GNU coreutils, procps, and iproute2; lsof and iostat may require additional packages and permissions. Some output is simplified for the exercise. These are documentation-checked examples, not results from running a broken-server lab. Use a disposable Linux environment for hands-on practice; macOS command behavior differs.
1. What is the difference between a process and a service?
A process is a running instance of a program, identified by a process ID, or PID. A service is a managed unit of work. On a systemd host, a service unit can describe how processes start, stop, and restart, which identity they use, and what they depend on.
For a web application called ticket-api, inspect both views:
systemctl status ticket-api --no-pager
systemctl show ticket-api -p MainPID -p ActiveState -p SubState
ps -eo pid,ppid,stat,comm
The unit state describes the service manager's view; the process list describes processes at that instant. Some services are short-lived jobs, and service types have different state meanings. Even an active long-running web service can return errors. Follow the service check with an application request.
Follow-up: Why use systemctl to stop a managed service? The service manager knows the unit's lifecycle and restart policy. Killing an individual process may cause it to be restarted and may leave related work running.
2. Load average is high but CPU use is moderate. Is the host CPU-bound?
Practice evidence for an eight-CPU host:
load average: 12.00, 8.40, 4.10
CPU idle: 58%
Several worker processes have state D
Linux load average includes runnable tasks and tasks in uninterruptible sleep. The one-, five-, and fifteen-minute values are averages, so they also describe a different interval from an instantaneous CPU sample. This evidence does not justify calling the machine CPU-bound. State D can be associated with I/O waits, but does not identify a particular disk as the cause.
vmstat 1 5
ps -eo pid,stat,wchan:32,comm
iostat -xz 1 5
vmstat helps compare runnable and blocked work with CPU activity. Its first report normally summarizes activity since boot; use later interval samples when investigating current behavior. iostat comes from sysstat and can help investigate block-device activity. Interpret latency and queueing in the context of the storage system; a single utilization percentage is not a universal saturation threshold.
Correlate blocked work with storage latency, remote filesystem health, and the service's response time. Mitigation depends on the supported cause: reducing excess work differs from repairing a storage path. Verify that queued work drains and requests recover. Load averages decay over time, so they may remain elevated after current behavior improves.
3. A filesystem has free gigabytes but cannot create files. What would you check?
Constructed evidence:
df -h /var
Filesystem Size Used Avail Use% Mounted on
/dev/vdb1 40G 20G 18G 53% /var
df -i /var
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/vdb1 1000000 1000000 0 100% /var
On a filesystem with a finite inode supply, creating a new file needs an available inode as well as space for data. An inode records a file's metadata. Here, inode exhaustion explains how file creation can fail despite available bytes.
Confirm the affected path is on this filesystem, then locate the directory generating many files using a scoped investigation. Avoid a full recursive scan of a busy host unless you understand its cost. Establish ownership and retention rules before removing anything; caches, queues, and customer records have different recovery requirements.
If inode usage is healthy, investigate other causes such as quotas, permissions, or a read-only mount. After approved cleanup or a capacity change, verify that the application identity can create a file in the intended location and complete its normal work. Monitor the file creation rate so the condition does not immediately recur.
4. Why can df show a full disk while du finds much less data?
One possible explanation is a deleted file still held open by a process. Removing its pathname does not release its storage until the remaining references are closed. Other explanations include mount boundaries, filesystem accounting, reserved blocks, and permissions that hide files from the scan.
df -h /var
du -xhd1 /var
sudo lsof +L1
du -x stays on one filesystem. lsof +L1 selects open files whose link count is less than one; inspect which files belong to the affected filesystem and which processes hold them. The command can reveal sensitive filenames, so share only the relevant redacted evidence.
Suppose the API holds a large deleted log open. Use the application's documented log-reopen mechanism or a controlled service restart, considering active requests and available replicas. Killing unrelated processes or deleting more pathnames does not address that open descriptor. Confirm that space is released and the application remains healthy, then repair log rotation so the file is reopened correctly.
5. free shows little unused memory. Is the machine out of memory?
Linux uses memory for caches as well as application work. A small free value by itself does not establish memory pressure. Examine the available estimate, swap activity, historical usage, and symptoms together.
free -h
vmstat 1 5
ps -eo pid,rss,comm --sort=-rss
journalctl -k --since '-15 minutes' --no-pager
Resident set size, or RSS, describes resident memory attributed to a process; adding every RSS can double-count shared pages. A process list sampled after a kill also misses the victim's earlier peak. Look for kernel out-of-memory messages and correlate them with the failure time. Depending on the environment, a cgroup memory limit or a userspace OOM manager may be involved even when the whole host has available memory.
A reasonable response might bound concurrency, correct an unbounded cache, or add capacity after measurement. Explain which evidence supports the choice. Check request latency, errors, and sustained memory behavior after the mitigation. Clearing caches simply to increase the displayed free-memory number does not establish an application fix.
6. A service will not start. What do you do before restarting it repeatedly?
Read the manager's state and the service logs around the failed attempt:
systemctl status ticket-api --no-pager
journalctl -u ticket-api --since '-15 minutes' --no-pager
systemctl cat ticket-api
Constructed log:
ticket-api: cannot open /etc/ticket-api/config.json: Permission denied
This identifies a failed file access during startup. Check the service's effective identity, file ownership and mode, and search permission on each parent directory. Unit sandbox settings and SELinux or AppArmor policy can restrict access even when ordinary mode bits appear correct.
systemctl show ticket-api -p User -p Group
namei -l /etc/ticket-api/config.json
namei is supplied by util-linux. Test the narrow access the process needs in a sandbox; an identity with an empty User setting requires interpretation in the unit's context. Correct the intended ownership or policy through configuration management. Making the configuration world-writable would expose it to unrelated users.
After the correction, start the service through its normal procedure. Verify a clean startup and a real request, and check that the intended account still has only the required access.
7. A service listens locally but remote clients cannot connect. Where do you look?
You see this simplified listener:
State Local Address:Port Process
LISTEN 127.0.0.1:8080 ticket-api
ss -lntp
curl --connect-timeout 3 --max-time 5 -i http://127.0.0.1:8080/health
127.0.0.1 is loopback. This listener accepts connections through the host's loopback interface, which explains why a direct connection to the host's non-loopback address will not reach it. Check the architecture before changing the binding: a reverse proxy may intentionally be the only external entry point.
If direct remote access is intended, confirm the configured bind address and the authorized network path. If a proxy is intended, inspect its listener and upstream route. A successful local request only establishes that the tested local path worked. Firewall policy, routing, a cloud load balancer, or a different IPv4/IPv6 path may still prevent remote access.
Verify from an affected client's network through the intended hostname and port. Record the HTTP result as well as whether a TCP connection opened; a reachable server can still return an application error.
8. How do SIGTERM and SIGKILL differ?
SIGTERM requests termination and allows a process to handle the signal, such as by stopping new work and finishing active requests. SIGKILL cannot be caught, blocked, or ignored by the process. It prevents application cleanup handlers from running. A process waiting in some kernel operations may not disappear immediately even after SIGKILL is sent.
For a managed application, prefer its service manager and documented shutdown procedure. Find out how long draining should take and how unfinished work is recovered. Before escalating a stuck shutdown, inspect the process state and the work at risk.
Follow-up: Is a missing PID proof that the customer task succeeded? No. The request might have been interrupted or queued work might remain. Recovery checks need to cover the application's work, including duplicates or partial results where applicable. The data integrity guide explains why successful restarts and correct records are separate checks.
9. How would you explain the investigation in an interview?
Try a two-minute answer to this prompt: “Bookings became slow after a release. The host has moderate CPU use, rising load, and several blocked workers.”
Start by defining impact and timing. Explain that the evidence leaves storage, a remote filesystem, and other blocking paths open. Choose an observation that narrows those possibilities, such as interval CPU and blocked-task samples followed by the relevant storage metrics. If the release increased synchronous writes, compare the changed write path with the timing and measured latency before deciding it caused the incident.
Give yourself one point for each of these five elements:
- You define the affected service and the observation period.
- You distinguish an observation from a hypothesis.
- You explain why the next command is useful.
- You describe a targeted mitigation and its operational risks.
- Your recovery check includes latency or completed bookings.
This is an ESRE self-review rubric. A command list without interpretation will miss most of those points. If your evidence is incomplete, state the missing measurement and how you would obtain it.
Continue with Kubernetes interview scenarios to investigate workloads running on top of hosts, or the on-call troubleshooting guide to practise narrowing a customer-visible failure. Join the updates list for forthcoming server practice; no browser-based Linux lab is required to read these answers.