Three real slices of Module 1: the revision notes, the explained Q&A, and the rapid-fire mock. Tap an option on any question — every lesson works like this.
A DevOps interview is mostly you talking — "the disk is full, what do you do", "walk me through a rolling update". So every question in this pack is written the way it is actually asked, and every answer gives you the words to say, the follow-up that comes next, and the thing that loses candidates the round. Try the two below; this is exactly how every lesson behaves.
Q1 A production server's disk is 100% full. What do you do? 📣 Reported in: TCS, Infosys, Accenture, Cognizant DevOps rounds
Say this as an ordered procedure — that's what's being scored: "First df -h to see which filesystem is full, because it's usually one mount rather than the whole disk. Then du -h --max-depth=1 and walk down into the biggest directory until I find it. Nine times out of ten it's /var/log or a runaway application log."
df -h # which filesystem?
du -h --max-depth=1 /var | sort -h # walk down to the culprit
find /var/log -type f -size +100M -exec ls -lh {} \;
The trap worth naming before they ask it: "If df says full but du doesn't add up, it's a deleted file that a process still holds open — the space isn't released until the handle closes. lsof | grep deleted finds it, and restarting that process reclaims it. That's the classic 'I deleted the log and nothing happened'."
Follow-up: "Disk isn't full but you still get 'No space left on device'?" → Inodes are exhausted. df -i. Millions of tiny session or cache files do it.
Follow-up: "How do you stop it recurring?" → logrotate with compression and a retention policy, plus a disk alert at 80% so you hear about it before it's 100%.
Don’t say: "Delete the logs." Say truncate — > /var/log/big.log — because deleting a file the application has open frees nothing at all.
Q2 A container starts and exits immediately. How do you debug it? 📣 Reported in: Cognizant, Wipro, Capgemini, Nagarro
Say the procedure: "docker ps -a to see it and its exit code — the code is the first clue. Then docker logs, which still works on a stopped container and usually holds the actual error. If the logs are empty, override the entrypoint and look around inside the image."
docker ps -a # exit code?
docker logs <id> # works after exit
docker run -it --entrypoint sh myimg # get a shell instead of the app
Say the exit codes — this is where the marks are: "0 — the process finished normally; there was simply nothing to keep running. 1 — application error, check the logs. 127 — command not found, usually a typo or a binary missing from a slim base image. 137 — SIGKILL, nearly always the OOM killer."
The concept behind all of them: "A container lives exactly as long as its main process. If the command is a service that daemonises itself into the background, PID 1 exits and the container stops — which is why you see nginx -g 'daemon off;'. Containers must run their process in the foreground."
Don’t say: "Add restart: always." That converts a clear failure into an endless crash loop and hides the error — it's the wrong instinct and interviewers listen for it.
The full pack has revision notes + 125 explained interview questions like these across Linux & shell, Git & CI/CD, Docker, Kubernetes, and AWS with Terraform, Ansible & monitoring, 62 mock-round questions including a predict-the-output round, 30 practical tasks — shell scripts, Dockerfiles, Compose, Kubernetes YAML, Jenkins and GitHub Actions pipelines, Terraform, and six live troubleshooting scenarios — each with the approach to say, a working solution and the follow-up that comes after, and a company-wise module covering what TCS, Infosys, Wipro, Accenture, Capgemini, Cognizant, HCL, Tech Mahindra, LTIMindtree, Persistent, Nagarro, Amazon, Flipkart, Razorpay and startups actually ask — with every answer written out. No multiple choice anywhere, because no interviewer gives you options.
Every module gives you two study lessons: a 📖 full-notes lesson that teaches the topic in depth, and a ⚡ cheat sheet like this one for quick revision before the Q&A. Here are the first 3 sections of the Linux & shell cheat sheet from Module 1 (Linux & shell).
⚡ Cheat sheet · quick revision before the Q&AEvery DevOps interview starts with Linux: "how do you check disk space", "what is 755", "kill a process on port 8080", "find errors in a log", "write a script that…". These notes cover the commands you must type without thinking, the concepts behind them, and the shell-script patterns interviewers watch for.
| Directory | What lives there |
|---|---|
/etc | configuration (nginx, ssh, passwd, hosts, fstab) |
/var | variable data — /var/log logs, /var/lib app data (docker, mysql) |
/home, /root | user home dirs; root's home |
/bin, /usr/bin, /sbin | binaries; sbin = admin binaries |
/tmp | temp files (sticky bit set), cleared on reboot |
/proc, /sys | virtual kernel info (/proc/cpuinfo, /proc/meminfo) |
/opt, /mnt, /dev | optional software; mount points; devices |
pwd · cd - (previous dir) · ls -lah (long, all, human sizes) · ls -lt (newest first)
mkdir -p a/b/c · cp -r src dst · mv old new · rm -rf dir · ln -s target link (symlink)
find / -name "*.log" -size +100M -mtime -7 # by name, size, modified in last 7 days
find . -type f -name "*.tmp" -delete · which nginx · whereis java
cat f · less f (q to quit, / search) · head -n 20 f · tail -n 100 f · tail -f app.log (follow live)
grep -i "error" app.log · grep -rn "TODO" src/ · grep -c error app.log · grep -v debug (invert)
wc -l f (lines) · diff a b · file x (type) · stat f (metadata) · du -sh dir · df -h
nano / vim f — vim: i insert, Esc, :wq save-quit, :q! quit without saving, /text search, dd delete line
Interviewers love "find the 10 most frequent IPs in an nginx log": awk '{print $1}' access.log | sort | uniq -c | sort -rn | head -10. Memorise the pipeline; it shows you can chain tools.
-rwxr-xr-- 1 deploy devops 4096 Aug 22 10:00 run.sh
│└┬┘└┬┘└┬┘ owner group
│ │ │ └ others: r-- = 4
│ │ └ group: r-x = 5
│ └ owner: rwx = 7 → 754
└ type: - file, d dir, l symlink
chmod 754 run.sh · chmod u+x run.sh · chmod -R g-w dir · chown deploy:devops run.sh · chgrp devops f
umask 022 → new files 644, dirs 755 (666/777 minus mask)
r = list names, w = create/delete entries, x = enter / access files inside./usr/bin/passwd), setgid (2xxx, files inherit dir's group), sticky (1xxx, only owner can delete own files — /tmp shows drwxrwxrwt).chmod 777 in an answer = red flag. Say "least privilege: 750/640 and the right owner".🔒 7 more sections in the full notes:
+ 2 quick-check interview questions at the end of every study lesson, a ⚡ cheat sheet like this in every module — and a 📖 full-notes lesson that teaches the whole topic in depth before you revise.
After the notes and cheat sheet comes the Q&A lesson — 25 questions asked the way an interviewer asks them, each with a model answer, the follow-up probe and what not to say. Answer aloud first, then open the answer. Here are the first 5 from Module 1.
Q1 What does chmod 644 file do? Explain how you'd read any permission string. 🏢 TCS, Infosys
Say this: It gives the owner read and write, and the group and everyone else read only. The three digits are owner, group, others, and each is the sum of read 4, write 2, execute 1. So 6 is 4+2 = read-write, and 4 is read only — that's -rw-r--r--.
The numbers worth having ready: 755 for a script or directory — owner full, everyone else read and execute. 644 for a normal file. 600 for a private key; SSH refuses to use one that's more open than that. 777 essentially never.
Follow-up: "What does execute mean on a directory?" → Permission to enter it and access things inside by name. A directory with read but no execute lets you list the names and nothing else — which is why 644 on a directory looks fine and breaks everything.
Follow-up: "Symbolic form?" → chmod u+x script.sh adds execute for the owner; chmod -R g+w dir recurses. I prefer symbolic when I'm changing one bit and octal when I'm setting the whole thing.
Don’t say: "I'd just chmod 777 to get it working." Interviewers hear that as a security habit, and it comes up again in the AWS section.
Q2 Hard link or soft link — what's the difference, and when does each break? 🏢 Wipro, Capgemini
Say this: A hard link is a second name pointing at the same inode — the same actual file. Delete the original name and the data survives, because the inode's link count is still above zero. A soft link is a small file containing a path; delete the target and the link is left dangling, pointing at nothing.
The practical difference: hard links can't cross filesystems and can't point at directories, because they're inode references and inode numbers are only unique within a filesystem. Soft links can do both, which is why almost everything in practice — /usr/bin/python3, a current symlink in a deploy directory — is a soft link.
Follow-up: "Where do you use a symlink in DevOps?" → Deployments. Releases go into /app/releases/2026-08-23/ and /app/current is a symlink you repoint. Switching versions is atomic and rolling back is one command.
Follow-up: "How do you tell them apart?" → ls -l shows l and an arrow for a symlink; ls -i shows two names sharing one inode number for a hard link.
Don’t say: "A hard link is a copy." A copy has its own inode and its own data; a hard link shares both, so editing through one name changes what you see through the other.
Q3 A production server's disk is 100% full. What do you do? 🏢 Accenture, Cognizant — scenario
Say this as an ordered procedure — that's what's being scored: "First, df -h to see which filesystem is actually full, because it's usually one mount, not the whole disk. Then du -sh /* 2>/dev/null | sort -h and walk down into the biggest directory until I find it. Nine times out of ten it's /var/log or a runaway application log."
df -h # which filesystem?
du -h --max-depth=1 /var | sort -h # walk down to the culprit
find /var/log -type f -size +100M -exec ls -lh {} \;
The trap worth naming, unprompted: "If df says full but du doesn't add up, it's usually a deleted file still held open by a process — the space isn't released until the file handle closes. lsof | grep deleted finds it, and restarting that process reclaims the space. That's the classic 'I deleted the log and nothing happened'."
Follow-up: "Disk isn't full but you still get 'No space left on device'?" → Inodes are exhausted. df -i. Millions of tiny session or cache files do this.
Follow-up: "How do you stop it recurring?" → logrotate with compression and a retention policy, plus a disk-usage alert at 80% so you hear about it before it's 100%.
Don’t say: "Delete the logs." Say truncate — > /var/log/big.log — because deleting a file an application has open frees nothing.
Q4 What is a zombie process, and how do you get rid of one? 🏢 TCS, HCL
Say this: A zombie is a process that has finished but whose parent hasn't read its exit status yet, so the kernel keeps its entry in the process table. It shows as Z or <defunct> in ps. It uses no CPU and no memory — just a slot in the table.
The key point: you can't kill a zombie, it's already dead. You fix the parent — it's the parent's failure to call wait() that leaves it there. Kill or restart the parent, and the zombies get re-parented to init/systemd, which reaps them immediately.
Follow-up: "When does it actually matter?" → Only when a buggy parent leaks thousands of them and fills the process table, at which point nothing new can fork. A handful of zombies is harmless.
Follow-up: "What's an orphan then?" → The opposite — the parent died first, so the child is adopted by init. Orphans are normal; that's how daemons are created.
Follow-up: "Why does this come up with Docker?" → A process running as PID 1 in a container doesn't reap children by default, so containers accumulate zombies. That's what docker run --init and tini solve.
Don’t say: "kill -9 the zombie." It has no effect, and saying it confidently is the tell.
Q5 Count how many times "ERROR" appears across all .log files in a directory tree. 🏢 Infosys, Wipro — command round
Say this: grep -rc gives a count per file; to get one total number I want -o so every occurrence is printed on its own line, then wc -l.
# total occurrences across all .log files
grep -roh "ERROR" --include="*.log" /var/log | wc -l
# count per file, useful for finding the noisy one
grep -rc "ERROR" --include="*.log" /var/log | grep -v ":0$"
# how many lines contain it (not the same number!)
grep -rh "ERROR" --include="*.log" /var/log | wc -l
The distinction to state — it's the actual mark: "Occurrences and matching lines are different numbers if a line contains ERROR twice. -o counts occurrences; without it you're counting lines."
Follow-up: "Case-insensitive, and errors from the last hour only?" → Add -i, and filter by timestamp with awk, or use journalctl --since "1 hour ago" | grep -i error if it's a systemd service.
Follow-up: "What are the flags?" → -r recursive, -c count, -o only matching parts, -h suppress filenames, -i ignore case, -v invert, -E extended regex.
Don’t say: grep -c "ERROR" *.log — that misses subdirectories and prints a per-file breakdown rather than the total they asked for.
🔒 20 more explained questions in this lesson — and a 25-question Q&A lesson like this in every tech module, plus the company-wise module with every answer written out.
Every module ends with a mock interview — answer each aloud in 30–60 seconds, then check the key points. First 3 of the 12-question Module 1 mock:
Q1 What is rwxr-x--- in octal, and who can do what?
Good answer hits: 750. Owner has read, write, execute (7); group has read and execute (5); others have nothing (0). Read is 4, write 2, execute 1.
One-liner: "750 — owner full, group read and execute, others nothing."
Follow-up they add: "And 644?" → rw-r--r--, the normal file default. 600 for a private key, 755 for a script or directory.
Q2 How do you watch a log file live as it's written?
Good answer hits: tail -f /var/log/app.log. Better: tail -F, capital F, which keeps following after a logrotate replaces the file — plain -f silently follows the old, now-deleted inode and shows nothing.
One-liner: "tail -f, or -F to survive log rotation."
Follow-up they add: "Filter while following?" → tail -f app.log | grep -i error. For a systemd service, journalctl -u app -f.
Q3 Which command shows free disk space, and which shows what's using it?
Good answer hits: df -h for free space per filesystem — the "how full am I" view. du -sh * for what's consuming it — the "why" view. free -h is memory, not disk.
One-liner: "df for free space, du for usage. Different questions."
Follow-up they add: "df says full, du doesn't add up." → A deleted file still held open by a process. lsof | grep deleted, then restart that process.
🔒 9 more mock questions in this lesson, and a mock at the end of every module.
Full course
7 modules · 31 lessons · lifetime access
Every module: notes → 25 explained Q&A → mock. Plus the practical round and the company-wise module (TCS, Infosys, Wipro, Accenture…). 7-day money-back guarantee.