Rapid-Fire Round
Short, crisp questions across every DevOps tool: the round where interviewers fire 20 questions in 10 minutes
Linux and shell
🎥 Learn this hands-on with DevOps Shack → YouTube @devopsshack · Hindi @shackverse · Courses at devopsshack.com
Q1 What does exit code 0 mean, and how do you see the last command's exit code?
Beginner
0 means success. Anything from 1 to 255 means failure, and the meaning depends on the program.
echo $? Q2 Hard link vs soft link?
Beginner
A hard link is another name for the same inode. It survives deletion of the original but can't cross filesystems or point to directories. A symlink is a separate file holding a path, and it breaks if the target is removed.
ln file hard; ln -s /path/file soft Q3 What do the permissions 755 and 640 mean?
Beginner
755 and 640 mean?755 = owner rwx, group r-x, others r-x. 640 = owner rw-, group r--, others nothing. Each digit is read (4) + write (2) + execute (1).
Q4 How do you find which process is using the most CPU right now?
Beginner
Run top (press P to sort by CPU) or htop, or use a one-shot command.
ps -eo pid,comm,%cpu --sort=-%cpu | head -5 Q5 What is a zombie process?
Intermediate
A process that has exited but whose parent hasn't called wait() to read its exit status. It uses no CPU or memory, only a PID table entry. You fix it by fixing or killing the parent, not the zombie.
ps -eo pid,ppid,stat,cmd | awk '$3 ~ /Z/' Q6 SIGTERM vs SIGKILL?
Beginner
SIGTERM (15) asks the process to exit and can be caught for graceful shutdown. SIGKILL (9) is handled by the kernel, can't be caught, and ends the process immediately with no cleanup.
Q7 What does load average: 4.00 2.00 1.00 tell you?
Intermediate
load average: 4.00 2.00 1.00 tell you?The average number of runnable plus uninterruptible (D state) tasks over 1, 5 and 15 minutes. Load is rising. Whether 4 is high depends on core count (nproc): on 4 cores it means fully busy.
Q8 How do you check free memory, and why is "free" often low on a healthy server?
Intermediate
Run free -h and read the available column. Linux uses spare RAM for page cache, which it gives back on demand, so low "free" is normal.
Q9 How do you follow a systemd service's logs live?
Beginner
journalctl -u nginx -f
journalctl -u nginx --since "10 min ago" -p err Q10 What is an inode, and what happens when inodes run out?
Intermediate
An inode stores a file's metadata (owner, permissions, block pointers) but not its name. When inodes run out you can't create files even if df -h shows free space. Millions of tiny files are the usual cause.
df -i Q11 > vs >> vs 2>&1?
Intermediate
> vs >> vs 2>&1?> overwrites, >> appends, and 2>&1 sends stderr to wherever stdout currently points. Order matters: cmd > out.log 2>&1 captures both streams, while cmd 2>&1 > out.log does not.
Q12 How do you run a command that survives logout?
Beginner
For a quick job, use nohup cmd & or a tmux/screen session. For anything long-lived, make it a systemd service.
Q13 What's in /proc?
Advanced
/proc?A virtual filesystem the kernel generates live: per-process info (/proc/<pid>/status, fd/, environ) and system info (/proc/meminfo, /proc/cpuinfo, /proc/loadavg). Nothing in it is stored on disk.
Q14 How do you make a systemd service start on boot and restart on failure?
Intermediate
Set Restart=on-failure (with RestartSec=5) in [Service] and WantedBy=multi-user.target in [Install], then run:
sudo systemctl daemon-reload && sudo systemctl enable --now myapp Q15 What does sudo !! do?
Beginner
sudo !! do?Reruns the previous command with sudo. !! is Bash history expansion of the last command.
Q16 How do you see open files and network connections of a process?
Intermediate
lsof -p <pid>
ls -l /proc/<pid>/fd
ss -tnp | grep <pid> Q17 What is the OOM killer?
Intermediate
The kernel mechanism that kills a process when memory is exhausted. It picks the victim by oom_score (memory use adjusted by oom_score_adj). Kills show up in dmesg -T | grep -i oom or journalctl -k.
Q18 What does chmod u+s (setuid) do, and why is it risky?
Advanced
chmod u+s (setuid) do, and why is it risky?The executable runs with the file owner's privileges (root for /usr/bin/passwd). A bug in a setuid-root binary is a privilege escalation path, so audit them regularly.
find / -perm -4000 -type f 2>/dev/null Q19 What are /etc/passwd and /etc/shadow?
Beginner
/etc/passwd and /etc/shadow?/etc/passwd lists users (name, UID, GID, home, shell) and is world-readable. /etc/shadow holds password hashes and ageing, readable by root only.
Q20 How do you schedule a script every day at 2:30 AM with cron?
Beginner
Add this with crontab -e. Fields are minute, hour, day of month, month, day of week:
30 2 * * * /opt/scripts/backup.sh >> /var/log/backup.log 2>&1 Q21 What does set -x do?
Beginner
set -x do?It prints each command, after expansion, before running it. It's the quickest way to debug a Bash script. Turn it off with set +x.
Q22 What is a file descriptor, and what are 0, 1 and 2?
Intermediate
An integer handle to an open file, socket or pipe. 0 is stdin, 1 is stdout, 2 is stderr. Per-process limits are shown by ulimit -n, and "Too many open files" means that limit was hit.
Q23 What is the difference between a process and a thread?
Intermediate
A process has its own memory space. Threads inside a process share memory and file descriptors. Linux schedules both as tasks; threads are created by clone() with shared address space.
Q24 What are cgroups and namespaces?
Advanced
Namespaces isolate what a process can see (PID, network, mount, UTS, IPC, user, cgroup). cgroups limit what it can use (CPU, memory, I/O, PIDs). Together they are what a container is.
Q25 How do you find which package a file belongs to?
Intermediate
dpkg -S /usr/bin/curl # Debian/Ubuntu
rpm -qf /usr/bin/curl # RHEL/Rocky/Amazon LinuxGit
🎥 Learn this hands-on with DevOps Shack → YouTube @devopsshack · Hindi @shackverse · Courses at devopsshack.com
Q26 git fetch vs git pull?
Beginner
git fetch vs git pull?fetch downloads remote commits and updates remote-tracking branches without touching your work. pull is fetch plus merge (or rebase, with --rebase) into your current branch.
Q27 Merge vs rebase in one line each?
Intermediate
Merge keeps history as it happened and adds a merge commit. Rebase replays your commits on top of the target for a linear history but rewrites commit SHAs, so never rebase shared branches.
Q28 How do you undo the last commit but keep the changes?
Beginner
git reset --soft HEAD~1 # changes stay staged
git reset HEAD~1 # changes stay, unstaged (--mixed) Q29 git reset vs git revert?
Intermediate
git reset vs git revert?reset moves the branch pointer back and rewrites history, so use it on local work only. revert adds a new commit that undoes an old one, which makes it safe on shared branches like main.
Q30 How do you recover a commit after a bad reset --hard?
Intermediate
reset --hard?The reflog keeps where HEAD has been, by default for about 90 days for reachable entries.
git reflog
git reset --hard HEAD@{2} Q31 What does git stash do?
Beginner
git stash do?It shelves uncommitted changes and cleans the working tree. Get them back with git stash pop, and use git stash -u to include untracked files.
Q32 What is git cherry-pick?
Beginner
git cherry-pick?It applies the change from a specific commit onto your current branch as a new commit. The common use is moving a hotfix from main to a release branch.
git cherry-pick <sha> Q33 How do you find which commit introduced a bug?
Intermediate
git bisect binary-searches history. git bisect run automates it with a test script.
git bisect start; git bisect bad; git bisect good v1.4.0
git bisect run ./test.sh Q34 A secret was committed and pushed. What do you do first?
Advanced
Rotate the secret first, because it is already compromised. Then purge it from history with git filter-repo and force-push, and ask GitHub support to clear cached views if needed.
Q35 What does git push --force-with-lease protect against?
Intermediate
git push --force-with-lease protect against?It refuses the force-push if the remote branch has moved since you last fetched, so you don't wipe a teammate's commits by accident.
Q36 Annotated vs lightweight tag?
Intermediate
An annotated tag is a full object with tagger, date and message, and it can be signed; use it for releases. A lightweight tag is just a named pointer to a commit.
git tag -a v1.2.0 -m "Release 1.2.0" Q37 What is a detached HEAD?
Intermediate
HEAD points straight at a commit instead of a branch, for example after git checkout <sha> or a tag. New commits there are lost unless you create a branch: git switch -c fix-branch.
Q38 What is .gitignore and why doesn't it ignore a file already tracked?
Intermediate
.gitignore and why doesn't it ignore a file already tracked?.gitignore only affects untracked files. To stop tracking a file that's already committed, remove it from the index:
git rm --cached secrets.env Q39 Squash merge: what is it, and what's the trade-off?
Advanced
It combines all PR commits into one commit on main. You get a clean history and easy reverts, but you lose the individual commits, and branches built on the PR branch need a rebase.
Q40 What does git log --oneline --graph --all show?
Beginner
git log --oneline --graph --all show?A compact ASCII graph of every branch, with one line per commit. It's the fastest way to see how branches diverged before a merge or rebase.
Networking
🎥 Learn this hands-on with DevOps Shack → YouTube @devopsshack · Hindi @shackverse · Courses at devopsshack.com
Q41 TCP vs UDP?
Beginner
TCP is connection-oriented, reliable and ordered, with a handshake and retransmits (HTTP/1.1, HTTP/2, SSH). UDP is connectionless with no delivery guarantee, but low overhead (DNS, video, QUIC/HTTP/3).
Q42 Describe the TCP three-way handshake.
Beginner
The client sends SYN, the server replies SYN-ACK, and the client sends ACK. Only then does data flow.
Q43 What happens when you type a URL in the browser, in 4 steps?
Intermediate
- A DNS lookup resolves the hostname to an IP.
- A TCP connection is opened (or QUIC for HTTP/3).
- The TLS handshake runs: certificate check and key exchange.
- The HTTP request is sent, the response comes back, and the browser renders it and fetches the page's other resources.
Q44 A record vs CNAME vs ALIAS?
Intermediate
A maps a name to an IPv4 address (AAAA for IPv6). CNAME maps a name to another name and isn't allowed at the zone apex. Route 53 ALIAS maps a name to an AWS resource and does work at the apex.
Q45 What is a /24 and how many usable hosts does it have?
Intermediate
A /24 has 256 addresses. Normally 254 are usable (network and broadcast addresses are reserved). In AWS it's 251, because AWS reserves 5 per subnet.
Q46 What is the difference between ports 80, 443, 22, 53 and 3306?
Beginner
HTTP, HTTPS, SSH, DNS (UDP and TCP) and MySQL respectively. Also worth knowing: 5432 PostgreSQL, 6379 Redis, 6443 Kubernetes API, 2379 etcd.
Q47 How do you test whether a TCP port is open from a server?
Beginner
nc -vz db.internal 5432
curl -v telnet://db.internal:5432 Q48 "Connection refused" vs "connection timed out"?
Intermediate
Refused means the host replied with a RST: it's reachable, but nothing is listening (or a firewall sent a reject). Timed out means the packets were dropped silently, which usually points to a firewall, security group or routing problem.
Q49 How do you see the route a packet takes?
Beginner
traceroute example.com
mtr -rwc 50 example.com # continuous, shows per-hop loss Q50 What is NAT, and why do private subnets need a NAT gateway?
Intermediate
NAT rewrites private source IPs to a public one. Instances without public IPs reach the internet (for patches or APIs) through a NAT gateway, while inbound connections from the internet stay impossible.
Q51 Layer 4 vs Layer 7 load balancer?
Intermediate
L4 routes on IP and port (TCP/UDP) and is fast and protocol-agnostic, like AWS NLB. L7 understands HTTP, so it can route on host, path or headers and terminate TLS, like AWS ALB or NGINX.
Q52 Forward proxy vs reverse proxy?
Intermediate
A forward proxy acts for clients reaching the internet (egress filtering, caching). A reverse proxy sits in front of servers for incoming traffic (load balancing, TLS termination, caching), like NGINX or Envoy.
Q53 How do you query a specific DNS server and see TTL?
Intermediate
dig @8.8.8.8 api.example.com +noall +answerThe second column of the answer is the remaining TTL in seconds.
Q54 What does TLS actually give you?
Intermediate
Confidentiality (encryption), integrity (tamper detection) and server authentication (a certificate chain to a trusted CA). With mTLS, the client is authenticated too.
Q55 What is MTU, and what symptom does an MTU mismatch cause?
Advanced
MTU is the largest packet a link carries (1500 bytes on Ethernet; up to 9001 jumbo inside an AWS VPC). With a mismatch, small requests work but large transfers or TLS handshakes hang, especially over VPNs and tunnels where ICMP "fragmentation needed" messages are blocked.
Q56 What is the difference between a security group and a NACL?
Advanced
A security group is stateful, attached to an ENI or instance, and has allow rules only. A NACL is stateless, applies at the subnet level, has allow and deny rules evaluated in number order, and needs return traffic (ephemeral ports) allowed explicitly.
Q57 What is SNI?
Advanced
Server Name Indication: the client sends the hostname in the TLS ClientHello so one IP can serve many certificates. Without it you get the server's default certificate.
openssl s_client -connect 1.2.3.4:443 -servername app.example.com Q58 What is anycast?
Advanced
The same IP is announced from many locations, and BGP routes each user to the nearest one. CDNs, public DNS like 1.1.1.1, and AWS Global Accelerator use it.
Docker
🎥 Learn this hands-on with DevOps Shack → YouTube @devopsshack · Hindi @shackverse · Courses at devopsshack.com
Q59 Image vs container?
Beginner
An image is a read-only, layered template. A container is a running (or stopped) instance of it, with a thin writable layer on top.
Q60 CMD vs ENTRYPOINT?
Intermediate
ENTRYPOINT is the fixed executable. CMD gives default arguments that docker run image <args> replaces. Together: ENTRYPOINT ["python","app.py"] with CMD ["--port","8000"].
Q61 COPY vs ADD?
Intermediate
Prefer COPY, which simply copies files. ADD also extracts local tar archives and can fetch URLs, and that hidden behaviour is why COPY is the default choice.
Q62 How do you see why an image is so big?
Intermediate
docker history shows the size of each layer. dive lets you explore the files in each layer interactively.
docker history --no-trunc myapp:1.0
dive myapp:1.0 Q63 What's a dangling image, and how do you clean up disk?
Beginner
A dangling image is an untagged layer left over from rebuilds.
docker image prune # dangling only
docker system prune -a --volumes # everything unused; careful
docker system df Q64 Bind mount vs named volume?
Beginner
A bind mount maps a host path into the container, which suits development. A named volume is managed by Docker under /var/lib/docker/volumes, portable, and the right choice for persistent data.
Q65 How do you get a shell in a running container?
Beginner
docker exec -it api sh # or bash, if the image has it Q66 What does EXPOSE actually do?
Intermediate
EXPOSE actually do?Nothing at the network level. It's documentation and metadata. You still need -p 8080:80 to publish, or -P to publish exposed ports to random host ports.
Q67 Why run containers as non-root?
Beginner
If the app is compromised, root in the container is much closer to root on the host (kernel bugs, mounted sockets). Add USER 10001 in the Dockerfile.
Q68 What restart policies does Docker have?
Intermediate
no (the default), on-failure[:N], always, and unless-stopped, which is like always but stays down after you stop it manually.
docker run -d --restart unless-stopped nginx Q69 What is the default Docker network driver, and why use a user-defined bridge?
Intermediate
The default driver is bridge. A user-defined bridge adds built-in DNS, so containers resolve each other by name, and better isolation.
docker network create appnet Q70 How do you limit a container's memory and CPU?
Beginner
docker run --memory 512m --cpus 1.5 myapp
docker stats Q71 Why is exit code 137 so common?
Advanced
137 = 128 + 9 (SIGKILL). It usually means the OOM killer hit the memory limit, or the process ignored SIGTERM and was force-killed after the stop timeout.
Q72 What does a multi-stage build achieve?
Intermediate
You build in a heavy stage (compilers, SDKs) and copy only the artifacts into a slim final stage, so the image is smaller and has a smaller attack surface.
Q73 What is the Docker build cache rule that breaks most builds?
Intermediate
Once a layer changes, every layer after it rebuilds. Put rarely changing steps (dependency install) before frequently changing ones (COPY . .).
Q74 containerd vs Docker?
Advanced
containerd is the container runtime daemon that manages images and container lifecycle, using runc underneath. Docker Engine is a developer-facing layer (CLI, build, networking) built on top of containerd. Kubernetes talks to containerd directly through CRI.
Q75 What does docker inspect give you? Show one useful format string.
Intermediate
docker inspect give you? Show one useful format string.The full JSON config and state of a container or image.
docker inspect -f '{{.State.Status}} {{.NetworkSettings.IPAddress}}' api Q76 How do you copy a file out of a container?
Beginner
docker cp api:/app/logs/error.log ./error.log Q77 What is distroless, and what's the catch?
Advanced
Images with only the app and its runtime: no shell and no package manager. That means fewer CVEs and less attack surface. The catch is you can't exec a shell to debug; use kubectl debug with an ephemeral container instead.
Q78 How do you pass secrets to a container at runtime safely?
Intermediate
Mount them as files (Docker or Kubernetes secrets) or fetch them from a secrets manager at start. Environment variables work but leak through docker inspect, crash dumps and child processes. Never bake secrets into the image.
Q79 What does docker compose up -d --build do?
Beginner
docker compose up -d --build do?It rebuilds images for services with a build: section, then creates or recreates changed containers in the background.
Q80 What is the OCI?
Advanced
The Open Container Initiative, which defines the image spec, runtime spec and distribution spec. Because of it, images built by Docker, Buildah or Kaniko run on any compliant runtime (containerd, CRI-O) and push to any compliant registry.
Kubernetes
🎥 Learn this hands-on with DevOps Shack → YouTube @devopsshack · Hindi @shackverse · Courses at devopsshack.com
Q81 Pod vs Deployment?
Beginner
A Pod is one or more containers sharing a network namespace and volumes, and it is mortal. A Deployment manages ReplicaSets to keep N pods running and handles rolling updates and rollbacks.
Q82 Name the control plane components.
Intermediate
kube-apiserver (front door), etcd (state store), kube-scheduler (places pods), kube-controller-manager (reconcile loops), and cloud-controller-manager (cloud integration). On every node run kubelet, kube-proxy (or an eBPF replacement) and the container runtime.
Q83 ClusterIP vs NodePort vs LoadBalancer?
Beginner
ClusterIP is a virtual IP reachable inside the cluster only. NodePort adds a port (30000–32767 by default) on every node. LoadBalancer adds a cloud load balancer in front of the NodePort or pod IPs.
Q84 Liveness vs readiness vs startup probe?
Intermediate
A failing liveness probe restarts the container. A failing readiness probe removes the pod from Service endpoints. A startup probe holds off the other two until the app has booted.
Q85 Requests vs limits?
Intermediate
Requests are what the scheduler reserves for placement. Limits are the hard cap: going over the CPU limit gets the container throttled, and going over the memory limit gets it OOMKilled.
Q86 What are the QoS classes?
Advanced
Guaranteed (requests equal limits for every container), Burstable (some requests set) and BestEffort (none set). Under memory pressure, BestEffort pods are evicted first and Guaranteed pods last.
Q87 How do you roll back a Deployment?
Beginner
kubectl rollout history deploy/api
kubectl rollout undo deploy/api --to-revision=3 Q88 ConfigMap vs Secret?
Intermediate
Both hold key-value config. Secrets are base64-encoded (not encrypted by default), can be encrypted at rest with a KMS provider, and are access-controlled separately. Never treat base64 as security.
Q89 StatefulSet vs Deployment?
Intermediate
A StatefulSet gives stable pod names (db-0, db-1), stable DNS through a headless Service, per-pod PVCs, and ordered rollout. Use it for databases and clustered stateful apps.
Q90 What is a DaemonSet used for?
Beginner
It runs one pod on every node (or on selected nodes). Typical uses are log shippers (Fluent Bit), node exporters, CNI agents and security agents.
Q91 How do you get a shell in a pod, and debug one that has no shell?
Intermediate
kubectl exec -it api-xyz -- sh
kubectl debug -it api-xyz --image=busybox:1.36 --target=api # ephemeral container Q92 Taints/tolerations vs node affinity?
Intermediate
A taint repels pods from a node, and a toleration lets a pod ignore that taint. Affinity attracts pods to nodes. To dedicate nodes to a workload you need both.
Q93 What does kubectl apply do differently from kubectl create?
Advanced
kubectl apply do differently from kubectl create?create is imperative and fails if the object exists. apply is declarative: it creates or updates by three-way merge against the last-applied config, so it can be run repeatedly.
Q94 What is a PV, a PVC and a StorageClass?
Intermediate
A PV is a piece of storage. A PVC is a pod's request for storage. A StorageClass tells the CSI driver how to provision PVs dynamically (for example gp3 EBS) when a PVC asks.
Q95 What happens when you delete a pod managed by a Deployment?
Beginner
The ReplicaSet controller sees fewer pods than desired and creates a replacement right away. To actually remove pods, scale the Deployment down.
Q96 How does a Service find its pods?
Advanced
Through its label selector. The EndpointSlice controller tracks the IPs of Ready pods that match, and kube-proxy (iptables or IPVS) or an eBPF data plane routes the ClusterIP to them.
Q97 What is etcd, and why back it up?
Advanced
etcd is the Raft-based key-value store that holds all cluster state. Lose it without a backup and you lose the cluster's objects. On managed Kubernetes (EKS, GKE) the provider runs it for you.
ETCDCTL_API=3 etcdctl snapshot save /backup/etcd.db Q98 What is an Ingress vs the Gateway API?
Advanced
Ingress is the older L7 routing API, limited and extended through annotations. Gateway API is its successor (GatewayClass, Gateway, HTTPRoute), with role separation, header and weight routing, and portable features.
Q99 What is a PodDisruptionBudget?
Intermediate
It limits how many pods of an app can be down at once from voluntary disruptions such as drains and upgrades (minAvailable or maxUnavailable). It doesn't protect against node crashes.
Q100 What is a CRD and an Operator?
Advanced
A CRD adds a new resource type to the API, like Certificate or Rollout. An Operator is a controller that reconciles those resources, encoding human operations knowledge (backups, failover) in code.
Q101 How do you see resource usage of pods and nodes?
Beginner
These need metrics-server installed.
kubectl top pods -A --sort-by=memory
kubectl top nodes Q102 What does kubectl drain do?
Intermediate
kubectl drain do?It cordons the node (no new pods) and evicts the existing pods while respecting PDBs. It's used before maintenance or an upgrade.
kubectl drain node-1 --ignore-daemonsets --delete-emptydir-data Q103 What's the difference between HPA, VPA and Cluster Autoscaler/Karpenter?
Advanced
HPA changes the pod count. VPA changes pod requests. Cluster Autoscaler or Karpenter changes the node count when pods can't be scheduled.
Q104 What is a headless Service?
Advanced
A Service with clusterIP: None. DNS returns the individual pod IPs instead of one virtual IP. StatefulSets use it to give pods stable names like db-0.db.
Q105 How do you switch namespace for your current context?
Beginner
kubectl config set-context --current --namespace=staging Q106 What does imagePullPolicy: IfNotPresent mean, and what's the default?
Advanced
imagePullPolicy: IfNotPresent mean, and what's the default?IfNotPresent pulls only if the image isn't already on the node. The default is Always when the tag is :latest or omitted, and IfNotPresent for any other tag.
Q107 What are Pod Security Standards?
Advanced
Three built-in profiles, privileged, baseline and restricted, enforced per namespace by the Pod Security Admission controller through labels. It replaced PodSecurityPolicy, which was removed in Kubernetes 1.25.
kubectl label ns prod pod-security.kubernetes.io/enforce=restricted Q108 How do you get all pods with their node and IP in one command?
Beginner
kubectl get pods -A -o wideCI/CD
🎥 Learn this hands-on with DevOps Shack → YouTube @devopsshack · Hindi @shackverse · Courses at devopsshack.com
Q109 CI vs continuous delivery vs continuous deployment?
Beginner
CI means every merge is built and tested automatically. Continuous delivery means every passing build is releasable, with a human deciding when. Continuous deployment means every passing build goes to production automatically.
Q110 What is an artifact, and why "build once, deploy many"?
Intermediate
An artifact is the built output (an image, JAR or zip). Promoting the same immutable artifact through every environment means production runs exactly what was tested. Rebuilding per environment breaks that guarantee.
Q111 What are the DORA metrics?
Intermediate
Deployment frequency, lead time for changes, change failure rate, and time to restore service. They measure delivery speed and stability together.
Q112 Blue/green vs canary vs rolling?
Intermediate
Rolling replaces instances gradually. Blue/green runs two full environments and switches all traffic at once, which gives instant rollback. Canary sends a small percentage of traffic to the new version and increases it while metrics stay healthy.
Q113 What is GitOps in one sentence?
Beginner
Git is the single source of truth for desired state, and an in-cluster agent (Argo CD or Flux) pulls and continuously reconciles the cluster to match it.
Q114 Jenkins declarative vs scripted pipeline?
Intermediate
Declarative uses the structured pipeline { stages { ... } } syntax with validation, post, when and options. Scripted is free-form Groovy (node { }). Prefer declarative and drop into script { } only when you need logic.
Q115 What does needs: do in GitHub Actions?
Beginner
needs: do in GitHub Actions?It makes a job wait for other jobs and lets it read their outputs through needs.<job>.outputs. Without needs, jobs run in parallel.
Q116 How do you keep secrets out of CI logs?
Intermediate
Use the platform's secret store (values are masked automatically), use OIDC instead of long-lived keys, never echo secrets or run set -x around them, and add ::add-mask:: for values generated at runtime.
Q117 Why pin GitHub Actions to a commit SHA?
Advanced
Tags like @v4 can be moved by the action's owner or by an attacker who compromises it. A full SHA is immutable, which protects against supply-chain attacks such as the 2025 tj-actions/changed-files compromise.
Q118 What is a merge queue?
Intermediate
It tests each PR against the latest main plus the PRs queued ahead of it before merging, so main never breaks from two PRs that pass separately but conflict together.
Q119 What is a flaky test, and how do you handle it?
Intermediate
A test that passes and fails on the same code. Quarantine it (mark it as non-blocking and track it), fix the root cause (timing, shared state, ordering), and don't hide it with blind retries.
Q120 Where should database migrations run in a pipeline?
Advanced
As a separate, single-run step before the new app version rolls out (a Kubernetes Job or Helm pre-upgrade hook), and backward compatible with the old version through expand/contract. Don't run them in every replica's startup.
Q121 What's the purpose of Argo CD's sync and self-heal?
Intermediate
Sync applies what's in Git. Self-heal reverts manual changes made in the cluster back to the Git state. With prune enabled, resources deleted from Git are deleted from the cluster.
Q122 What is shift-left security in CI?
Intermediate
Running security checks early in the PR (secret scanning, SAST, dependency/SCA scanning, IaC scanning, image scanning) so issues are fixed before merge, when they are cheapest to fix.
Terraform and Ansible
🎥 Learn this hands-on with DevOps Shack → YouTube @devopsshack · Hindi @shackverse · Courses at devopsshack.com
Q123 What is Terraform state, and why is it needed?
Intermediate
State maps resources in your code to real resource IDs and stores their attributes. Terraform uses it to plan diffs. Keep it remote, locked and encrypted, because it can contain secrets.
Q124 terraform plan vs apply vs refresh?
Intermediate
terraform plan vs apply vs refresh?plan shows the changes. apply executes them. Refresh updates state from the real world; the standalone command is deprecated, so use terraform apply -refresh-only.
Q125 What does terraform init do?
Beginner
terraform init do?It configures the backend, downloads providers (recording them in .terraform.lock.hcl) and downloads modules. Run it again after changing the backend, providers or module sources.
Q126 count vs for_each?
Intermediate
count vs for_each?count indexes resources by number, so removing a middle item shifts the others and recreates them. for_each keys resources by a map or set key, so the rest stay stable. Prefer for_each for collections.
Q127 What is drift, and how do you detect it?
Intermediate
Drift is when real infrastructure has been changed outside Terraform. Detect it with a scheduled terraform plan -detailed-exitcode, where exit code 2 means there are changes.
Q128 How do you target or replace a single resource?
Intermediate
-replace supersedes terraform taint. Use -target only in emergencies.
terraform apply -replace="aws_instance.web"
terraform plan -target="module.vpc" Q129 Variable vs local vs output?
Beginner
A variable is an input to a module. A local is a computed value used inside a module. An output exposes a value to the caller or the CLI.
Q130 Why commit .terraform.lock.hcl?
Advanced
.terraform.lock.hcl?It pins exact provider versions and their checksums, so every teammate and CI run uses the same provider builds. Upgrade on purpose with terraform init -upgrade.
Q131 What does sensitive = true do, and what doesn't it do?
Advanced
sensitive = true do, and what doesn't it do?It hides the value in plan and apply output. The value is still stored in plain text in state, so protect the state bucket with encryption and IAM. Terraform 1.10+ ephemeral values and resources can keep some secrets out of state entirely.
Q132 What's a provider alias used for?
Advanced
It configures several instances of the same provider, such as two regions or two accounts. For example, ACM certificates for CloudFront must be in us-east-1:
provider "aws" {
alias = "use1"
region = "us-east-1"
} Q133 How do you upgrade a module version safely?
Intermediate
Pin version = "~> 5.1", bump it in a PR, run terraform init -upgrade and plan, read the changelog for breaking changes, and roll out environment by environment.
Q134 What is Terragrunt for?
Advanced
It's a thin wrapper that keeps backend and provider configuration DRY across many environments and accounts, handles dependencies between stacks, and runs commands across many stacks (terragrunt run-all plan).
Q135 Is Ansible agent-based? What does it need on the target?
Beginner
No, it's agentless. It needs SSH access (WinRM for Windows) and Python on the target for most modules.
Q136 What does idempotent mean in Ansible?
Beginner
Running the playbook again produces the same end state and reports changed=0 when nothing needed to change. Modules check current state before acting.
Q137 Ansible command vs shell module?
Intermediate
command vs shell module?command runs without a shell, so pipes, redirects and $VARS don't work, which also makes it safer. shell runs through /bin/sh. Prefer a dedicated module over either one.
Q138 What are handlers?
Beginner
Tasks that run only when another task notifies them with changed, once, at the end of the play. The typical use is restarting a service after a config change.
Q139 Where do you put variables in Ansible, lowest to highest priority, briefly?
Advanced
Role defaults/ (lowest), then inventory and group_vars/host_vars, then play vars, then role vars/, then set_fact/registered vars, and finally -e extra vars, which always win.
Q140 How do you dry-run a playbook and see what would change?
Beginner
ansible-playbook site.yml --check --diff Q141 What is ansible-galaxy used for?
Beginner
ansible-galaxy used for?It installs roles and collections, and scaffolds new roles.
ansible-galaxy collection install -r requirements.yml
ansible-galaxy role init myrole Q142 What does serial do in a play?
Intermediate
serial do in a play?It runs the play on a batch of hosts at a time (serial: 2 or serial: "25%") for rolling updates. Combine it with max_fail_percentage to stop a bad rollout early.
Q143 What is delegate_to?
Advanced
delegate_to?It runs a task on a different host than the current target, but in that target's context. A common use is calling a load balancer API from localhost to deregister the current host.
Q144 How do you speed up a slow Ansible run?
Advanced
Raise forks, enable SSH pipelining (pipelining = True), use gather_facts: false or fact caching, use strategy: free where ordering doesn't matter, and pass lists to package modules instead of looping.
Q145 Ansible vs Terraform: when do you use each?
Intermediate
Terraform provisions infrastructure declaratively and keeps state (VPCs, clusters, databases). Ansible configures what runs on machines, procedurally and without state (packages, files, services). They're often used together.
Q146 What is a Jinja2 filter? Give two examples.
Intermediate
A filter transforms a value inside a template. For example {{ name | upper }}, and {{ port | default(8080) }}, which supplies a fallback when the variable is undefined.
Q147 What does become do?
Beginner
become do?It escalates privilege for a task or play, using sudo by default. Use become_user to switch to a user other than root.
Q148 import_tasks vs include_tasks?
Advanced
import_tasks vs include_tasks?import_* is static and processed at parse time, so tags and when apply to every imported task. include_* is dynamic and evaluated at runtime, so it can be used with loops and variable file names.
AWS
🎥 Learn this hands-on with DevOps Shack → YouTube @devopsshack · Hindi @shackverse · Courses at devopsshack.com
Q149 Region vs Availability Zone?
Beginner
A region is a geographic area (for example ap-south-1, Mumbai). An AZ is one or more isolated data centres inside a region. Spread across at least 2 AZs, ideally 3, for high availability.
Q150 IAM user vs role?
Intermediate
A user has long-term credentials and represents a person or legacy system. A role is assumed for short-lived credentials by services, EC2, pods or federated users. Prefer roles everywhere.
Q151 What is the order of IAM policy evaluation?
Advanced
An explicit Deny anywhere always wins. Otherwise access needs an explicit Allow, and also has to be permitted by every applicable boundary (SCPs, permission boundaries, session policies, and resource policies where they apply). The default is implicit deny.
Q152 S3 storage classes in one line each?
Intermediate
Standard is for hot data. Intelligent-Tiering moves objects automatically based on access. Standard-IA and One Zone-IA are for infrequent access. Glacier Instant, Flexible and Deep Archive are for archives, with retrieval from milliseconds up to hours.
Q153 What is a VPC endpoint, and why use one?
Intermediate
It gives private access to AWS services without the internet or a NAT gateway. Gateway endpoints (S3, DynamoDB) are free. Interface endpoints (PrivateLink) are ENIs that cost per hour. They cut NAT data charges and keep traffic private.
Q154 ALB vs NLB?
Intermediate
ALB works at L7 (HTTP/HTTPS) with path and host routing, WAF and OIDC auth. NLB works at L4 (TCP/UDP/TLS) with very high throughput, static IPs, and it preserves the client IP.
Q155 What does an Auto Scaling Group need to replace unhealthy instances properly?
Intermediate
A launch template, subnets across AZs, and health_check_type = ELB so failing load balancer health checks trigger replacement, not just EC2 status checks. Add a grace period for boot time.
Q156 RDS Multi-AZ vs read replica?
Advanced
Multi-AZ is a synchronous standby for automatic failover, and it isn't readable in the classic setup. A read replica uses asynchronous replication to scale reads and can be promoted, including across regions, for DR.
Q157 What is IMDSv2, and why enforce it?
Advanced
The session-token version of the instance metadata service: a PUT for a token first, then requests that carry the token. It blocks SSRF attacks that steal instance role credentials through simple GETs.
TOKEN=$(curl -sX PUT http://169.254.169.254/latest/api/token -H "X-aws-ec2-metadata-token-ttl-seconds: 300") Q158 How do you find who deleted a resource?
Beginner
CloudTrail. Search the event history (90 days by default) for Delete* events on that resource, or query a trail stored in S3 with Athena or CloudTrail Lake.
Q159 What is an SCP?
Advanced
A Service Control Policy in AWS Organizations. It sets the maximum permissions for accounts in an OU but grants nothing itself. Example: deny all regions except ap-south-1, or deny leaving the organization.
Q160 EBS vs EFS vs S3?
Intermediate
EBS is block storage attached to one instance in one AZ. EFS is managed NFS shared across instances and AZs. S3 is object storage over HTTP with effectively unlimited capacity.
Q161 How do pods on EKS get AWS permissions without keys?
Advanced
IRSA (an OIDC provider plus a service account annotated with a role ARN) or EKS Pod Identity (the agent add-on plus an association). Each maps a Kubernetes service account to an IAM role that issues short-lived credentials.
Q162 What are the main EC2 purchase options?
Intermediate
On-Demand, Savings Plans and Reserved Instances (commit for 1 or 3 years for a big discount), Spot (up to about 90% off but can be reclaimed with a 2-minute warning), and Dedicated Hosts.
Q163 Lambda cold start: what is it, and how do you reduce it?
Intermediate
The extra latency when a new execution environment is initialised. Reduce it with smaller packages, lighter runtimes, initialising clients outside the handler, provisioned concurrency, or SnapStart (Java, and since 2024 Python and .NET).
Q164 SQS standard vs FIFO?
Advanced
Standard has nearly unlimited throughput, at-least-once delivery and best-effort ordering. FIFO gives ordering within a message group and exactly-once processing via deduplication, with lower throughput limits.
Q165 What is a NAT gateway's biggest hidden cost?
Advanced
The per-GB data processing charge on top of the hourly charge. Traffic to S3, ECR or DynamoDB through NAT adds up fast. Use gateway and interface VPC endpoints instead.
Q166 CloudWatch Logs vs metrics vs alarms?
Beginner
Logs are raw events. Metrics are numeric time series (and metric filters can derive them from logs). Alarms watch a metric against a threshold and trigger SNS, Auto Scaling or other actions.
Q167 How does Route 53 failover routing work?
Intermediate
A primary record is tied to a health check and a secondary record serves when the check fails. Use a low TTL so clients follow the change quickly.
Q168 What is AWS Systems Manager Session Manager good for?
Beginner
Shell access to instances without SSH keys, bastions or open port 22, controlled by IAM and logged to CloudWatch or S3. It needs the SSM agent and an instance role.
Q169 Secrets Manager vs Parameter Store?
Intermediate
Secrets Manager has built-in rotation and cross-region replication, and costs per secret. Parameter Store SecureString is cheaper (standard tier free), good for config and simple secrets, but has no native rotation.
Q170 What is the AWS shared responsibility model in one line?
Beginner
AWS secures the cloud itself (hardware, facilities, the managed service layer). You secure what you put in it (IAM, data, OS patching on EC2, network config, encryption choices).
Monitoring and security
🎥 Learn this hands-on with DevOps Shack → YouTube @devopsshack · Hindi @shackverse · Courses at devopsshack.com
Q171 Monitoring vs observability?
Beginner
Monitoring watches known failure modes with predefined metrics and alerts. Observability is being able to ask new questions about unknown failures, using rich metrics, logs and traces with correlated context.
Q172 What are the three pillars of observability?
Beginner
Metrics (cheap numeric trends), logs (detailed events) and traces (one request's path across services). Profiles are increasingly counted as a fourth.
Q173 SLI vs SLO vs SLA?
Intermediate
An SLI is the measurement (for example the percentage of successful requests). An SLO is the internal target (99.9% over 30 days). An SLA is the contractual promise to customers, with penalties, and is usually looser than the SLO.
Q174 What are the four golden signals?
Intermediate
Latency, traffic, errors and saturation, from the Google SRE book. RED (Rate, Errors, Duration) applies them to services and USE (Utilisation, Saturation, Errors) to resources.
Q175 Prometheus: pull or push, and how do short-lived jobs report?
Intermediate
Prometheus pulls, scraping /metrics. Short-lived batch jobs push to a Pushgateway, which Prometheus then scrapes.
Q176 Counter vs gauge vs histogram?
Advanced
A counter only goes up (use rate() on it). A gauge goes up and down (memory, queue depth). A histogram counts observations into buckets, so you can compute percentiles with histogram_quantile().
Q177 Write the PromQL for the 5xx error ratio over 5 minutes.
Intermediate
sum(rate(http_requests_total{status=~"5.."}[5m]))
/
sum(rate(http_requests_total[5m])) Q178 Write PromQL for p99 latency from a histogram.
Advanced
histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))Keep le in the by clause, or the quantile can't be computed.
Q179 What is high cardinality, and why does it hurt?
Advanced
Labels with many unique values (user ID, request ID, full URL) create a separate time series for every combination. That blows up memory and storage in Prometheus. Put those values in logs or traces, not in metric labels.
Q180 What makes a good alert?
Intermediate
It's actionable, urgent, tied to user impact (symptoms such as SLO burn rate, not causes like CPU at 80%), and links a runbook. If nobody needs to act now, make it a ticket or a dashboard, not a page.
Q181 What is OpenTelemetry?
Intermediate
A vendor-neutral CNCF standard of APIs, SDKs and the Collector for generating and exporting traces, metrics and logs. You instrument once and send the data to any backend (Tempo, Jaeger, Datadog and others).
Q182 What is the principle of least privilege?
Beginner
Give every identity (human, service, pipeline) only the permissions it needs, only for as long as it needs them. It limits the damage a leaked credential can do.
Q183 SAST vs DAST vs SCA?
Intermediate
SAST scans source code for bugs (Semgrep, SonarQube). DAST attacks the running app (OWASP ZAP). SCA finds vulnerable dependencies (Trivy, Snyk, Dependabot).
Q184 What is an SBOM?
Intermediate
A Software Bill of Materials: a machine-readable list of every component and version in an artifact (SPDX or CycloneDX). It lets you answer "are we affected by this CVE?" in minutes.
syft myapp:1.0 -o cyclonedx-json > sbom.json Q185 How do you sign and verify a container image?
Advanced
With Sigstore cosign. Keyless signing uses OIDC identity from CI. Enforce verification at admission with Kyverno or policy-controller.
cosign sign myrepo/app@sha256:<digest>
cosign verify myrepo/app@sha256:<digest> --certificate-identity-regexp '.*' --certificate-oidc-issuer https://token.actions.githubusercontent.com Q186 Encryption at rest vs in transit?
Beginner
At rest protects stored data (KMS-encrypted EBS, S3, RDS). In transit protects data moving over the network (TLS, mTLS). Production needs both.
Q187 What does a WAF protect against?
Intermediate
L7 attacks such as SQL injection, XSS, bad bots and request floods (through rate-based rules), placed in front of an ALB, CloudFront or API Gateway. It doesn't replace fixing the app.
Q188 What is zero trust in one line?
Advanced
Never trust based on network location. Authenticate and authorise every request using identity and device posture, encrypt everywhere, and give least-privilege access per resource.
Mixed bag
🎥 Learn this hands-on with DevOps Shack → YouTube @devopsshack · Hindi @shackverse · Courses at devopsshack.com
Q189 What is the difference between horizontal and vertical scaling?
Beginner
Horizontal scaling adds more instances and needs a stateless design, but has no hard ceiling. Vertical scaling makes one instance bigger; it's simple but limited, and often needs a restart.
Q190 Stateless vs stateful service?
Intermediate
A stateless service keeps no client data between requests, so any replica can serve any request and scaling is easy. A stateful service keeps data (databases, sessions on local disk), so it needs stable identity and storage.
Q191 What is idempotency, and why does it matter for retries?
Advanced
Performing an operation twice has the same effect as performing it once. Retries after timeouts are only safe for idempotent operations, so use idempotency keys for things like payments.
Q192 What is a circuit breaker?
Advanced
After repeated failures to a dependency, it "opens" and fails fast for a cool-down period instead of piling up slow calls, then lets a few trial requests through (half-open). It prevents cascading failures.
Q193 What is a post-mortem, and what makes it "blameless"?
Beginner
A written review after an incident: timeline, impact, root causes, what went well, and action items. Blameless means it focuses on system and process gaps, not on who made the mistake, so people report honestly.
Q194 What does "cattle, not pets" mean?
Beginner
Servers are identical, disposable units built from code, replaced rather than repaired, and never hand-tuned. Immutable images and autoscaling groups are the practice.
Q195 What is toil, in SRE terms?
Intermediate
Manual, repetitive, automatable work with no lasting value that grows with service size. SRE practice caps it (Google targets under 50% of time) and automates it away.
Q196 What is the 12-factor app rule about config?
Intermediate
Keep config that varies between deploys in the environment, not in code. That's what lets the same build artifact run in dev, staging and production.
Q197 What's an error budget?
Intermediate
100% minus the SLO. At 99.9% over 30 days that's about 43 minutes of allowed unreliability. While budget remains, ship features; when it's spent, prioritise reliability work.
Q198 Mean time to detect vs mean time to recover: which do you improve first?
Advanced
Usually MTTD. You can't recover from what you haven't noticed, and good SLO-based alerting often cuts total impact more than faster fixes. Then cut MTTR with fast rollbacks and feature flags.
Q199 What would you check first if "the site is slow" with no other information?
Advanced
Scope and timing first: is it everyone or one region, and did anything change (deploys, config, traffic)? Then the golden-signal dashboards from the edge inward (CDN/LB latency, then app p99, then DB and dependencies), and traces for one slow request.
Q200 If you could automate only one thing on a new team, what would it be?
Advanced
A reliable, fast path to production: CI on every PR plus one-click (or automatic) deploy and rollback. It speeds up every other improvement and reduces risk on every change. Back it with a concrete metric such as lead time.