Skip to content

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”

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 | |
| +----------------------------------------------------------+ |
| |
+------------------------------------------------------------------+
Terminal window
# =============================================================================
# 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 time

Terminal window
# =============================================================================
# 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, Hub

Terminal window
# =============================================================================
# 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. Backups

Terminal window
# =============================================================================
# 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 storage

Terminal window
# =============================================================================
# TASK 1: CONFIGURE NGINX
# =============================================================================
# Install
sudo apt install nginx
# Start and enable
sudo systemctl enable --now nginx
# Configure firewall
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# SSL configuration
sudo 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 volume
sudo pvcreate /dev/sdb
# Create volume group
sudo vgcreate vg_data /dev/sdb
# Create logical volume
sudo lvcreate -L 100G -n lv_data vg_data
# Format
sudo mkfs.ext4 /dev/vg_data/lv_data
# Mount
sudo mount /dev/vg_data/lv_data /data
# =============================================================================
# TASK 3: BACKUP SCRIPT
# =============================================================================
#!/bin/bash
# Backup script
DATE=$(date +%Y%m%d)
BACKUP_DIR="/backup"
SOURCE_DIR="/var/www"
tar czpf $BACKUP_DIR/backup-$DATE.tar.gz $SOURCE_DIR
# Keep only 7 days
find $BACKUP_DIR -name "backup-*.tar.gz" -mtime +7 -delete
# =============================================================================
# TASK 4: SETUP FIREWALL RULES
# =============================================================================
# UFW rules
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp # SSH
sudo ufw allow 80/tcp # HTTP
sudo ufw allow 443/tcp # HTTPS
sudo ufw enable

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 | |
| +----------------------------------------------------------+ |
| |
+------------------------------------------------------------------+

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 | |
| +----------------------------------------------------------+ |
| |
+------------------------------------------------------------------+

Terminal window
# =============================================================================
# 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 cluster

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

You have completed the comprehensive Linux System Administrator Guide!

Next Steps:

  1. Practice with homelab
  2. Get certifications
  3. Contribute to open source
  4. Stay updated with Linux news
  5. 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