Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
1K views13 pages

DevOps Shack - 200 Scenario-Based Linux Interview Ques

The document contains 200 scenario-based Linux interview questions covering various topics such as basic administration, file systems, networking, security, performance optimization, automation, and troubleshooting. Each question is designed to assess the candidate's practical knowledge and problem-solving skills in a Linux environment. The questions range from user management and process handling to advanced topics like cloud configuration and high-availability clustering.

Uploaded by

Saurabh Dube
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views13 pages

DevOps Shack - 200 Scenario-Based Linux Interview Ques

The document contains 200 scenario-based Linux interview questions covering various topics such as basic administration, file systems, networking, security, performance optimization, automation, and troubleshooting. Each question is designed to assess the candidate's practical knowledge and problem-solving skills in a Linux environment. The questions range from user management and process handling to advanced topics like cloud configuration and high-availability clustering.

Uploaded by

Saurabh Dube
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

DevOps Shack

200 scenario-based Linux interview questions

Basic Linux Administration


1.​
User Management: A user complains they cannot log
in. How will you troubleshoot?
2.​
File Permissions: A script is executable by one
user but not another. How do you resolve this?
3.​
Process Management: A service is consuming 100%
CPU. How will you find and fix it?
4.​
SSH Issues: You cannot SSH into a remote machine.
How do you debug?
5.​
Disk Space Full: / partition is full. How do you
find and delete large files safely?
6.​
File Corruption: A log file is showing junk
characters. How will you check and recover it?
7.​
Crontab Not Running: A scheduled job is not
executing. How do you debug?
8.​
Package Installation Failing: yum or apt is
failing. How will you resolve it?
9.​
User Cannot Sudo: A user was added to sudoers, but
sudo still doesn’t work. What could be wrong?
10.​ Kernel Panic: How do you troubleshoot and recover
from a kernel panic?
11.​ Zombie Processes: How do you identify and remove
zombie processes?​


12.​ Too Many Open Files Error: How do you fix “Too
many open files” in Linux?
13.​ Finding and Killing Processes: A process is
causing high memory usage. How do you locate and
stop it?
14.​ Home Directory Missing: A user's home directory
is missing. How will you restore it?
15.​ Time Sync Issues: The server time is incorrect.
How do you fix NTP sync?
16.​ Finding Recently Changed Files: How do you find
all files modified in the last 10 minutes?
17.​ Deleting Large Files But Space Not Freeing Up:
What could be the reason?
18.​ Checking System Load: How do you analyze high
system load issues?
19.​ NFS Mount Issues: How do you troubleshoot an NFS
mount not working?
20.​ Hostname Resolution Issues: ping is working, but
ssh is failing by hostname. Why?

File System & Storage


21.​ How do you extend a partition without unmounting
it?
22.​ What steps are needed to add a new disk to a
Linux server?
23.​ How to check which processes are writing to a
file in real time?
24.​ How to recover a deleted file in Linux?
25.​ How to check disk I/O performance in Linux?​



26.​ A directory is taking too much space. How do you


analyze it?
27.​ How do you remount a filesystem in read-write
mode without rebooting?
28.​ What happens when a file is deleted but is still
in use by a process?
29.​ How do you create and mount a swap file?
30.​ How do you find large unused files across
multiple partitions?
31.​ How do you fix a corrupted file system using
fsck?
32.​ What is inode exhaustion, and how do you resolve
it?
33.​ You need to copy a huge file across servers.
What’s the fastest way?
34.​ Your df -h and du -sh show different disk usage.
Why?
35.​ How do you find out which directory is consuming
the most in /var?
36.​ A file is not getting deleted despite rm -f. Why?
37.​ How do you enable disk quotas for users?
38.​ A RAID-5 disk has failed. How do you replace and
rebuild it?
39.​ How do you check bad sectors on a disk?
40.​ A user needs 500GB storage. How do you allocate
it using LVM?

Networking & Security


41.​ How do you check which ports are open on a
server?​


42.​ How to configure a static IP in Linux?


43.​ How to allow a port through the firewall
permanently?
44.​ A service is listening on an unintended port. How
do you investigate?
45.​ How do you capture network packets using tcpdump?
46.​ How do you check which process is using a
specific port?
47.​ How do you block an IP from accessing your
server?
48.​ SSH keeps disconnecting. How do you fix it?
49.​ How do you check and renew an expired SSL
certificate?
50.​ How do you securely transfer files between two
servers?
51.​ How do you monitor real-time network bandwidth
usage per process?
52.​ A user reports slow SSH login. How do you
troubleshoot?
53.​ How to check if your DNS resolution is working
correctly?
54.​ How do you limit network bandwidth usage for a
specific process?
55.​ How do you find the default gateway of a Linux
server?
56.​ How do you detect ARP spoofing on a Linux system?
57.​ How do you allow only specific users to SSH into
a server?
58.​ How to configure failover between two network
interfaces?
59.​ How to prevent brute-force attacks on SSH?​



60.​ How do you configure IP forwarding in Linux?

Performance & Optimization


61.​ How do you optimize Linux performance for a
high-load server?
62.​ What do the load average values mean in top?
63.​ How to find the highest CPU-consuming process?
64.​ How do you reduce swap usage on a system?
65.​ What are ulimit settings, and how do you use
them?
66.​ How do you benchmark disk read/write speeds?
67.​ How do you tune Linux for a high-performance
database?
68.​ How do you reduce the startup time of a Linux
server?
69.​ How do you monitor real-time CPU and memory
usage?
70.​ How to debug an application consuming high
memory?
71.​ How do you enable huge pages for memory
optimization?
72.​ A process is leaking memory. How do you identify
and fix it?
73.​ How do you find the I/O bottleneck on a server?
74.​ What is vm.swappiness, and how does it affect
performance?
75.​ How do you check if the CPU is throttling?
76.​ How do you disable a specific CPU core for
testing?​


77.​ How do you monitor Linux system health in


real-time?
78.​ How do you configure Linux for low-latency
workloads?
79.​ How do you limit resource usage for a specific
user or group?
80.​ How do you detect and fix a memory leak in a
running process?

Automation & Troubleshooting


81.​ How do you automate log rotation?
82.​ How do you create a systemd service for a custom
script?
83.​ How do you schedule a job to run every Sunday at
midnight?
84.​ How do you find why a system rebooted
unexpectedly?
85.​ A user's process keeps getting killed. How do you
find the reason?
86.​ How do you troubleshoot a stuck SSH session?
87.​ How do you automate patch management?
88.​ How do you take a backup of all users and groups?
89.​ How do you check why a systemd service failed?
90.​ How do you debug a frozen Linux system?
91.​ How do you use Ansible to configure Linux
servers?
92.​ How do you log all sudo commands executed by
users?
93.​ How do you recover from a lost root password?​



94.​ How do you configure an automated backup using


rsync?
95.​ How do you migrate a Linux server to a new host
with minimal downtime?
96.​ How do you enable and debug SELinux policies?
97.​ How do you safely upgrade a running Linux system?
98.​ How do you audit security logs for suspicious
activity?
99.​ How do you create a chroot jail for an
application?
100.​How do you recover a corrupted grub bootloader?

Advanced User & Process Management


101.​How do you list all users who have logged into a
system?
102.​A user is unable to change their password. How do
you troubleshoot?
103.​How do you expire a user’s password immediately?
104.​How do you lock and unlock a user account?
105.​How do you check which users are using the most
disk space?
106.​How do you create a user with no shell access?
107.​A process gets killed due to an "OOM (Out of
Memory)" error. How do you diagnose and fix it?
108.​How do you schedule a script to run when CPU
usage goes above 80%?
109.​How do you set CPU affinity for a process?
110.​How do you find the total number of processes
running on a system?​



111.​How do you prevent a user from executing certain


commands?
112.​How do you restart a crashed process
automatically?
113.​How do you run a process in the background and
ensure it keeps running after logout?
114.​A user wants to execute a script on system
startup. How do you configure it?
115.​How do you allow a user to run only specific
commands with sudo?
116.​How do you enable core dumps for debugging a
process crash?
117.​How do you analyze a core dump file?
118.​How do you check the parent process of a given
PID?
119.​How do you create a new group and assign users to
it?
120.​How do you configure a system to automatically
remove inactive user accounts?

File & Directory Operations


121.​How do you find files that haven't been accessed
in the last 30 days?
122.​How do you remove all empty directories inside a
given directory?
123.​How do you create a compressed tarball while
excluding certain files?
124.​How do you extract only specific files from a tar
archive?​



125.​How do you split a large file into smaller parts


and merge them back?
126.​How do you create a symbolic link and a hard
link?
127.​How do you determine if a given path is a file,
directory, or symlink?
128.​How do you securely delete a file to prevent
recovery?
129.​How do you copy files from one server to another
while preserving permissions and timestamps?
130.​How do you find duplicate files in a directory?
131.​How do you count the number of lines in multiple
files?
132.​How do you merge multiple text files into a
single file?
133.​How do you replace a specific word inside
multiple files?
134.​How do you rename multiple files in bulk based on
a pattern?
135.​How do you identify and remove trailing spaces
from a text file?
136.​How do you create a read-only directory that only
the root user can modify?
137.​How do you prevent accidental deletion of
important files?
138.​How do you compare two files and highlight the
differences?
139.​How do you count the occurrence of a specific
word in a file?
140.​How do you find and replace text inside a ​





compressed file without extracting it?

Networking & Security


141.​How do you permanently change the hostname of a
Linux machine?
142.​How do you check and modify the MTU of a network
interface?
143.​How do you diagnose a network latency issue?
144.​How do you verify if a remote server is reachable
on a specific port?
145.​How do you check which network services are
running on a machine?
146.​How do you configure a Linux firewall to block
traffic from a specific country?
147.​How do you limit the number of simultaneous SSH
connections?
148.​How do you generate and install a self-signed SSL
certificate?
149.​How do you monitor incoming and outgoing network
connections?
150.​How do you restrict SSH access to only a specific
IP range?
151.​How do you troubleshoot a failing VPN connection?
152.​How do you disable IPv6 on a Linux machine?
153.​How do you check for open and listening ports on
a server?
154.​How do you set up a basic IDS (Intrusion
Detection System) on Linux?
155.​How do you set up a VPN tunnel using OpenVPN?​




156.​How do you prevent unauthorized USB device usage


on a Linux system?
157.​How do you encrypt a file using GPG?
158.​How do you securely share a file with another
user without using a password?
159.​How do you find and remove hidden backdoors on a
compromised Linux server?
160.​How do you detect unauthorized logins to a
server?

Troubleshooting & Performance Optimization


161.​How do you diagnose an unresponsive Linux system?
162.​How do you troubleshoot slow SSH login times?
163.​How do you identify memory leaks in a running
application?
164.​How do you debug a high CPU usage issue on a
production server?
165.​How do you analyze and optimize disk performance?
166.​How do you fix a corrupted MySQL database on a
Linux server?
167.​How do you monitor real-time I/O activity?
168.​How do you analyze logs efficiently for
debugging?
169.​How do you find the most resource-hungry user on
a system?
170.​How do you optimize a Linux server for
low-latency networking?
171.​How do you configure a system for maximum power
efficiency?​


172.​How do you enable automatic system updates?


173.​How do you check the health of a hard disk?
174.​How do you limit the CPU usage of a specific
process?
175.​How do you analyze a system crash dump?
176.​How do you identify and kill runaway processes?
177.​How do you troubleshoot a system where commands
are executing very slowly?
178.​How do you configure Linux for high-performance
computing workloads?
179.​How do you reduce the boot time of a Linux
system?
180.​How do you analyze a server freeze that happened
in the past?

Automation, Monitoring & Cloud


181.​How do you automate log file cleanup using a
script?
182.​How do you configure a Linux system to send email
alerts on high CPU usage?
183.​How do you use Ansible to deploy software across
multiple servers?
184.​How do you create a cron job that runs only on
weekdays?
185.​How do you use rsync to create an incremental
backup?
186.​How do you set up log forwarding to a centralized
log server?
187.​How do you configure a Linux system to
auto-reboot on kernel panic?​


188.​How do you monitor the uptime of a Linux system?


189.​How do you configure automatic disk cleanup for
temporary files?
190.​How do you use Prometheus and Grafana to monitor
system performance?
191.​How do you configure system alerts for failed
services?
192.​How do you troubleshoot a slow web application
running on Linux?
193.​How do you monitor system logs in real time?
194.​How do you create a cloud-init script for
provisioning cloud instances?
195.​How do you automate user creation across multiple
Linux servers?
196.​How do you configure auto-scaling for a
Linux-based cloud environment?
197.​How do you manage multiple servers using
SaltStack or Chef?
198.​How do you set up a private container registry on
a Linux server?
199.​How do you configure Kubernetes nodes to optimize
Linux networking?
200.​How do you create a high-availability cluster on
Linux?

You might also like