Linux Administration Interview Questions and Answers

Processes, permissions, systemd, storage, logs and troubleshooting.

Practise 10 random 5 peer-reviewed questions
Linux Administration Interview Syllabus & Preparation Strategy

Whether you are preparing for entry-level Linux Administration interview questions for freshers or senior software engineer interview questions addressing concurrency, scalability, and system architecture, this track provides peer-reviewed model answers with syntax walkthroughs, edge cases, and practical interview tips.

1 Explain Linux file permissions and chmod. Medium

Linux permissions have three classes (user, group, other) and three bits each: read (4), write (2), and execute (1).

  • ls -l shows them as rwxr-xr--. The leading character is the type: d for directory, - for file, l for symlink.
  • chmod sets permissions with symbolic (u+x) or octal (755) notation.
  • chown changes owner and group. Directories also have setuid, setgid, and sticky bits; the sticky bit on /tmp means only owners can delete their files.
chmod 640 config.yml      # rw-r-----
chmod u+x deploy.sh
chown app:app /var/www
chmod +t /shared

Special bits: setuid runs a file as its owner, used by passwd, and setgid on a directory makes new files inherit the group. Also check ACLs with getfacl. Always apply least privilege, especially on secrets.

2 How does systemd manage services? Medium

systemd is the init system on most modern distributions. It starts services and manages dependencies, logging, and lifecycle.

  • Units describe resources: .service, .socket, .timer, .target, and .mount.
  • Unit files live in /etc/systemd/system for custom units, /usr/lib/systemd/system for packaged ones, or ~/.config/systemd/user for user units.
  • systemctl controls units: start, stop, restart, reload, enable, disable, and status.
  • Dependencies use After, Wants, and Requires. Targets group units for boot states.
  • journald collects logs, and journalctl reads them.
[Unit]
Description=My API
After=network.target
[Service]
ExecStart=/usr/bin/myapi --port 8080
Restart=on-failure
User=app
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now myapi
systemctl status myapi

Run daemon-reload after editing unit files, and enable for boot persistence.

3 What is the difference between a hard link and a symbolic link? Medium

Both point to files, but at different levels.

  • Hard link: another directory entry for the same inode. The file data is shared, and the link count increases. Deleting one name does not remove the data until all links are gone. Hard links cannot cross filesystems and usually cannot point to directories.
  • Symbolic (soft) link: a separate file containing the path to the target. It can cross filesystems, point to directories, and become dangling if the target is removed. Permissions on the link itself are ignored; the target's permissions apply.
ln file.txt hard.txt      # hard link
ln -s /var/www site       # symbolic link
ls -li                    # shows inode and link count
readlink site

Use hard links for deduplication and backups within a filesystem, such as rsync --link-dest, and symlinks for flexible references such as versioned releases and config pointers.

4 How do you troubleshoot high CPU or memory usage on Linux? Medium

Identify the consumer before acting.

CPU:

top -o %CPU
uptime              # load average
pidstat 1 5         # per-process CPU
perf top            # hot functions

Check load average against core count. High load with low CPU often means I/O wait. Look at runnable versus blocked processes, and check for CPU steal on virtual machines.

Memory:

free -h
vmstat 1 5
ps -eo pid,rss,cmd --sort=-rss | head
cat /proc/<pid>/status | grep -i vm

Distinguish buff and cache from used memory; Linux uses free RAM for caching. Check for OOM kills in dmesg or journalctl -k. Look for swap thrashing, visible as high si and so in vmstat.

Then profile the application, check for leaks, tune limits, or right-size the instance. Use cgroups to cap runaway processes.

5 How do you schedule recurring tasks with cron and what are common pitfalls? Medium

cron runs commands on a schedule defined by five time fields: minute, hour, day of month, month and day of week.

# m h dom mon dow command
30 2 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1

Common pitfalls:

  • cron uses a minimal environment, so PATH and variables from your shell are absent. Use absolute paths or set PATH at the top of the crontab.
  • Redirect stdout and stderr or you lose the output.
  • Jobs run concurrently if the previous run overruns; guard with flock.
  • The percent sign is special and must be escaped.
  • Timezone depends on the system or CRON_TZ.

For complex schedules, prefer systemd timers, which offer logging through journald, dependency handling and better observability.

Frequently Asked Questions About Linux Administration Interviews

What do hiring managers evaluate in Linux Administration technical rounds?

Technical interviewers look for foundational fluency, idiomatic syntax, clarity when communicating complex logic, and awareness of performance trade-offs (e.g. memory footprint, render performance, and network latency) in production environments.

What are the best interview tips for practicing Linux Administration questions?

Use active recall: summarize each answer in your own words before revealing the model solution. Focus on explaining why a certain approach is chosen rather than just memorizing code syntax.