Master Linux Interview Questions: From Boot Process to Advanced Server Commands
This comprehensive guide covers essential Linux fundamentals, common interview questions, and practical server administration techniques, including boot sequences, runlevels, file system differences, process management, packaging tools, Nginx optimization, MySQL replication, Docker usage, and useful shell scripts for real‑world operations.
Linux Fundamentals
Describe the Linux boot process (BIOS → MBR → bootloader → kernel → init), the meaning of runlevels 0‑6, and the components of a Linux system (kernel, shell, file system, applications). Explain differences between ext2, ext3, and ext4, inode storage, and common commands for killing processes, packaging (tar, gzip, bzip2, zip, rar, etc.), and file system checks (e2fsck).
System Commands and Utilities
Provide examples for counting established connections ( netstat -an | grep ESTABLISHED | wc -l), finding files by modification time, using find with -exec, creating cron jobs, and querying inodes ( ls -i, stat).
Linux Server Topics
Discuss Nginx performance tuning (minimize HTTP, use CDN, enable gzip, set cache headers, reduce redirects, optimize TCP stack). Show Nginx access‑control rules, expiration settings for favicon.ico and robots.txt, custom cache rules, IP‑based access with password protection, and HTTP‑to‑HTTPS redirection.
Explain cookie vs. session mechanisms, load‑balancing strategies (round‑robin, weighted, least connections), making HTTP stateful, TCP reliability versus UDP, CDN principles, DNS resolution flow, CNAME usage, and differences between A and NS records.
Database Fundamentals
Cover MySQL concepts such as SELECT syntax differences, data migration, load‑balancing, transaction properties (ACID), isolation levels, lock types (optimistic vs. pessimistic), common anomalies (dirty read, non‑repeatable read, phantom read), binlog formats (statement, row, mixed), binlog cleanup, replication architecture, and backup/restore techniques (mysqldump with --single-transaction, --master-data, selective table restore).
Shell Script Examples
# Kill a process by name
ps -ef | grep process_name | grep -v grep | awk '{print $2}' | xargs kill -9 # Add 20 users with random passwords
#!/bin/bash
for i in $(seq -f "%02g" 1 20); do
useradd user$i
echo "user$i-$(echo $RANDOM | md5sum | cut -c1-5)" | passwd --stdin user$i > /dev/null 2>&1
done # Check online IPs in 192.168.1.0/24
#!/bin/bash
for ip in $(seq 1 255); do
ping -c 1 192.168.1.$ip > /dev/null 2>&1 && echo 192.168.1.$ip UP || echo 192.168.1.$ip DOWN
done &Docker Essentials
Differentiate docker exec (run a new command in a running container) from docker attach (attach to the main process). Explain CMD vs. ENTRYPOINT, and docker stop (graceful SIGTERM then SIGKILL) vs. docker kill (immediate SIGKILL). Provide a volume‑backup example:
docker run --volumes-from AAA -v /tmp:/backup --name BACKUP ubuntu tar cvf /backup/AAA.tar /DATAAll code snippets are presented unchanged within pre and code tags, and non‑essential promotional sections have been removed.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
