Interview prep · 🐧 Linux System Administrator
Linux System Administrator interview questionsand answers (30, by level).
The questions Indian employers actually ask for this role — fresher, mid-level and senior — with model answers written by engineers who sit on the other side of the table. Use with the role path and the 30-day lab plan.
Fresher / L1
Fundamentals they test on day one
1How do you check disk, memory and CPU usage?
df -h / du -sh for disk, free -m and top/htop for memory and CPU, iostat/vmstat for deeper views.
2File permissions: what does 640 mean?
Owner read+write, group read, others nothing. Use chmod/chown; see our chmod calculator.
3What is the difference between a process and a daemon?
A daemon is a background process without a controlling terminal, usually managed by systemd (nginx, sshd).
4How do you find which process is using port 80?
ss -tulpn | grep :80 (or lsof -i :80).
5What is the boot process of a modern Linux system?
BIOS/UEFI → bootloader (GRUB) → kernel + initramfs → systemd (default target) → services.
6How do you add a user and give sudo?
useradd -m user; passwd user; usermod -aG sudo (or wheel) user; prefer SSH keys and sudoers.d entries.
7What are runlevels/targets?
systemd targets replace runlevels: multi-user.target (CLI), graphical.target; systemctl isolate / set-default.
8How do you check logs for a failing service?
systemctl status svc; journalctl -u svc -n 100 -f; /var/log for app logs.
9Hard link vs soft link?
Hard link: another name for the same inode (same filesystem); soft link: a pointer to a path (can cross filesystems, breaks if target moves).
10What does the PATH variable do?
Directories the shell searches for commands, in order; which cmd shows the one used.
2–5 years / L2
What a working engineer must know
1Server is at 100% CPU — triage steps?
top/htop sort by CPU, identify process, check load vs cores, iowait, strace/perf if needed, logs, recent deploys; mitigate (restart/limit) then root cause.
2Disk full but du shows space — why?
Deleted files held open by processes (lsof | grep deleted), reserved blocks, inodes exhausted (df -i), or mount hiding files.
3Explain LVM and how to extend a filesystem online.
PV → VG → LV; pvcreate new disk, vgextend, lvextend -r -L +50G /dev/vg/lv (resizes ext4/xfs live).
4How does systemd handle service dependencies and restarts?
Unit files with After/Requires/Wants, Restart=on-failure, RestartSec, timers; systemctl daemon-reload after edits. See our systemd generator.
5Patch management across 100 servers?
Ansible playbooks, staged rings (dev → stage → prod), unattended security upgrades, reboot windows, kernel livepatch where needed, reporting.
6How do you secure SSH?
Key-only auth, no root login, change port optional, fail2ban, AllowUsers, MFA (pam), bastion/jump hosts, audit logs.
7What is the difference between swap, cache and buffers in free output?
Cache/buffers are reclaimable file cache; “available” is what matters; swap used heavily indicates memory pressure.
8Set up a cron job that logs and alerts on failure.
Script with set -e, log to file, exit codes; cron line with MAILTO or a wrapper that sends WhatsApp/email on non-zero exit; or a systemd timer.
9Kernel tuning for a busy web server?
net.core.somaxconn, tcp_tw_reuse, file descriptor limits (ulimit, systemd LimitNOFILE), vm.swappiness, keepalive settings — measured, not guessed.
10How do you troubleshoot “connection refused” vs “timeout”?
Refused: nothing listening or firewall reject (check ss, service, local firewall). Timeout: packets dropped — network path, security group, DROP rules.
Senior / L3
Design, judgement and leadership
1Design a standard Linux build for 500 servers.
Golden image (Packer), CIS hardening, Ansible roles, centralised auth (FreeIPA/AD), logging (rsyslog → Loki/ELK), monitoring agents (Zabbix/node_exporter), patch rings, backup client, documentation.
2Explain cgroups and namespaces and why containers work.
Namespaces isolate views (PID, net, mount, user); cgroups limit resources; container runtimes combine them with layered filesystems.
3A kernel panic on a production host — process?
Capture console/crash dump (kdump), restore service via HA/failover, analyse with crash tool/vendor, check hardware (MCE), firmware, kernel version, rollback if regression.
4How do you reduce MTTR for a NOC team?
Runbooks linked from alerts, standard tooling, observability with dashboards per service, automated remediation for known issues, on-call rotation and post-incident reviews.
5Filesystem choice: ext4 vs XFS vs ZFS?
ext4 general purpose; XFS for large files/parallel IO (default on RHEL); ZFS for checksums, snapshots, replication (needs RAM).
6How do you migrate from RHEL 7/CentOS 7 (EOL) safely?
Inventory, pick target (Rocky/Alma/RHEL 9/Ubuntu LTS), app compatibility tests, rebuild not in-place where possible, Ansible for config, staged cutover.
7Performance: explain the USE method.
For every resource (CPU, memory, disk, network): Utilisation, Saturation, Errors — a checklist that finds bottlenecks fast.
8Secrets and configuration management across environments?
Ansible Vault/HashiCorp Vault, environment-specific inventories, no secrets in images, rotate, audit; CI pulls secrets at runtime.
9How do you handle a compromised server?
Isolate, preserve (disk/memory image), rotate credentials, identify entry point, rebuild from clean image, patch, improve detection; notify per policy.
10What would you automate first in a manual shop?
Provisioning (templates + Ansible), patching, user access, backups verification, monitoring deployment — the repetitive, risky tasks first.
How to answer
Four habits that pass interviews
- Say the structure first“I’d check three things: …” — interviewers reward a method more than a lucky answer.
- Numbers and namesMention real tools, versions and figures from your lab; vague answers lose.
- Admit gaps cleanly“I haven’t run X in production; here is how I’d approach it” beats bluffing.
- Ask about the environmentScale, on-call, tooling — it shows you think like an operator.
Ready to be hired, or ready to hire?
Engineers: join our vetted network for projects and placements. Companies: we shortlist linux system administrators within 48 hours.