Linux and Git Interview Questions for DevOps, Explained Simply
Crack the Linux and Git round of DevOps interviews
Learn the commands, permissions and Git workflows that interviewers check first, explained with everyday examples.
Almost every DevOps, cloud or SRE interview starts with Linux and Git. Most cloud servers run Linux, and nearly every team keeps its code and configuration in Git. If you freeze on a simple command, the interviewer starts to doubt the harder topics too.
In this lab you will learn the core Linux commands, how file permissions work, how to find and stop a process, and the real difference between merge and rebase. You will also build a clear answer to the classic “the server is down” question.
The big idea: Look, Find, Fix
A strong answer to any “something is wrong on the server” question follows three steps.
Spot the difference
Question: “A website on your Linux server is down. What would you do?” Switch between the two answers and watch what changes.
Quick concept check: Linux and Git
Tap each card to flip it.
Key concepts, explained simply
Six ideas that come up in almost every Linux and Git screening round.
# which folder is filling the disk?
df -h
du -sh /var/log/* | sort -h
# follow new errors in a log file
tail -f /var/log/nginx/error.log | grep -i error
# start a branch and update it with the latest main
git switch -c fix-login
git fetch origin
git rebase origin/main
Build your troubleshooting answer
Fill the blanks. Your answer writes itself on the right.
Three sample answers you can adapt
Short, correct answers to three questions asked in almost every DevOps screening.
“First, I check who owns the file and what rights it has with ls -l. If my user only needs to run a script, I add execute rights with chmod u+x, not 777. If the owner is wrong, I fix it with chown. I use sudo only when the task really needs admin rights.”
“Both bring changes from one branch into another. Merge keeps the full history and adds a merge commit, so it is safe for shared branches. Rebase replays my commits on top of the latest main, which gives a clean, straight history. I rebase my own feature branch before a pull request, but I never rebase a branch other people are using.”
“If the bad commit is already pushed and shared, I use git revert. It creates a new commit that undoes the change without rewriting history. If the commit is only on my laptop and not pushed, I can use git reset to go back. On shared branches, revert is the safe choice.”
Four mistakes that fail DevOps candidates
Test yourself
Question 1 of 5
Rehearse before the real thing
Press start and answer out loud: “A website on your Linux server is down. What do you do?” Aim for 60 to 90 seconds. The ring turns amber at 60 seconds and red at 90.
- 1Check: df -h, free -h, top
- 2Logs: tail -f + grep
- 3chmod 755, never 777
- ★Shared branch? revert, not reset
Screenshot it. Save it. Share it.
Keep this card on your phone and look at it five minutes before your interview.
Quick answers
Do I need to learn every Linux command?
No. Learn the 25 to 30 everyday commands really well: files, permissions, processes, disk, network and logs. Interviewers care more that you know when and why to use them.
Which Linux distribution should I practise on?
Ubuntu is a good start because it is widely used and well documented. Many companies also run Red Hat-based systems, which install packages with dnf or yum instead of apt.
Is Git the same as GitHub?
No. Git is the version control tool that runs on your computer. GitHub, GitLab and Bitbucket are websites that host Git repositories and add pull requests, code reviews and CI/CD.
What is a merge conflict and how do I fix it?
It happens when two branches change the same lines. Git marks those lines in the file. You pick the correct version, remove the markers, then run git add and commit, or continue the rebase.

One Comment