Sunday, May 3, 2026

Linux Interview Que.

1. What is Linux?

Answer:
Linux is an open-source, Unix-like operating system based on the Linux kernel. It manages hardware resources and provides services for applications.

🔹 2. Explain Linux boot process

Answer:

BIOS/UEFI initializes hardware
Bootloader (GRUB) loads kernel
Kernel initializes system
init / systemd starts services
System reaches target (multi-user/graphical)

🔹 3. What is the difference between hard link and soft link?

Answer:

Hard link: Points to same inode, survives file deletion
Soft link (symlink): Points to file path, breaks if original file is deleted

🔹 4. What is a process?

Answer:
A process is a running instance of a program with its own memory space and PID.

🔹 5. How do you check CPU and memory usage?

Answer:

CPU: top, htop, mpstat
Memory: free -m, vmstat

🔹 6. Difference between df and du?

Answer:

df: Shows filesystem disk usage
du: Shows directory/file usage

🔹 7. What is swap memory?

Answer:
Swap is disk space used as virtual memory when RAM is full.

🔹 8. What is /etc/fstab?

Answer:
A configuration file that defines filesystems to mount at boot time.

🔹 9. How do you find large files?

Answer:

find / -type f -size +500M
🔹 10. What is SSH?

Answer:
SSH (Secure Shell) is a secure protocol for remote login and command execution.

🔹 11. How do you secure SSH?

Answer:

Disable root login
Use key-based authentication
Change default port
Use firewall rules
🔹 12. What is cron?

Answer:
Cron is a job scheduler to run tasks automatically at scheduled times.

🔹 13. What is LVM?

Answer:
LVM (Logical Volume Manager) allows flexible disk management, resizing partitions without downtime.

🔹 14. What is RAID?

Answer:
RAID is data storage virtualization combining multiple disks for redundancy/performance.

RAID 0 → performance
RAID 1 → mirroring
RAID 5 → parity
🔹 15. How do you check open ports?

Answer:

ss -tuln
🔹 16. How do you check running processes?

Answer:

ps -ef
top
🔹 17. Server is slow — how do you troubleshoot?

Answer (structured approach):

Check CPU → top
Check memory → free -m
Check disk → df -h, iostat
Check logs → /var/log/messages
Check network → ss, netstat
🔹 18. Disk is full — what will you do?

Answer:

Check usage → df -h
Find large files → du -sh *
Clean logs → /var/log
Remove temp files → /tmp
Extend disk (LVM if available)
🔹 19. High CPU usage — how to identify?

Answer:

top
ps -eo pid,ppid,cmd,%cpu --sort=-%cpu
🔹 20. What is load average?

Answer:
Load average shows number of processes waiting for CPU.

Compare with CPU cores
Load > cores → system overloaded
🔹 21. Difference between process and thread?

Answer:

Process: Independent, own memory
Thread: Lightweight, shares memory
🔹 22. What are file permissions?

Answer:
Permissions control access:

Read (r), Write (w), Execute (x)
Owner, Group, Others
Example:
chmod 755 file
🔹 23. What is a zombie process?

Answer:
A zombie process is a completed process whose entry still exists in process table.

🔹 24. How do you monitor logs in real time?

Answer:

tail -f /var/log/syslog
🔹 25. What is systemd?

Answer:
Systemd is the init system and service manager in modern Linux.

No comments:

Post a Comment