30 Intermediate Linux Interview Questions
Mid-level questions for sysadmin, DevOps, and SRE roles (1-3 years experience)
Download Free PDF Cheat SheetReady to level up from junior to mid-level? These 30 intermediate Linux interview questions cover the topics that separate entry-level candidates from experienced professionals. Interviewers at this level expect you to discuss trade-offs, explain troubleshooting methodology, and demonstrate production experience.
Target roles: Linux System Administrator, DevOps Engineer, Site Reliability Engineer (SRE), Cloud Engineer.
System Administration
Q1: Explain the Linux boot process in detail.
BIOS/UEFI initializes hardware and finds the bootloader. GRUB presents the menu and loads the kernel and initramfs. The kernel initializes drivers, mounts initramfs, and starts systemd (PID 1). Systemd starts services based on the default target and its dependency tree.
Q2: What is LVM and why would you use it?
Logical Volume Manager adds a layer of abstraction between physical disks and filesystems. Physical Volumes (PV) form Volume Groups (VG), from which Logical Volumes (LV) are created. Key advantages: resize volumes online, create snapshots, span multiple disks, and migrate data between disks without downtime.
Q3: How do you troubleshoot a system that won't boot?
Systematic approach: 1) Check GRUB errors and boot into rescue/single-user mode. 2) Review journalctl -xb and /var/log/boot.log. 3) Verify /etc/fstab entries. 4) Check filesystem with fsck. 5) Use a live USB if the system is completely unresponsive. 6) Check for failed services: systemctl --failed.
Security & Hardening
Q4: How do you secure SSH on a production server?
Essential steps: PermitRootLogin no, PasswordAuthentication no (key-based only), change default port, install fail2ban, limit users with AllowUsers, set idle timeout (ClientAliveInterval), and use AllowGroups sshusers for group-based access control.
Q5: Explain SELinux modes and troubleshooting.
Enforcing blocks violations, Permissive logs only, Disabled turns it off. Check with getenforce. Troubleshoot: ausearch -m avc -ts recent | audit2why. Fix contexts: restorecon -Rv /path. Toggle booleans: setsebool -P httpd_can_network_connect on.
Performance & Troubleshooting
Q6: How do you diagnose high CPU usage?
1) top or htop to identify the process. 2) Check wa (iowait) — high iowait = disk bottleneck, not CPU. 3) strace -p PID to trace system calls. 4) perf top for kernel profiling. 5) Check nice values and consider renice for non-critical processes.
Q7: What is the difference between load average and CPU usage?
Load average = number of processes in the run queue + waiting for I/O. CPU usage = actual processor utilization. High load with low CPU typically means I/O bottleneck. A load average higher than the number of CPU cores indicates an overloaded system.
Networking
Q8: How do you troubleshoot network connectivity?
Layer-by-layer approach: ip link (L1 — is the interface up?), ip addr (L2 — IP configured?), ping gateway (L3 — routing works?), ping 8.8.8.8 (external), nslookup domain (DNS), curl URL (L7 — app works?). Use traceroute and mtr for path analysis.
Q9: Compare Nginx and Apache. When would you use each?
Nginx: event-driven, excels at static content, reverse proxy, lower memory usage. Apache: process/thread-based, .htaccess support, more modules. Use Nginx for high-traffic sites and reverse proxy setups. Use Apache for shared hosting and when .htaccess flexibility is needed.
Automation & Containers
Q10: What are namespaces and cgroups?
Namespaces isolate resources (PID, network, mount, user, UTS, IPC). Cgroups limit and account for resources (CPU, memory, I/O). Together they are the foundation of containers — Docker and LXC use both to create isolated environments.
Interview Tip
At intermediate level, never give single-tool answers. Always discuss alternatives and trade-offs. For example, don't just say "use Nginx" — explain when Apache might be better and why.
Download the Complete Cheat Sheet
Get all 30 intermediate questions with detailed answers in a professionally designed PDF.
Download Intermediate Cheat Sheet (PDF)
Continue Your Preparation
- Beginner Level: 25 Essential Questions — review the fundamentals
- Advanced Level: 25 Expert Questions — prepare for senior roles
- All Levels Compared — see what's expected at each stage