Home / Topics / Real-World Interview / Rapid-Fire Round
Real-World Interview

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.

bash
echo $?
Copy link
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.

bash
ln file hard; ln -s /path/file soft
Copy link
Q3

What do the permissions 755 and 640 mean?

Beginner

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

Copy link
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.

bash
ps -eo pid,comm,%cpu --sort=-%cpu | head -5
Copy link
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.

bash
ps -eo pid,ppid,stat,cmd | awk '$3 ~ /Z/'
Copy link
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.

Copy link
Q7

What does load average: 4.00 2.00 1.00 tell you?

Intermediate

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.

Copy link
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.

Copy link
Q9

How do you follow a systemd service's logs live?

Beginner
bash
journalctl -u nginx -f
journalctl -u nginx --since "10 min ago" -p err
Copy link
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.

bash
df -i
Copy link
Q11

> vs >> vs 2>&1?

Intermediate

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

Copy link
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.

Copy link
Q13

What's in /proc?

Advanced

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.

Copy link
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:

bash
sudo systemctl daemon-reload && sudo systemctl enable --now myapp
Copy link
Q15

What does sudo !! do?

Beginner

Reruns the previous command with sudo. !! is Bash history expansion of the last command.

Copy link
Q16

How do you see open files and network connections of a process?

Intermediate
bash
lsof -p <pid>
ls -l /proc/<pid>/fd
ss -tnp | grep <pid>
Copy link
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.

Copy link
Q18

What does chmod u+s (setuid) do, and why is it risky?

Advanced

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.

bash
find / -perm -4000 -type f 2>/dev/null
Copy link
Q19

What are /etc/passwd and /etc/shadow?

Beginner

/etc/passwd lists users (name, UID, GID, home, shell) and is world-readable. /etc/shadow holds password hashes and ageing, readable by root only.

Copy link
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:

bash
30 2 * * * /opt/scripts/backup.sh >> /var/log/backup.log 2>&1
Copy link
Q21

What does set -x do?

Beginner

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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
Q25

How do you find which package a file belongs to?

Intermediate
bash
dpkg -S /usr/bin/curl        # Debian/Ubuntu
rpm -qf /usr/bin/curl        # RHEL/Rocky/Amazon Linux
Copy link

Git

🎥 Learn this hands-on with DevOps Shack → YouTube @devopsshack · Hindi @shackverse · Courses at devopsshack.com

Q26

git fetch vs git pull?

Beginner

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.

Copy link
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.

Copy link
Q28

How do you undo the last commit but keep the changes?

Beginner
bash
git reset --soft HEAD~1     # changes stay staged
git reset HEAD~1            # changes stay, unstaged (--mixed)
Copy link
Q29

git reset vs git revert?

Intermediate

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.

Copy link
Q30

How do you recover a commit after a bad reset --hard?

Intermediate

The reflog keeps where HEAD has been, by default for about 90 days for reachable entries.

bash
git reflog
git reset --hard HEAD@{2}
Copy link
Q31

What does git stash do?

Beginner

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.

Copy link
Q32

What is git cherry-pick?

Beginner

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.

bash
git cherry-pick <sha>
Copy link
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.

bash
git bisect start; git bisect bad; git bisect good v1.4.0
git bisect run ./test.sh
Copy link
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.

Copy link
Q35

What does git push --force-with-lease protect against?

Intermediate

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.

Copy link
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.

bash
git tag -a v1.2.0 -m "Release 1.2.0"
Copy link
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.

Copy link
Q38

What is .gitignore and why doesn't it ignore a file already tracked?

Intermediate

.gitignore only affects untracked files. To stop tracking a file that's already committed, remove it from the index:

bash
git rm --cached secrets.env
Copy link
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.

Copy link
Q40

What does git log --oneline --graph --all show?

Beginner

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.

Copy link

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

Copy link
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.

Copy link
Q43

What happens when you type a URL in the browser, in 4 steps?

Intermediate
  1. A DNS lookup resolves the hostname to an IP.
  2. A TCP connection is opened (or QUIC for HTTP/3).
  3. The TLS handshake runs: certificate check and key exchange.
  4. The HTTP request is sent, the response comes back, and the browser renders it and fetches the page's other resources.
Copy link
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.

Copy link
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.

Copy link
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.

Copy link
Q47

How do you test whether a TCP port is open from a server?

Beginner
bash
nc -vz db.internal 5432
curl -v telnet://db.internal:5432
Copy link
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.

Copy link
Q49

How do you see the route a packet takes?

Beginner
bash
traceroute example.com
mtr -rwc 50 example.com    # continuous, shows per-hop loss
Copy link
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.

Copy link
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.

Copy link
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.

Copy link
Q53

How do you query a specific DNS server and see TTL?

Intermediate
bash
dig @8.8.8.8 api.example.com +noall +answer

The second column of the answer is the remaining TTL in seconds.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

bash
openssl s_client -connect 1.2.3.4:443 -servername app.example.com
Copy link
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.

Copy link

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.

Copy link
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"].

Copy link
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.

Copy link
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.

bash
docker history --no-trunc myapp:1.0
dive myapp:1.0
Copy link
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.

bash
docker image prune            # dangling only
docker system prune -a --volumes   # everything unused; careful
docker system df
Copy link
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.

Copy link
Q65

How do you get a shell in a running container?

Beginner
bash
docker exec -it api sh     # or bash, if the image has it
Copy link
Q66

What does EXPOSE actually do?

Intermediate

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.

Copy link
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.

Copy link
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.

bash
docker run -d --restart unless-stopped nginx
Copy link
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.

bash
docker network create appnet
Copy link
Q70

How do you limit a container's memory and CPU?

Beginner
bash
docker run --memory 512m --cpus 1.5 myapp
docker stats
Copy link
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.

Copy link
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.

Copy link
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 . .).

Copy link
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.

Copy link
Q75

What does docker inspect give you? Show one useful format string.

Intermediate

The full JSON config and state of a container or image.

bash
docker inspect -f '{{.State.Status}} {{.NetworkSettings.IPAddress}}' api
Copy link
Q76

How do you copy a file out of a container?

Beginner
bash
docker cp api:/app/logs/error.log ./error.log
Copy link
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.

Copy link
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.

Copy link
Q79

What does docker compose up -d --build do?

Beginner

It rebuilds images for services with a build: section, then creates or recreates changed containers in the background.

Copy link
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.

Copy link

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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
Q87

How do you roll back a Deployment?

Beginner
bash
kubectl rollout history deploy/api
kubectl rollout undo deploy/api --to-revision=3
Copy link
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.

Copy link
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.

Copy link
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.

Copy link
Q91

How do you get a shell in a pod, and debug one that has no shell?

Intermediate
bash
kubectl exec -it api-xyz -- sh
kubectl debug -it api-xyz --image=busybox:1.36 --target=api   # ephemeral container
Copy link
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.

Copy link
Q93

What does kubectl apply do differently from kubectl create?

Advanced

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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

bash
ETCDCTL_API=3 etcdctl snapshot save /backup/etcd.db
Copy link
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.

Copy link
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.

Copy link
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.

Copy link
Q101

How do you see resource usage of pods and nodes?

Beginner

These need metrics-server installed.

bash
kubectl top pods -A --sort-by=memory
kubectl top nodes
Copy link
Q102

What does kubectl drain do?

Intermediate

It cordons the node (no new pods) and evicts the existing pods while respecting PDBs. It's used before maintenance or an upgrade.

bash
kubectl drain node-1 --ignore-daemonsets --delete-emptydir-data
Copy link
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.

Copy link
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.

Copy link
Q105

How do you switch namespace for your current context?

Beginner
bash
kubectl config set-context --current --namespace=staging
Copy link
Q106

What does imagePullPolicy: IfNotPresent mean, and what's the default?

Advanced

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.

Copy link
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.

bash
kubectl label ns prod pod-security.kubernetes.io/enforce=restricted
Copy link
Q108

How do you get all pods with their node and IP in one command?

Beginner
bash
kubectl get pods -A -o wide
Copy link

CI/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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
Q115

What does needs: do in GitHub Actions?

Beginner

It makes a job wait for other jobs and lets it read their outputs through needs.<job>.outputs. Without needs, jobs run in parallel.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link

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.

Copy link
Q124

terraform plan vs apply vs refresh?

Intermediate

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.

Copy link
Q125

What does terraform init do?

Beginner

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.

Copy link
Q126

count vs for_each?

Intermediate

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.

Copy link
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.

Copy link
Q128

How do you target or replace a single resource?

Intermediate

-replace supersedes terraform taint. Use -target only in emergencies.

bash
terraform apply -replace="aws_instance.web"
terraform plan -target="module.vpc"
Copy link
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.

Copy link
Q130

Why commit .terraform.lock.hcl?

Advanced

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.

Copy link
Q131

What does sensitive = true do, and what doesn't it do?

Advanced

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.

Copy link
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:

hcl
provider "aws" {
  alias  = "use1"
  region = "us-east-1"
}
Copy link
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.

Copy link
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).

Copy link
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.

Copy link
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.

Copy link
Q137

Ansible command vs shell module?

Intermediate

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.

Copy link
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.

Copy link
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.

Copy link
Q140

How do you dry-run a playbook and see what would change?

Beginner
bash
ansible-playbook site.yml --check --diff
Copy link
Q141

What is ansible-galaxy used for?

Beginner

It installs roles and collections, and scaffolds new roles.

bash
ansible-galaxy collection install -r requirements.yml
ansible-galaxy role init myrole
Copy link
Q142

What does serial do in a play?

Intermediate

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.

Copy link
Q143

What is delegate_to?

Advanced

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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
Q147

What does become do?

Beginner

It escalates privilege for a task or play, using sudo by default. Use become_user to switch to a user other than root.

Copy link
Q148

import_tasks vs include_tasks?

Advanced

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.

Copy link

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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

bash
TOKEN=$(curl -sX PUT http://169.254.169.254/latest/api/token -H "X-aws-ec2-metadata-token-ttl-seconds: 300")
Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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).

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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).

Copy link

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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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().

Copy link
Q177

Write the PromQL for the 5xx error ratio over 5 minutes.

Intermediate
promql
sum(rate(http_requests_total{status=~"5.."}[5m]))
/
sum(rate(http_requests_total[5m]))
Copy link
Q178

Write PromQL for p99 latency from a histogram.

Advanced
promql
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.

Copy link
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.

Copy link
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.

Copy link
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).

Copy link
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.

Copy link
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).

Copy link
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.

bash
syft myapp:1.0 -o cyclonedx-json > sbom.json
Copy link
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.

bash
cosign sign myrepo/app@sha256:<digest>
cosign verify myrepo/app@sha256:<digest> --certificate-identity-regexp '.*' --certificate-oidc-issuer https://token.actions.githubusercontent.com
Copy link
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.

Copy link
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.

Copy link
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.

Copy link

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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
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.

Copy link
Feedback