Learn Linux core architecture, production scenario-based questions, incident response, and real-world engineering solutions.
โ Q1: Explain what Linux is and why it is widely used in DevOps environments.
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q2: What is the Linux kernel and what role does it play in the operating system?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q3: Explain the Linux filesystem hierarchy and the purpose of /etc, /var, /home, /tmp, and /usr.
Click on the dropdown below to reveal the technical answer.
Answer:
/etc โ Configurations: Stores system-wide config files (e.g., config profiles, hosts)./var โ Variable Data: Contains volatile files such as system/app logs and database caches./home โ User Space: The personal directory partition for standard non-root users./tmp โ Temporary Storage: Holds transient files created by running programs (regularly cleared on boot)./usr โ System Resources: Stores system binaries, shared library files, and user programs.โ Q4: What happens internally when you run the
lscommand in Linux?Click on the dropdown below to reveal the technical answer.
Answer:
/usr/bin/ls).fork() to clone itself and execve() to load the ls code into memory.ls calls system routines (like getdents) requesting the directory contents from the kernel.โ Q5: What is the difference between Linux and UNIX?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q6: What is the role of the shell in Linux?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q7: What are the different types of shells available in Linux?
Click on the dropdown below to reveal the technical answer.
Answer:
sh (Bourne), bash (Bourne-Again), zsh (Z Shell), ksh (Korn), and csh (C Shell).bash is the standard default choice for DevOps because of its robust scripting capabilities, history tracking, and universal compatibility across Linux distributions.โ Q8: What is the root user and why is it powerful?
Click on the dropdown below to reveal the technical answer.
Answer:
0).โ Q9: How do you create, copy, move, and delete files in Linux?
Click on the dropdown below to reveal the technical answer.
Answer:
touch file1.txt
cp file1.txt file2.txt
cp file1.txt /home/user/
mv file1.txt /home/user/
mv file1.txt newfile.txt
rm file1.txt
rm -r foldername
rm -rf foldername
โ Q10: What is the difference between
cpandmvcommands?Click on the dropdown below to reveal the technical answer.
Answer:
cp (Copy):
mv (Move):
โ Q11: What happens if you run
rm -rf /accidentally?Click on the dropdown below to reveal the technical answer.
Answer:
--no-preserve-root) against it.โ Q12: How do you search for a file in a Linux system?
Click on the dropdown below to reveal the technical answer.
Answer:
find command: Searches for files by name, path, or size recursively in real-time within directories.locate command: A faster search alternative that queries an indexed system database.grep command is used to search text patterns inside files, not to locate files themselves.โ Q13: What is the difference between a soft link and a hard link?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q14: When would you use a symbolic link in a DevOps environment?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q15: How do you check the disk usage of a directory?
Click on the dropdown below to reveal the technical answer.
Answer:
du -sh to check the total space used by a specific directory.
-s = summary (total size only).-h = human-readable format.df -h to check overall disk space usage of filesystems, not individual directories.โ Q16: How do you create a new user in Linux?
Click on the dropdown below to reveal the technical answer.
Answer:
useradd or adduser commands with sudo privileges.passwd <username> command.adduser command is more user-friendly because it automatically creates the home directory and guides you through setting up user details.โ Q17: How do you assign a user to a group?
Click on the dropdown below to reveal the technical answer.
Answer:
sudo usermod -aG <groupname> <username> command.-aG option adds the user to a group (append to secondary groups) without removing any of their existing group memberships.groups <username> command.โ Q18: What is the difference between a primary group and a secondary group?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q19: What are
/etc/passwdand/etc/shadowfiles used for?Click on the dropdown below to reveal the technical answer.
Answer:
/etc/passwd: Stores general user account configuration details (e.g., username, UID, GID, home directory, login shell), but does not store passwords./etc/shadow: Stores encrypted user passwords and password-aging information. It is more secure and is accessible only by the root user.โ Q20: How do you delete a user and ensure cleanup of their home directory?
Click on the dropdown below to reveal the technical answer.
Answer:
sudo userdel <username> to remove the user account from the system.sudo userdel -r <username> to delete the user along with their home directory and mailbox files. The -r option ensures a complete cleanup of user data.โ Q21: What is the purpose of the
wheelgroup in Linux?Click on the dropdown below to reveal the technical answer.
Answer:
sudo and temporarily gain root privileges.โ Q22: Explain Linux file permissions (read, write, execute).
Click on the dropdown below to reveal the technical answer.
Answer:
r): Allows viewing the contents of a file or listing files in a directory.w): Allows modifying file contents or adding/deleting files in a directory.x): Allows running a file as a program or entering a directory.4217 (4+2+1 = rwx), 5 (4+1 = r-x), and 4 (r--).โ Q23: What is the numeric permission system (like 755, 644)?
Click on the dropdown below to reveal the technical answer.
Answer:
755 or 644).4), Write (2), and Execute (1).755: User has full permissions (rwx = 7), while Group and Others have read/execute permissions (r-x = 5).644: User has read/write permissions (rw- = 6), while Group and Others have read-only permissions (r-- = 4).โ Q24: How does
chmod 777affect security?Click on the dropdown below to reveal the technical answer.
Answer:
rwx) to User, Group, and Others (everyone on the system).โ Q25: What is
umaskin Linux?Click on the dropdown below to reveal the technical answer.
Answer:
666 for files and 777 for directories).โ Q26: What is ACL and why is it used in DevOps systems?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q27: What is the difference between foreground and background processes?
Click on the dropdown below to reveal the technical answer.
Answer:
&) to the command.fg (foreground) and bg (background) commands to switch execution modes.โ Q28: What is a zombie process and how do you find one?
Click on the dropdown below to reveal the technical answer.
Answer:
ps or top, where its status is flagged as Z.โ Q29: What is an orphan process?
Click on the dropdown below to reveal the technical answer.
Answer:
init or systemd process (PID 1).โ Q30: What is
grepand how is it used in log analysis?Click on the dropdown below to reveal the technical answer.
Answer:
โ Q31: What are
awkandsedused for in DevOps?Click on the dropdown below to reveal the technical answer.
Answer:
awk:
sed:
โ Q32: What is mounting and unmounting in Linux?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q33: What is
/etc/fstabused for?Click on the dropdown below to reveal the technical answer.
Answer:
โ Q34: What happens if a disk becomes 100% full in production?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q35: How do you check open ports in Linux?
Click on the dropdown below to reveal the technical answer.
Answer:
netstat -tulnp, ss -tulnp, or lsof -i.โ Q36: What is a firewall and how does it work in Linux?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q37: What is SSH key authentication and how does it work?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q38: What is the difference between
scpandrsync?Click on the dropdown below to reveal the technical answer.
Answer:
scp: Securely copies files between local and remote systems over SSH, but copies the entire file every single time.rsync: Synchronizes files efficiently by transferring only the delta differences (changed parts), making it faster and more suitable for backups.โ Q39: How do you monitor log updates in real-time?
Click on the dropdown below to reveal the technical answer.
Answer:
tail -f <file_path> command.โ Q40: How do you debug a failed systemd service?
Click on the dropdown below to reveal the technical answer.
Answer:
systemctl status <service_name> to check current state.journalctl -u <service_name>.systemctl restart <service_name>.โ Q41: What is the difference between
enableandstartin systemd?Click on the dropdown below to reveal the technical answer.
Answer:
start: Used to start/launch a service immediately in the current active session.enable: Configures the service to launch automatically during the system boot sequence.โ Q42: What is the difference between
yum/dnfandapt?Click on the dropdown below to reveal the technical answer.
Answer:
yum / dnf: Package managers used in Red Hat-based Linux distributions to manage RPM packages.apt: Package manager used in Debian-based systems like Ubuntu to manage DEB packages.โ Q43: How do you schedule and list cron tasks?
Click on the dropdown below to reveal the technical answer.
Answer:
crontab -e to open the cron editor to add or modify recurring tasks.crontab -l to list active cron tasks.โ Q44: What is the significance of the shebang
#!/bin/bashin a script?Click on the dropdown below to reveal the technical answer.
Answer:
#! symbol is called a shebang, consisting of a hash (#) and an exclamation mark (!)./bin/bash) should execute the script.โ Q45: What does
$?represent in shell scripting?Click on the dropdown below to reveal the technical answer.
Answer:
0 represents success, while any non-zero value indicates failure. Helpful for scripting error handling.โ Q46: Explain the step-by-step Linux boot sequence.
Click on the dropdown below to reveal the technical answer.
Answer:
initramfs (initial RAM disk) into memory./sbin/init (PID 1).โ Q47: What is an Inode in the Linux filesystem?
Click on the dropdown below to reveal the technical answer.
Answer: An Index Node (Inode) is a database entry containing metadata for a file (size, owner, permissions, pointers to disk blocks) except the filename itself. The filename-to-inode mapping is kept in directory directories.
Answer:
uptime to check load averages, and htop to identify CPU/RAM hotspots.iostat -xz 1 to check if high storage operations are blocking CPU execution (%iowait).free -m to check if swap memory is active (indicating memory exhaustion).ss -tulnp to check port queues and active connections.dmesg -T to check for hardware alerts or OOM Killer events.โ Q48: How do you monitor CPU, memory, disk, and network usage in a Linux server in real time?
Click on the dropdown below to reveal the technical answer.
Answer:
htop or top (live process load), mpstat 1 (per-cpu metrics).free -h -s 1 (RAM stats every second), vmstat 1 (virtual memory).iostat -xz 1 (average read/write wait times).sar -n DEV 1 or iftop (bandwidth interface metrics).โ Q49: What is load average in Linux and how do you interpret it?
Click on the dropdown below to reveal the technical answer.
Answer:
Load average is the average number of active CPU processes (state R) plus processes waiting for disk/network I/O operations (state D) over 1, 5, and 15 minutes.
4.0 indicates 100% saturation. A load of 8.0 indicates that half the active tasks are waiting in queues for resource allocation.โ Q50: What is the difference between CPU usage and load average?
Click on the dropdown below to reveal the technical answer.
Answer:
D).โ Q51: What is log rotation, why is it required, and how does
logrotatework?Click on the dropdown below to reveal the technical answer.
Answer: Log rotation archives active log files, compresses older entries, and creates fresh files.
logrotate reads configurations in /etc/logrotate.d/. It rotates log files, compresses old logs, and notifies application daemons (using postrotate scripts) to start writing to the new file descriptor.โ Q52: How do you secure a Linux server in production?
Click on the dropdown below to reveal the technical answer.
Answer:
PasswordAuthentication no), and change the default port.โ Q53: How do you recover a system if
/etc/fstabis misconfigured?Click on the dropdown below to reveal the technical answer.
Answer:
mount -o remount,rw /./etc/fstab and correct the disk mount UUID or comment out the line.โ Q54: What is LVM and how do you extend disk space online?
Click on the dropdown below to reveal the technical answer.
Answer: LVM (Logical Volume Manager) abstracts physical storage into flexible partitions.
# 1. Initialize physical device
pvcreate /dev/sdc
# 2. Add to Volume Group
vgextend app_vg /dev/sdc
# 3. Resize Logical Volume and underlying filesystem online
lvextend -r -l +100%FREE /dev/app_vg/app_lv
โ Q55: What happens internally when a packet travels from client to server?
Click on the dropdown below to reveal the technical answer.
Answer:
write().โ Q56: What is context switching?
Click on the dropdown below to reveal the technical answer.
Answer: The kernel action of saving the current CPU execution state (registers, memory maps) of an active thread and loading the saved execution state of another thread. It is resource-intensive.
โ Q57: What is idempotency in automation?
Click on the dropdown below to reveal the technical answer.
Answer: The quality of a script or tool (like Ansible) to produce the exact same system configuration state regardless of how many times it is run, without producing errors or side effects.
โ Q58: Production outage occurs at midnight โ what is your step-by-step response?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q59: What is Inode table exhaustion?
Click on the dropdown below to reveal the technical answer.
Answer:
Occurs when a disk partition runs out of Index Nodes (Inodes) to store file metadata entries, preventing the creation of new files, even if the disk has free physical capacity. Verify using df -i.
โ Q60: You are given access to a new Linux server with no documentation โ how do you understand its purpose?
Click on the dropdown below to reveal the technical answer.
Answer:
systemctl list-units --type=service --state=running.sudo ss -tulnp.ps auxf.history.df -h and cat /etc/fstab.โ Q61: What is the difference between user space and kernel space?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q62: What are system calls (syscalls) in Linux?
Click on the dropdown below to reveal the technical answer.
Answer: A system call is the programmatic interface (API) that allows user-space applications to request services from the kernel. Examples include:
read() / write(): Input/Output operations on file descriptors.open() / close(): Allocate/release file access.fork(): Duplicate the calling process.execve(): Load and run a new executable binary.โ Q63: What is CPU scheduling in Linux?
Click on the dropdown below to reveal the technical answer.
Answer: CPU scheduling decides which process gets execution time on a CPU core. Modern Linux uses the Completely Fair Scheduler (CFS):
vruntime).vruntime to run next, utilizing a Red-Black tree structure to retrieve processes in $O(\log N)$ time.โ Q64: What is context switching?
Click on the dropdown below to reveal the technical answer.
Answer: The kernel operation where the state (registers, program counter, memory maps) of an active thread or process is saved, and the state of another thread is loaded onto the CPU core so execution can switch to the new process. High rates of context switching indicate resource contention.
โ Q65: What is virtual memory?
Click on the dropdown below to reveal the technical answer.
Answer: An abstraction layer that gives each process the illusion of having a large, contiguous block of memory. The hardware Memory Management Unit (MMU) translates these virtual addresses to actual non-contiguous physical addresses in RAM or swap partitions.
โ Q66: What is paging?
Click on the dropdown below to reveal the technical answer.
Answer: The memory management scheme where virtual and physical memory are divided into fixed-size blocks called Pages (typically 4KB in size). When physical RAM becomes low, the kernel moves inactive pages from RAM to disk swap space.
โ Q67: What is page fault?
Click on the dropdown below to reveal the technical answer.
Answer: An interrupt triggered by the hardware MMU when a process attempts to access a virtual memory page that is not currently loaded in physical RAM. The kernel catches this interrupt, loads the required page from disk (or swap) into RAM, and resumes the process.
โ Q68: What is OOM killer?
Click on the dropdown below to reveal the technical answer.
Answer: The Out-Of-Memory (OOM) killer is a kernel daemon that acts when both physical RAM and swap space are completely exhausted. It calculates badness scores and automatically terminates processes consuming high memory with low priority to prevent the entire operating system from crashing.
โ Q69: What is superblock?
Click on the dropdown below to reveal the technical answer.
Answer: A metadata block in Unix/Linux filesystems (like ext4) that stores file system-wide properties: total size, block size, empty/used blocks, total inode counts, status flags, and magic numbers identifying the filesystem type.
โ Q70: What is journaling in ext4?
Click on the dropdown below to reveal the technical answer.
Answer: Journaling maintains a dedicated log file (the journal) where file write intentions are written before changes are applied to the main filesystem blocks. If a server loses power mid-write, the kernel reads the journal on reboot to complete or roll back incomplete writes, preventing filesystem corruption.
โ Q71: Difference between ext3 and ext4?
Click on the dropdown below to reveal the technical answer.
Answer:
fsck).โ Q72: What happens when file is deleted in Linux?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q73: What happens internally when chmod is executed?
Click on the dropdown below to reveal the technical answer.
Answer:
The command executes the chmod() system call. The kernel locates the target file's inode and modifies the 9 permission bits (representing user, group, and other read/write/execute flags) along with special bits (SUID, SGID, Sticky). This updates the filesystem metadata without altering the file's data blocks.
โ Q74: What is effective user ID?
Click on the dropdown below to reveal the technical answer.
Answer:
passwd), the RUID remains the standard user, but the EUID changes to root, granting root-level file access.โ Q75: What is sticky bit used for?
Click on the dropdown below to reveal the technical answer.
Answer:
When set on a directory (e.g. chmod +t /tmp), it restricts file deletion. A user can only delete or rename files they personally own, even if the directory itself has 777 permissions.
โ Q76: What is init process?
Click on the dropdown below to reveal the technical answer.
Answer:
The first process started by the Linux kernel during the boot sequence (always assigned PID 1). It serves as the root ancestor of all user space processes, adopts orphan processes, and coordinates service launches. In modern systems, this is managed by systemd.
โ Q77: What is orphan process?
Click on the dropdown below to reveal the technical answer.
Answer:
A running process whose parent process terminated before it did. In this scenario, the parent child linkage is broken, and the child is adopted by the initialization daemon (systemd / PID 1) to ensure its eventual exit code is reaped.
โ Q78: What is fork bomb?
Click on the dropdown below to reveal the technical answer.
Answer: A denial-of-service attack where a process continually spawns new copies of itself recursively until the system runs out of PID slots.
:(){ :|:& };:/etc/security/limits.conf to set maximum process limits (nproc) for non-root users:
* hard nproc 2048
โ Q79: What is nice value?
Click on the dropdown below to reveal the technical answer.
Answer:
The nice value is a user-space parameter ranging from -20 (highest priority) to 19 (lowest priority). It tells the kernel scheduler how "nice" a process should be to other processes. The lower the nice value, the higher CPU scheduling priority it receives.
โ Q80: What is /dev directory?
Click on the dropdown below to reveal the technical answer.
Answer:
The directory containing device node files representing physical and virtual hardware (e.g. storage disks /dev/sda, terminals /dev/tty, null device /dev/null). It implements the Unix design principle that "everything is a file".
โ Q81: What is kernel driver?
Click on the dropdown below to reveal the technical answer.
Answer: A module of code loaded into kernel space that acts as a translator, allowing the kernel to communicate with specific physical hardware devices or virtual network controllers.
โ Q82: What is udev?
Click on the dropdown below to reveal the technical answer.
Answer:
The dynamic device manager daemon in Linux. It runs in user space, monitors kernel events (via uevent) when hardware is hot-plugged, and automatically creates or removes corresponding device nodes in the /dev directory.
โ Q83: What are signals in Linux?
Click on the dropdown below to reveal the technical answer.
Answer:
Asynchronous notifications sent by the kernel to a process (or between processes) to inform it of events or request state changes (e.g. SIGINT to interrupt, SIGSEGV for segmentation fault).
โ Q84: Difference between SIGKILL and SIGTERM?
Click on the dropdown below to reveal the technical answer.
Answer:
SIGTERM (15): Request to terminate. The target process can intercept, block, or ignore this signal to run cleanup procedures before exiting.SIGKILL (9): Immediate termination. The signal cannot be intercepted, blocked, or ignored by the process, and the kernel destroys the process immediately.โ Q85: What is iowait?
Click on the dropdown below to reveal the technical answer.
Answer:
The percentage of CPU idle time during which the system had outstanding disk or network I/O write/read requests. High iowait indicates storage bottlenecks.
โ Q86: What is load average really measuring?
Click on the dropdown below to reveal the technical answer.
Answer:
The total number of processes using or waiting for CPU cycles (state R) plus those blocked waiting for disk/network I/O (uninterruptible sleep - state D). It is an indicator of system saturation, not just CPU execution.
โ Q87: What is vmstat used for?
Click on the dropdown below to reveal the technical answer.
Answer: Prints real-time statistics regarding virtual memory paging, CPU execution, processes, block I/O, trap interrupts, and context switching.
โ Q88: What is strace?
Click on the dropdown below to reveal the technical answer.
Answer:
A diagnostic tool that runs an executable and prints every system call (open, read, write) it triggers along with their arguments and return codes, useful for debugging execution failures.
โ Q89: What is lsof?
Click on the dropdown below to reveal the technical answer.
Answer: List Open Files. It lists all active files, directories, network sockets, and pipes held open by running processes, which is useful for identifying lock-holders or listening ports.
โ Q90: What is initramfs?
Click on the dropdown below to reveal the technical answer.
Answer:
An initial RAM-based filesystem loaded into memory by the bootloader during system startup. It contains the drivers and scripts required to initialize disks (like RAID, LVM, or encrypted partitions) so the kernel can mount the real root filesystem /.
โ Q91: What is runlevel in Linux?
Click on the dropdown below to reveal the technical answer.
Answer: A software configuration state in System V init systems that dictates what services run.
0: Shutdown.3: Multi-user text console interface.5: Graphical GUI interface.6: Reboot.multi-user.target).โ Q92: Why does Linux prefer command line over GUI for servers?
Click on the dropdown below to reveal the technical answer.
Answer:
โ Q93: Why is everything treated as a file in Linux?
Click on the dropdown below to reveal the technical answer.
Answer:
It provides a uniform interface. The same system calls (open, read, write, close) are used to read text configurations, write blocks to physical hard disks, query system processes (/proc), send data over network sockets, and interact with hardware devices.
โ Q94: What happens when CPU is fully utilized?
Click on the dropdown below to reveal the technical answer.
Answer: New processes must wait in the CPU run queue. The load average increases, process scheduling latency increases, and application response times drop.
โ Q95: What happens when inode table is full?
Click on the dropdown below to reveal the technical answer.
Answer:
The system cannot create any new file metadata entries, meaning file creation attempts will return a No space left on device error, even if there is ample physical disk space available.