Operations 17 min read

30 Essential Linux Interview Questions and Answers for Developers

This article compiles the most common Linux interview questions—covering core components, boot loaders, storage management, networking modes, essential commands, security features, and system administration tricks—providing concise answers and code examples to help developers and sysadmins prepare for technical interviews.

Liangxu Linux
Liangxu Linux
Liangxu Linux
30 Essential Linux Interview Questions and Answers for Developers

Linux is a Unix‑like, open‑source operating system that powers everything from smartphones to supercomputers, making it a frequent topic in system‑administration and development interviews.

Source: https://codersera.com/blog/linux-interview-questions/

Question 1: What are the basic elements or components of Linux?

Kernel : Core of the OS handling process, device, and memory management.

System libraries : Provide APIs that applications use to call kernel functions without writing kernel code.

System utilities : Programs that perform routine tasks and allow users to manage the system.

Hardware : Physical devices such as CPU, memory, disks, keyboards, etc.

Shell : Command‑line interpreter that bridges users and the kernel.

Question 2: What is LILO?

LILO stands for Linux Loader; it is a boot loader that loads the Linux kernel into memory and starts the operating system.

Question 3: Why use LVM?

LVM (Logical Volume Manager) abstracts physical storage, allowing flexible creation, resizing, and removal of logical partitions, and lets you pool multiple disks into a single volume group.

Question 4: What are the different Linux network bond modes?

Mode 0 (balance‑rr) : Default round‑robin load‑balancing and fault‑tolerance.

Mode 1 (active‑backup) : Only one interface is active; others take over on failure.

Mode 2 (balance‑xor) : XOR of source and destination MAC addresses for fault tolerance.

Mode 3 (broadcast) : Sends traffic on all slave interfaces; used for specific scenarios.

Mode 4 (802.3ad) : Dynamic link aggregation using LACP.

Mode 5 (balance‑tlb) : Adaptive transmit load balancing based on current load.

Mode 6 (balance‑alb) : Adaptive load balancing without switch support.

Question 5: Default ports for SMTP, DNS, FTP, DHCP, SSH, and Squid

See the image below for a concise table of the standard ports.

Default ports table
Default ports table

Question 6: How to delete a file or directory?

Use the rm command. Example:

rm filename

Question 7: Explain the rmdir command

rmdir

removes empty directories. Syntax:

rmdir [-p] [-v|--verbose] [--ignore-fail-on-non-empty] directory

Question 8: What does a Linux pipe do?

A pipe redirects the output of one command as the input to another, allowing command chaining.

command1 | command2 | command3 … | commandN

Question 9: What is a zombie process?

A zombie is a process that has finished execution but still has an entry in the process table because its parent has not yet read its exit status via wait. Once wait is called, the zombie is removed.

Question 10: Characteristics of a stateless Linux server

Stores a prototype of each system.

Keeps snapshots of configurations.

Maintains home directories separately.

Uses LDAP to map snapshots to specific systems.

Question 11: Run a command for a limited time

Use the timeout utility, e.g.:

timeout 10s ./script.sh

Question 12: Restart a script every 30 minutes

# Restart every 30 minutes
while true; do timeout 30m ./script.sh; done

Question 13: Run a command when a file changes

while inotifywait -e close_write document.tex; do
  make
done

Question 14: List contents of a tar.gz and extract a single file

tar -tf file.tgz          # list contents
tar -xf file.tgz filename # extract only <em>filename</em>

Question 15: Get the absolute path of a file

readlink -f file.txt

Question 16: Limit a command's memory usage

ulimit -Sv 1000   # limit to 1000 KB
ulimit -Sv unlimited   # remove limit

Question 17: Differences between Linux and Windows

See the comparative images below.

Linux vs Windows comparison
Linux vs Windows comparison
Linux vs Windows graphic
Linux vs Windows graphic

Question 18: Purpose of the df command

Displays available disk space.

df -h

Question 19: Purpose of the du command

Shows disk usage of files and directories.

$ du -sh /var/log/*
1.8M  /var/log/anaconda
384K  /var/log/audit
4.0K  /var/log/boot.log
…

Question 20: Purpose of the env command

Prints or sets environment variables.

$ env
PYTHON_PIP_VERSION=9.0.1
HOME=/root
…

Question 21: Purpose of the ps command

Shows process status.

$ ps -ef
$ ps -ef | grep tomcat

Question 22: Purpose of the grep command

Searches for patterns in files or command output.

$ cat tomcat.log | grep org.apache.Catalina.startup.Catalina.start

Question 23: Purpose of the cat command

Concatenates and displays file contents.

$ cat requirements.txt
flask
flask_pymongo

Question 24: Purpose of the tail command

Shows the last part of a file, useful for log inspection.

$ tail -n 100 /var/log/httpd/access_log

Question 25: Why is Linux considered more secure?

Limited user accounts reduce attack surface.

Strong community quickly patches vulnerabilities.

iptables provides robust firewall capabilities.

Multiple distributions (Mint, Debian, Arch, etc.) offer varied security models.

Extensive logging aids forensic analysis.

Smaller user base compared to Windows reduces exposure.

Question 26: How does Ctrl+Alt+Del work on Linux?

It triggers an immediate reboot without a confirmation prompt.

Question 27: Internal vs. external commands

Internal : Executed directly by the shell, no separate process.

External : Separate executable files run as independent processes.

Question 28: Differences between Bash and DOS

See the comparative image below.

Bash vs DOS
Bash vs DOS

Question 29: Key characteristics of Linux

Portability : Runs on diverse hardware.

Open source : Source code freely available.

Multi‑user : Supports simultaneous users.

Multitasking : Executes multiple processes concurrently.

Shell : Powerful command interpreter.

Security : Built‑in authentication, authorization, and encryption.

Question 30: Popular Linux distributions and their typical uses

Linux Mint : Stable desktop experience with Mate or Cinnamon.

Debian : Known for robustness and long‑term stability.

Ubuntu : Desktop and server editions, Debian‑based.

openSUSE : Good for both newcomers and experienced users.

Manjaro : User‑friendly Arch‑based distribution.

Summary

Linux is a free, open‑source operating system that runs efficiently on virtually any computer. Understanding its core components, common commands, and system‑administration concepts is essential for developers and sysadmins preparing for technical interviews.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

SecurityinterviewNetworking
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.