Skip to main content
CloudCareerLabs Logo CloudCareerLabs
Linux Technical Screening Guides & Flashcard Preparation

Free Linux Interview Questions

Technical hiring standards for systems engineers demand quick problem-solving and conceptual clarity. This guide compiles the most common screening questions, complete with structural explanations and diagnostic walkthroughs. Prepare for your systems engineering interview with our curated Linux interview questions guide. We cover essential topics on process signals, inode structures, soft vs hard links, virtual memory tuning, and network socket diagnostics. By utilizing standard patterns, engineers can build robust, highly automated platforms.

SM
Written by Sachin Mehta • Founder & Principal Cloud Architect Principal cloud architect and systems automation expert.

Linux OS Kernel Primitives & Process States

Linux processes navigate multiple states in their lifecycle. Understanding these states is critical when diagnosing system freezes or service stalls.

  • D State (Uninterruptible Sleep): Typically waiting for disk or network I/O. The process cannot be interrupted by signals (even kill -9).
  • Z State (Zombie): Processes that have completed execution but their parent processes have not read their exit codes via wait() system calls. They consume no memory but occupy slots in the process table.

Visualizing Systems Debugging Command Hierarchy

Linux Diagnostics Systems Commands Hierarchy

---

Technical Q&As (OS Troubleshooting)

Q1: What is the difference between SIGTERM (15) and SIGKILL (9) signals? How does a process handle them?

Answer: The signals instruct processes to terminate, but they take different routes:

  • SIGTERM (15): The default termination signal. It is sent to the process and can be caught, handled, or ignored. This allows the application to perform cleanup tasks (closing file descriptors, flushing database connection pools, completing active requests) before exiting.
  • SIGKILL (9): A brute-force termination signal. It is not delivered to the process; instead, the Linux kernel immediately terminates the process execution. The application has no opportunity to clean up, which can result in corrupted state files or database drifts.

Q2: How do you identify which process is binding to port 8080 and preventing your application from starting?

Answer: Use the ss (socket statistics) or lsof (list open files) commands:

1. ss command:

bash

sudo ss -tlnp | grep 8080

*Explanation*: -t limits to TCP, -l to listening sockets, -n shows numeric port values, and -p prints process names and PIDs.

2. lsof command:

bash

sudo lsof -i :8080

Once you identify the PID, you can investigate it or terminate it using sudo kill .

Q3: What is "Inodes Exhaustion" and how does it cause write failures when there is still plenty of disk space?

Answer: In Linux filesystems, every file or directory is represented by an inode (index node), which stores metadata (permissions, owner, block locations). The filesystem has a fixed maximum limit of inodes.

  • The Problem: If a script generates millions of tiny temporary files (e.g. session logs or cache files), the system can run out of available inodes even if those files occupy only a few kilobytes.
  • The Symptom: Disk writes fail with No space left on device, but running df -h shows 50% free capacity.
  • The Diagnostic: Run df -i to check inode usage metrics:

bash

df -i /var

  • The Resolution: Find and delete the directory containing the millions of small files using:

bash

find /path/to/search -type f -delete

---

Systems Diagnostics Cheat Sheet

Use these standard commands during production outage escalations:

Diagnostic TargetCLI CommandWhat it measures
CPU Usagetop or htopProcess load and CPU core utilization levels.
Memory Allocationfree -mTotal, used, and cached RAM metrics.
Disk Capacitydf -hStorage usage percentage of mounted partitions.
Network Socketsss -tlnpActive TCP listening ports and processes.
Log Monitoringjournalctl -xeSystemd daemon logging events and errors.

Linux Technical Systems Engineering Interview Challenge

Interactive Troubleshooting Lab

The interviewer asks: 'How do you troubleshoot socket exhaustion when an application server reaches connection limits?'

production_manifest.sh
#!/usr/bin/env bash
# Automation script to monitor disk usage and alert if threshold exceeded
set -euo pipefail

THRESHOLD=90
LOG_FILE="/var/log/disk_monitor.log"

df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read -r output;
do
  usage=$(echo "$output" | awk '{ print $1}' | cut -d'%' -f1)
  partition=$(echo "$output" | awk '{ print $2 }')
  
  if [ "$usage" -ge "$THRESHOLD" ]; then
    echo "$(date '+%Y-%m-%d %H:%M:%S') - WARNING: Disk space on $partition is at $usage%" >> "$LOG_FILE"
  fi
done

Diagnostic & Resolution Steps

Recommended remediation commands

To resolve this system outage, follow these step-by-step diagnostic and remediation instructions: 1. Explain checking connections with `ss -s` or `ss -an | grep TIME_WAIT | wc -l`. 2. Discuss tuning kernel parameters in `/etc/sysctl.conf` to enable TCP socket reuse (`net.ipv4.tcp_tw_reuse = 1`). Here is the clean, verified configuration file or script template demonstrating how to resolve this configuration drift or deploy the service correctly:

Interview Success Benchmarks for Linux

Core competencies & reference questions

To prepare effectively for the challenges of managing Linux, review the key domains and common test questions detailed below. These represent actual operational tasks expected of DevOps engineers in modern software environments.

Core Question: Describe the startup lifecycle of a service in this environment.

Explain how components verify network connections, synchronize states with configuration registries, and signal health back to the control plane.

Verification Checked

Scenario Question: How do you troubleshoot socket exhaustion or API latency issues?

Detail debugging steps including connection state counts, routing analysis, scaling policies, and file handle limits.

Verification Checked

Architecture Question: Explain how this technology guarantees idempotency.

Provide details on declarative configurations, state management comparisons, and how the target engine updates only modified parameters.

Verification Checked

Frequently Asked Questions

Technical reference answers

Q: What is the difference between hard links and symbolic links?

A hard link is a pointer sharing the target's inode, keeping data if the source is deleted; a symlink is a path shortcut that breaks if the source is deleted.

Q: How does Linux manage process signals like SIGTERM and SIGKILL?

SIGTERM (15) politely requests a process to terminate gracefully; SIGKILL (9) forces immediate termination without cleanup.

Q: How do you diagnose high memory usage on a Linux server?

Use `free -m` to inspect allocations, `top` or `htop` to identify memory-hungry processes, and check `/var/log/messages` for OOMKilled events.

Ready to test your skills in real-time?

Take the next step in your cloud career. Access our interactive simulators, test your command-line capabilities on live terminals, run script execution pipelines, and verify your configuration files instantly.

Practice Flashcards for Linux  →