Linux Interview Questions
9 questions for junior and senior Linux interviews, with model answers, code examples and common mistakes. Answer each one out loud first, then reveal the answer.
Bash Scripting Basics
// interview question
What is the shebang line and how do you write a basic bash script?
Answer out loud first, then check yourself against the model answer.
Environment Variables
// interview question
What are environment variables and how do you use them in Linux? How do you make them persistent?
Answer out loud first, then check yourself against the model answer.
Linux File Permissions
// interview question
Explain Linux file permissions. What does the permission 'rwxr-xr--' mean?
Answer out loud first, then check yourself against the model answer.
Using grep for Text Search
// interview question
How do you use grep to search for text patterns in files? What are some useful flags?
Answer out loud first, then check yourself against the model answer.
Linux Package Management
// interview question
How do you install and manage software packages in Linux? What's the difference between apt and yum?
Answer out loud first, then check yourself against the model answer.
Linux System Logs
// interview question
Where are system logs stored in Linux and how do you view them?
Answer out loud first, then check yourself against the model answer.
Shell Scripting Fundamentals
// interview question
What are the essential components of a shell script? Explain variables, conditionals, and loops.
Answer out loud first, then check yourself against the model answer.
SSH Basics and Key Authentication
// interview question
How does SSH key authentication work? How do you set it up?
Answer out loud first, then check yourself against the model answer.
Linux Process Debugging
// interview question
A process is consuming 100% CPU on a Linux server. Walk me through how you would identify and troubleshoot this issue.
Answer out loud first, then check yourself against the model answer.
More interview topics
Also worth your time on this topic
Fix Docker 'Cannot Connect to the Docker Daemon' and 'Permission Denied' Errors
Fix 'Cannot connect to the Docker daemon at unix:///var/run/docker.sock', permission denied on the Docker socket and on volumes, and 'denied: requested access to the resource is denied' on docker push. Learn why the docker group equals root, and how to harden a Docker host.
Linux Performance Tuning and Troubleshooting
Master essential Linux performance analysis and optimization techniques to diagnose and resolve system bottlenecks.
80 minutes
SSH Hardening Checklist
Comprehensive guide to harden your SSH server configuration and improve security.
30-45 minutes