Autocoder

Linux Interview Questions and Answers: Concepts, Permissions and Processes

Last updated 2026-11-19

Linux appears in interviews for system administration, DevOps, backend and SRE roles, and also in fresher OS rounds where it is the usual example system. Interviewers want to see that you understand how the system works, not only that you remember commands: what happens at boot, how permissions are evaluated, what a process state means, and why a disk can be full while files seem small.

This page covers the concept side of Linux. Command syntax, pipelines and one-liners have their own page, Linux commands interview questions, and automation is covered in shell scripting interview questions. For the surrounding job preparation see how to crack a DevOps interview.

FocusBoot, file system layout, permissions, processes, systemd, memory
Numericalschmod octal, umask results, load average reading
Related pagesLinux commands, shell scripting, OS file systems

What interviewers look for

Linux Interview Questions and Answers: questions with worked answers

  1. 1

    What is Linux, and what is the difference between Linux and a distribution?

    easy

    Linux is an open-source, Unix-like kernel first released by Linus Torvalds in 1991. It manages the CPU, memory, devices and processes. A distribution (Ubuntu, Debian, Fedora, RHEL, Arch) bundles the kernel with a package manager, system tools such as GNU utilities, an init system and often a desktop. Android also uses the Linux kernel but with a very different user space.

  2. 2

    Explain the Linux boot process.

    easy

    Firmware (BIOS or UEFI) performs the power-on self test and finds the boot device. The bootloader (GRUB) loads the kernel and an initial RAM file system (initramfs) containing drivers needed to reach the root disk. The kernel initialises hardware, mounts the root file system and starts PID 1, which is systemd on most current distributions. systemd then brings up services to reach the default target (multi-user or graphical), and a login prompt or display manager appears.

  3. 3

    Describe the standard directory layout.

    easy

    Everything is under a single root /. /bin and /usr/bin hold user commands, /sbin and /usr/sbin system administration commands, /etc configuration files, /home user data, /root the administrator's home, /var variable data such as logs (/var/log) and spools, /tmp temporary files, /dev device files, /proc and /sys virtual files exposing kernel and process information, /boot the kernel and bootloader files, /lib shared libraries, /opt optional software and /mnt or /media for mounted media.

  4. 4

    Explain Linux file permissions. What does chmod 754 mean?

    medium

    Each file has read (r = 4), write (w = 2) and execute (x = 1) bits for the owner, the group and others. chmod 754 sets the owner to 7 = 4 + 2 + 1 (rwx), the group to 5 = 4 + 1 (r-x) and others to 4 (r--), shown as rwxr-xr--. For directories, r lists the names, w allows creating or removing entries and x allows entering or accessing entries. chmod u+x file and chmod g-w file use symbolic form.

  5. 5

    Numerical: The umask is 022. What permissions do a new file and a new directory get? What if the umask is 027?

    medium

    Files start from 666 and directories from 777, and the umask bits are removed. With 022: file 666 - 022 = 644 (rw-r--r--), directory 777 - 022 = 755 (rwxr-xr-x). With 027: file 640 (rw-r-----), directory 750 (rwxr-x---). Strictly the umask is a bit mask (permission AND NOT umask), which matters when bits overlap, but for common umasks subtraction gives the same answer.

  6. 6

    What are SUID, SGID and the sticky bit?

    medium

    SUID (4000) on an executable makes it run with the file owner's privileges, as /usr/bin/passwd does to edit /etc/shadow. SGID (2000) runs with the file's group, and on a directory makes new files inherit the directory's group. The sticky bit (1000) on a directory, as on /tmp, lets users delete only their own files even though everyone can write there. They show as s or t in ls -l, and chmod 4755 or chmod 1777 sets them. SUID programs are a security risk if they have bugs.

  7. 7

    What is an inode, and what is the difference between a hard link and a symbolic link?

    medium

    An inode stores a file's metadata and block pointers but not its name; directory entries map names to inode numbers. A hard link is a second name for the same inode, sharing the data, and the data is freed only when the link count reaches zero. A symbolic link is a separate file that stores a path; it can span file systems and point to directories but dangles if the target disappears. See file systems interview questions.

  8. 8

    What are the process states shown by ps and top?

    medium

    R means running or runnable, S is interruptible sleep (waiting for an event), D is uninterruptible sleep (usually waiting for disk or network I/O and cannot be killed), T is stopped (by SIGSTOP or a debugger), and Z is a zombie, finished but not yet reaped by its parent. A system with many processes in D state is typically stuck on slow storage, and a growing number of Z processes points to a parent that does not call wait.

  9. 9

    What are signals? Compare SIGTERM, SIGKILL and SIGHUP.

    medium

    Signals are asynchronous notifications sent to a process. SIGTERM (15) politely asks a process to terminate, and it can be caught so the program can clean up. SIGKILL (9) cannot be caught or ignored and the kernel ends the process immediately, with no cleanup. SIGHUP (1) originally meant the terminal hung up; many daemons reload their configuration on it. SIGINT (2) is sent by Ctrl+C and SIGSTOP by a stop request. Try kill -15 before kill -9.

  10. 10

    What is systemd and how do you manage services?

    medium

    systemd is the init system and service manager that runs as PID 1. It starts services in parallel using dependency information in unit files and also manages mounts, timers and logging through journald. systemctl status nginx shows state, systemctl start, stop, restart and reload control it, systemctl enable makes it start at boot and journalctl -u nginx reads its logs. Targets such as multi-user.target replace the old numeric runlevels.

  11. 11

    What do the three numbers in load average mean? Interpret 4.00, 2.50, 1.00 on a 4-core machine.

    medium

    They are the average number of tasks that are running or waiting for the CPU (and on Linux also those in uninterruptible I/O wait) over the last 1, 5 and 15 minutes. On 4 cores a load of 4 means all cores are fully used. Here the load is 4.00 now, 2.50 five minutes ago and 1.00 fifteen minutes ago, so it is rising: the system has gone from idle (25 percent per core) to fully busy. A sustained load well above the core count means tasks are queueing.

  12. 12

    What are stdin, stdout and stderr, and how does redirection work?

    medium

    They are file descriptors 0, 1 and 2 that every process starts with. > redirects stdout to a file (overwriting), >> appends, < reads stdin from a file, 2> redirects stderr, and 2>&1 sends stderr to the same place as stdout. For example cmd > out.log 2>&1 captures both. A pipe | connects one process's stdout to the next process's stdin. /dev/null discards anything written to it.

  13. 13

    What is swap space and what is the OOM killer?

    medium

    Swap is disk space the kernel uses to hold memory pages that are not actively used, letting more programs fit in RAM. Heavy swapping makes a system very slow. When memory and swap are exhausted, the kernel's out-of-memory killer picks a process using a score based on memory use and kills it to free memory, logging this to dmesg. Check dmesg or journalctl -k for Out of memory messages when a service disappears.

  14. 14

    A server shows a full disk. What do you check?

    medium

    First df -h to find which file system is full, and df -i in case inodes are exhausted. Then du -sh /var/* or du -x --max-depth=1 / to find the big directories, with log directories and /tmp as usual culprits. Check for deleted files still held open by a process with lsof +L1, since space returns only when it closes. Fix by rotating or compressing logs (logrotate), clearing package caches, or restarting the process holding deleted files.

  15. 15

    How do you find why a Linux server is slow?

    hard

    Work systematically through the resources. uptime shows load. top or htop show per-process CPU and memory, and whether the CPU time is user, system or I/O wait (wa). free -h and vmstat 1 show memory pressure and swapping (si and so columns). iostat -x 1 shows disk utilisation and latency. ss -s and netstat show network state. dmesg and journalctl show kernel errors. The pattern is to identify which resource (CPU, memory, disk, network) is saturated before investigating the process.

  16. 16

    What is the difference between a process and a daemon, and how is a daemon created?

    hard

    A daemon is a background process that has no controlling terminal and usually runs for the lifetime of the system, such as sshd or cron. The classic way to create one is to fork and exit the parent, call setsid to start a new session, fork again so it can never reacquire a terminal, change the directory to /, set umask to 0 and close the standard descriptors. Today, you simply write a program that stays in the foreground and let systemd supervise it with a unit file.

  17. 17

    What are namespaces and cgroups, and how do they relate to containers?

    hard

    Namespaces give a process its own view of a system resource: PID, network, mount, UTS (hostname), IPC and user namespaces each isolate one aspect. Control groups (cgroups) limit and account the resources that a group of processes may use, such as CPU shares and memory. A container is simply a process (or group) started inside a set of namespaces and cgroups on the shared host kernel, which is why containers start in milliseconds compared with virtual machines. See Docker interview questions.

Frequently asked questions

What is the difference between Linux and Unix?

Unix is the family of operating systems that began at Bell Labs and includes commercial systems like AIX and Solaris. Linux is an independent, open-source kernel that follows Unix design and POSIX interfaces but contains no original Unix code.

Which Linux distribution should I practise on for interviews?

Ubuntu or Debian for commands used in many jobs, and a RHEL-family system such as Rocky, AlmaLinux or Fedora for enterprise roles. The concepts and core commands are the same.

What is the difference between su and sudo?

su switches to another user after you enter that user's password. sudo runs a single command with another user's (usually root's) privileges after you enter your own password, if the sudoers file allows it, and it logs each use, which is why it is preferred.

What is the difference between a process and a thread in Linux?

Both are tasks created by clone(); the flags decide what is shared. Threads in the same process share memory and files, while separate processes do not. See the processes and threads page for details.

Related guides

More in CS Fundamentals Interview Questions

See all in this section