Linux and Git Interview Questions for DevOps, Explained Simply

LAB 17 The Interview Lab · DevOps & Cloud

Crack the Linux and Git round of DevOps interviews

Learn the commands, permissions and Git workflows that interviewers check first, explained with everyday examples.

⏱ 10 min🎯 Freshers & experienced🧪 4 hands-on drills
Your lab progress0 of 4 drills done
Spot itDecodeBuildTest

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.

Step 1
FRAME 1
Look
Check the state first: disk with df -h, memory with free -h, and CPU load with top.
Step 2
FRAME 2
Find
Find the cause: read the logs with tail or journalctl, search them with grep, and check processes with ps.
Step 3
FRAME 3
Fix
Fix it safely, one change at a time, confirm it works, and note the root cause.
Never guess on a server. Look, find the cause, then change one thing at a time.
Drill 1 · Spot it

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.

I would restart the server first, because that fixes most problems. If it still does not work, I would reinstall the application. I would also give 777 permission to the folder so that nothing is blocked. Then I would tell my manager that the server was down and now it is working. Linux problems are mostly random anyway.
✕ Restarts before finding the cause
✕ chmod 777 is a serious security risk
✕ No logs, no checks, no learning
Drill 2 · Decode

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.

The Linux file systemThink of it as one family tree that starts at / (root). /home holds user folders, /etc holds configuration, /var/log holds logs and /tmp holds temporary files. In Linux, even devices are treated like files.
Everyday commandspwd shows where you are, ls -l lists files with details, and cd changes folder. cp copies, mv moves or renames, rm deletes and mkdir makes a folder. cat and less show what is inside a file.
Permissions and ownersEvery file has an owner, a group and others, each with read, write and execute rights. chmod changes the rights and chown changes the owner. sudo runs a command as the admin (root) user, so use it carefully.
ProcessesA process is a running program, like an app open on your phone. ps aux lists processes, top shows live CPU and memory use, and kill PID asks a process to stop. kill -9 forces it, so keep it as the last option.
Git basicsGit is like save points in a video game, but for code. git add stages your changes, git commit saves a snapshot, git push sends it to the remote, and git log shows the history.
Branches and pull requestsA branch is a safe copy of the project where you work without breaking main. Create one with git switch -c feature-login (or git checkout -b). When done, open a pull request so a teammate reviews it before it is merged.
# 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
💡 Practise on a free Linux setup, such as WSL on Windows, a virtual machine or a free cloud shell. Typing the commands yourself is the fastest way to remember them.
Drill 3 · Build

Build your troubleshooting answer

Fill the blanks. Your answer writes itself on the right.

Your answer
Start typing on the left and your answer will appear here.
⏱ ~0 seconds spoken0 words

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.”

Four mistakes that fail DevOps candidates

Using chmod 777 to fix everythingIt gives everyone full rights and is a security risk. Give only the permission that is actually needed.
Jumping to kill -9 or a rebootFind the cause first with logs and ps. Force-stopping can lose data and hides the real problem.
Rebasing a shared branchIt rewrites history that teammates depend on. Rebase only your own branch, and use revert on shared ones.
Only memorising commandsInterviewers ask why and when. Explain what a command does and when you would use it, with a real example.
Drill 4 · Test

Test yourself

Question 1 of 5

0:00

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.

Interview Lab · 17
Linux + Git cheat card
  1. 1Check: df -h, free -h, top
  2. 2Logs: tail -f + grep
  3. 3chmod 755, never 777
  4. ★Shared branch? revert, not reset
worldremotejobs.com@keshav_consults

Screenshot it. Save it. Share it.

Keep this card on your phone and look at it five minutes before your interview.

Share on WhatsApp
Next in the lab
Lab 18 · Why do you want to join our company?
Open lab →

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

Leave a Reply

Your email address will not be published. Required fields are marked *