Interview_prep
Chapter 100: Interview Preparation and Questions - Deep Dive
Section titled “Chapter 100: Interview Preparation and Questions - Deep Dive”Comprehensive Interview Guide for DevOps, SRE, and SysAdmin Roles
Section titled “Comprehensive Interview Guide for DevOps, SRE, and SysAdmin Roles”100.1 Linux Fundamentals Questions
Section titled “100.1 Linux Fundamentals Questions”Basic Concepts
Section titled “Basic Concepts” Common Interview Questions+------------------------------------------------------------------+| || Q1: Explain the Linux boot process || +----------------------------------------------------------+ || | 1. BIOS/UEFI POST | || | 2. Boot loader (GRUB2) loads kernel | || | 3. Kernel initializes (systemd, init) | || | 4. Runlevel/target determined | || | 5. Systemd starts services | || | 6. User login available | || +----------------------------------------------------------+ || || Q2: What is the difference between process and thread? || +----------------------------------------------------------+ || | Process: | || | - Independent execution environment | || | - Has own memory, file descriptors | || | - Communication via IPC | || | | || | Thread: | || | - Lightweight within process | || | - Shares memory, files with other threads | || | - Faster to create and context switch | || +----------------------------------------------------------+ || || Q3: Explain Linux file permissions (rwx, chmod, chown) || +----------------------------------------------------------+ || | rwx = Read(4) + Write(2) + Execute(1) | || | Owner | Group | Others | || | chmod 755 = rwxr-xr-x | || | chown user:group file | || | sticky bit, SUID, SGID | || +----------------------------------------------------------+ || || Q4: What happens when you type 'ls'? || +----------------------------------------------------------+ || | 1. Shell parses command | || | 2. Looks up in PATH | || | 3. Forks process | || | 4. exec() system call | || | 5. ls reads directory via syscalls | || | 6. Output to stdout | || +----------------------------------------------------------+ || |+------------------------------------------------------------------+Detailed Answers
Section titled “Detailed Answers”# =============================================================================# LINUX BOOT PROCESS - DETAILED# =============================================================================
# 1. BIOS/UEFI POST# - Power-on self test# - Initialize hardware# - Look for boot device
# 2. Boot Loader (GRUB2)# - Loads from MBR/EFI# - Presents menu# - Loads kernel + initramfs
# 3. Kernel Initialization# - Decompresses# - Initializes memory, CPU# - Mounts root filesystem (initramfs)
# 4. Initial RAM Disk (initramfs)# - Loads required drivers# - Prepares for real root# - Switches to real root
# 5. Systemd/Init# - First process (PID 1)# - Reads /etc/systemd/system.target# - Starts services in parallel
# 6. Multi-user Target# - Starts all required services# - Starts getty for login# - System ready
# =============================================================================# SYSTEMD VS SYSVINIT# =============================================================================
# SysVinit:# - Sequential service startup# - Runlevels (0-6)# - Scripts in /etc/rc.d/# - Simple but slow
# Systemd:# - Parallel startup# - Targets instead of runlevels# - Units (.service, .socket, .timer)# - Dependencies managed automatically# - Faster boot time100.2 Networking Questions
Section titled “100.2 Networking Questions”Network Fundamentals
Section titled “Network Fundamentals”# =============================================================================# TCP VS UDP# =============================================================================
# TCP:# - Connection-oriented# - Reliable (ACKs, retransmission)# - Flow control# - Congestion control# - Example: HTTP, SSH, FTP, Email
# UDP:# - Connectionless# - Unreliable (no ACKs)# - No flow control# - Faster, lower overhead# - Example: DNS, DHCP, Video, VoIP
# =============================================================================# TCP HANDSHAKE# =============================================================================
# Three-way handshake:# 1. SYN -> (client sends SYN)# 2. <- SYN-ACK (server acknowledges)# 3. ACK -> (client confirms)# Connection established!
# =============================================================================# OSI MODEL LAYERS# =============================================================================
# 7. Application - HTTP, DNS, SMTP# 6. Presentation - SSL/TLS, JPEG, GIF# 5. Session - RPC, NetBIOS# 4. Transport - TCP, UDP# 3. Network - IP, ICMP, Router# 2. Data Link - Ethernet, MAC, Switch# 1. Physical - Cables, Hub100.3 System Administration Questions
Section titled “100.3 System Administration Questions”Key Topics
Section titled “Key Topics”# =============================================================================# MONITORING LINUX SERVER# =============================================================================
# CPU: top, htop, mpstat, sar# Memory: free -h, vmstat, /proc/meminfo# Disk: df -h, du -sh, iostat# Network: ss, netstat, iftop, nethogs# Processes: ps aux, top, htop
# =============================================================================# TROUBLESHOOTING HIGH LOAD# =============================================================================
# 1. Check load average: uptime# 2. Check CPU: top, mpstat# 3. Check memory: free -h# 4. Check I/O: iostat, iotop# 5. Find processes: ps aux --sort=-%cpu# 6. Check logs: journalctl, dmesg
# =============================================================================# SECURITY HARDENING# =============================================================================
# 1. Disable unnecessary services# 2. Configure firewall (iptables, firewalld)# 3. Enable SELinux/AppArmor# 4. SSH hardening (key-only, disable root)# 5. Regular updates# 6. Fail2ban# 7. Log monitoring# 8. Backups100.4 DevOps Questions
Section titled “100.4 DevOps Questions”CI/CD and Automation
Section titled “CI/CD and Automation”# =============================================================================# CI/CD PIPELINE STAGES# =============================================================================
# 1. Source - Code commit to VCS# 2. Build - Compile/package code# 3. Test - Unit, integration tests# 4. Security scan - SAST, DAST# 5. Staging - Deploy to test env# 6. Production - Deploy to prod
# =============================================================================# INFRASTRUCTURE AS CODE# =============================================================================
# Tools: Terraform, CloudFormation, Ansible, Puppet# Benefits:# - Version control# - Reproducible# - Automated# - Self-documenting
# =============================================================================# CONTAINER ORCHESTRATION# =============================================================================
# Docker Swarm vs Kubernetes:# - Swarm: Simple, built-in, limited# - K8s: Complex, feature-rich, industry standard
# K8s components:# - Pod: Smallest deployable unit# - Service: Network abstraction# - Deployment: Pod management# - Ingress: HTTP routing# - ConfigMap/Secret: Configuration# - Volume: Persistent storage100.5 Practical Hands-on Tasks
Section titled “100.5 Practical Hands-on Tasks”Live Exercises
Section titled “Live Exercises”# =============================================================================# TASK 1: CONFIGURE NGINX# =============================================================================
# Installsudo apt install nginx
# Start and enablesudo systemctl enable --now nginx
# Configure firewallsudo ufw allow 80/tcpsudo ufw allow 443/tcp
# SSL configurationsudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ -keyout /etc/ssl/private/nginx.key \ -out /etc/ssl/certs/nginx.crt
# =============================================================================# TASK 2: SETUP LVM# =============================================================================
# Create physical volumesudo pvcreate /dev/sdb
# Create volume groupsudo vgcreate vg_data /dev/sdb
# Create logical volumesudo lvcreate -L 100G -n lv_data vg_data
# Formatsudo mkfs.ext4 /dev/vg_data/lv_data
# Mountsudo mount /dev/vg_data/lv_data /data
# =============================================================================# TASK 3: BACKUP SCRIPT# =============================================================================
#!/bin/bash# Backup scriptDATE=$(date +%Y%m%d)BACKUP_DIR="/backup"SOURCE_DIR="/var/www"
tar czpf $BACKUP_DIR/backup-$DATE.tar.gz $SOURCE_DIR
# Keep only 7 daysfind $BACKUP_DIR -name "backup-*.tar.gz" -mtime +7 -delete
# =============================================================================# TASK 4: SETUP FIREWALL RULES# =============================================================================
# UFW rulessudo ufw default deny incomingsudo ufw default allow outgoingsudo ufw allow 22/tcp # SSHsudo ufw allow 80/tcp # HTTPsudo ufw allow 443/tcp # HTTPSsudo ufw enable100.6 Scenario-Based Questions
Section titled “100.6 Scenario-Based Questions”Real-world Problems
Section titled “Real-world Problems” Scenario Questions+------------------------------------------------------------------+| || Scenario 1: Server not responding || +----------------------------------------------------------+ || | 1. Check ping connectivity | || | 2. Check SSH port (telnet/nc) | || | 3. Check load (uptime, top) | || | 4. Check disk space (df) | || | 5. Check services (systemctl status) | || | 6. Check logs (journalctl, dmesg) | || +----------------------------------------------------------+ || || Scenario 2: Can't connect to database || +----------------------------------------------------------+ || | 1. Check service running | || | 2. Check port (ss -tlnp) | || | 3. Check firewall rules | || | 4. Check connection string | || | 5. Check max connections | || | 6. Check logs | || +----------------------------------------------------------+ || || Scenario 3: High memory usage || +----------------------------------------------------------+ || | 1. Check processes (ps aux --sort=-%mem) | || | 2. Check cache (free -h) | || | 3. Check OOM killer (dmesg) | || | 4. Identify memory leak (watch) | || | 5. Restart service or process | || | 6. Tune kernel parameters | || +----------------------------------------------------------+ || || Scenario 4: Website slow || +----------------------------------------------------------+ || | 1. Check application logs | || | 2. Check database queries (slow query log) | || | 3. Check CPU load | || | 4. Check network latency | || | 5. Check CDN/static content | || | 6. Check caching | || +----------------------------------------------------------+ || |+------------------------------------------------------------------+100.7 Certification Path
Section titled “100.7 Certification Path”Recommended Certifications
Section titled “Recommended Certifications” Certifications for SysAdmin/DevOps+------------------------------------------------------------------+| || Entry Level || +----------------------------------------------------------+ || | CompTIA IT Fundamentals (ITF+) | || | CompTIA A+ | || +----------------------------------------------------------+ || || Mid Level || +----------------------------------------------------------+ || | CompTIA Linux+ (XK0-005) | || | RHCSA (Red Hat Certified System Administrator) | || | LFCS (Linux Foundation Certified SysAdmin) | || +----------------------------------------------------------+ || || Advanced Level || +----------------------------------------------------------+ || | RHCE (Red Hat Certified Engineer) | || | AWS Certified SysOps Administrator | || | CKA (Certified Kubernetes Administrator) | || +----------------------------------------------------------+ || || Expert Level || +----------------------------------------------------------+ || | AWS Solutions Architect Professional | || | CKS (Certified Kubernetes Security) | || | AWS DevOps Engineer Professional | || +----------------------------------------------------------+ || |+------------------------------------------------------------------+100.8 Study Resources
Section titled “100.8 Study Resources”Learning Path
Section titled “Learning Path”# =============================================================================# BOOKS# =============================================================================
# Linux Basics- "How Linux Works" by Brian Ward- "Linux Basics for Hackers" by OccupyTheWeb
# System Administration- "The Linux System Administration Handbook"- "UNIX and Linux System Administration Handbook"
# DevOps- "The Phoenix Project" by Gene Kim- "Site Reliability Engineering" by Google
# =============================================================================# ONLINE RESOURCES# =============================================================================
# Documentation- archlinux.org/wiki- linux.die.net/man/- kernel.org/doc/
# Practice- overthewire.org (wargames)- hackthebox.eu- tryhackme.com
# =============================================================================# HANDS-ON PROJECTS# =============================================================================
# 1. Set up home lab with VMs# 2. Deploy Docker containers# 3. Set up monitoring (Prometheus/Grafana)# 4. Configure CI/CD pipeline# 5. Implement backup solution# 6. Set up log aggregation# 7. Configure load balancer# 8. Deploy Kubernetes clusterSummary
Section titled “Summary”In this chapter, you learned:
- ✅ Linux fundamentals interview questions
- ✅ Networking concepts (TCP/IP, OSI)
- ✅ System administration troubleshooting
- ✅ DevOps and CI/CD concepts
- ✅ Practical hands-on tasks
- ✅ Scenario-based problems
- ✅ Certification path
- ✅ Study resources
- ✅ Career guidance
Congratulations!
Section titled “Congratulations!”You have completed the comprehensive Linux System Administrator Guide!
Next Steps:
- Practice with homelab
- Get certifications
- Contribute to open source
- Stay updated with Linux news
- Build your portfolio
Key Takeaways:
- Linux is the backbone of modern infrastructure
- Understanding fundamentals is crucial
- Practice hands-on daily
- Learn automation (Ansible, Terraform)
- Master containers (Docker, Kubernetes)
- Build troubleshooting skills
Last Updated: February 2026 Author: Linux SysAdmin Documentation Team Target Audience: DevOps Engineers, SRE, System Administrators