Checking your sign-in…
This lesson is in Phase 2 — ₹799, one-time
Pay once with UPI, card or netbanking. Keep it forever. Your progress saves, so you can stop and come back.
← Back to all lessonsInterview Pack — Real Questions, What They Really Test
Phase 2 · The Rest of DevOpsWhat this is and why it matters
This pack is a study guide covering core DevOps interview questions and the practical principles behind them.
Think of it like a driving test practice book. The book lists the questions the tester usually asks. Under each question it says what the tester is really checking. And it gives a sample answer you can practise saying out loud.
Interviewers use these questions to test whether you understand how systems work and fail, not whether you memorised syntax.
It groups questions by topic, says what the interviewer is really testing, and gives plain answers you can practise out loud.
Words you need, before you use them
- An interviewer is the person asking you questions for a job.
- A sample answer is an example answer. It is not a script to memorise word for word. Say it in your own words.
- Really testing means "this is the skill the interviewer is actually checking". The question is the surface. The skill underneath is the point.
- A lab is a hands-on exercise in this kit where you did the thing yourself, on your own machine.
- An honest answer means an answer that is true about what you actually did. If you did it only in a practice lab, say "in a practice lab". That is a strong answer, not a weak one.
How to use this
Read the question, answer out loud in your own words, then read the sample answer and the "why they ask it" line. Interviewers care less about perfect wording and more about whether you understand the idea and have done it. If you have not done it, say what you did instead — do not pretend.
Which questions can you answer truthfully right now? The ones about things you did in the Phase 1 labs and the first portfolio projects. The ones about things you have only read about — say so plainly, then say how you would find out. That is question 20, and it is the most important question in the pack.
For every answer about something you did, add the line "I did this in [lab or project] on my own machine." If you cannot add that line truthfully, do the lab first.
How to practise
- Pick one section. Read the question out loud. Answer it out loud, in your own words, without looking.
- Read the "what the words mean" and the "why they ask it" parts. Fix the parts of your answer that were wrong or vague.
- Read the sample answer. Notice the words you missed. Say it again, in your own words, with those words in it.
- For every answer about something you did, add the line "I did this in [lab or project] on my own machine." If you cannot add that line truthfully, do the lab first.
- Practise question 19 most. It is the question that usually decides the interview.
Linux and Git
1. What does chmod 755 do?
What the words mean
- A file permission is a rule saying who can read, write, and run a file.
- Read means open and look at it. Write means change it. Execute means run it as a program.
- There are three groups of people: the owner (the person who owns the file — usually you), the group (a small team the file belongs to), and others (everyone else).
- The number
755is three digits, one per group:7for the owner,5for the group,5for others. - Each digit is a sum: read is worth 4, write is worth 2, execute is worth 1. So
7 = 4+2+1(read, write, execute) and5 = 4+1(read and execute, no write). - Written out as letters,
755isrwxr-xr-x:rwxfor the owner,r-xfor the group,r-xfor others.
Why they ask it
They want to know you understand who can do what to a file. In real work, a wrong permission either blocks a program from running or lets the wrong person change a file.
Sample answer: owner gets read, write, execute (rwx); group and others get read and execute (r-x). Written out: rwxr-xr-x. 7 = 4+2+1 (read+write+execute), 5 = 4+1 (read+execute).
One more thing a beginner should know: execute means something different for a folder. On a folder, execute means "allowed to go inside it". So 755 on a folder means everyone can go inside and look, but only the owner can add or remove files.
2. A program is using too much CPU. How do you find which one?
What the words mean
- CPU is the computer's thinking part. "Too much CPU" means one program is doing so much work that everything else slows down.
topis a program that shows the busiest programs live, updating every few seconds. Pressqto leave it. Whiletopis running, pressPto sort the list by CPU use, so the busiest program sits at the top.ps auxis a program that takes one still photo of all running programs.- PID is a program's number. Every running program gets a unique number, so you can point at exactly one program.
Why they ask it
They want to know you can look at a live machine with basic tools instead of guessing. The first step in fixing anything is finding the right program.
Sample answer: top for a live view (sort by CPU — press P while top is running to sort by CPU use), or ps aux for a snapshot. Note the program's name and PID, and check what it is before you stop anything.
Do not skip the last line: never stop a program before you know what it is. Stopping the wrong one can kill something important.
3. What is the difference between git pull and git fetch?
What the words mean
- Fetch means download only. Git downloads the latest changes from GitHub and holds them aside. Your files do not change.
- Pull means fetch, then integrate. Git downloads the changes and combines them with your files.
- Merge is one way to combine: Git joins the two sets of changes together.
- Rebase is the other way to combine: Git takes your saves and replays them one by one on top of the downloaded changes, so the history looks like a straight line instead of a fork. You do not need to use rebase as a beginner — you only need to know the word, because interviewers say it.
Why they ask it
They want to know you understand that fetch is safe (it touches nothing) and pull changes your files. People who confuse the two lose work.
Sample answer: fetch only downloads the latest changes — it does not touch your files. Pull fetches and then integrates them, usually by merge (or by rebase, if that is how it is set up).
4. Your branch has a conflict. What do you do?
What the words mean
- A branch is a side copy of your work.
- A conflict happens when two branches changed the same lines in the same file, and Git cannot decide which lines to keep. It stops and asks you.
- Conflict markers are the lines Git writes into the file to show you the two versions:
<<<<<<<marks the start of YOUR version.=======marks the middle, where your version ends and the other version begins.>>>>>>>marks the end of the OTHER version.- Stage means put the fixed file in the waiting pile for the next save (see
git addin the cheat sheets lesson, phase2/cheat-sheets.md).
Why they ask it
They want to know you stay calm, read the markers, pick the right lines, and finish the merge — instead of panicking or deleting the file.
Sample answer: open the file, read the conflict markers (<<<<<<< is my side, ======= is the middle, >>>>>>> is their side), pick the correct lines, delete the markers, stage the file, and commit to finish the merge.
Docker
5. What is a container, and how is it different from a virtual machine?
What the words mean
- A container is a small sealed box that runs one program, with everything that program needs inside the box.
- A virtual machine is a whole second computer running inside your computer, with its own full operating system.
- The kernel is the core of an operating system — the part that talks to the hardware and manages programs. Think of it as the engine of the computer. Your machine has one kernel.
- The host machine is your real computer, the one the container or virtual machine runs on.
Why they ask it
They want to know you understand why containers are light: they share the host's engine instead of bringing a second engine.
Sample answer: a container shares the host machine's system (kernel) and runs just your app and its needs, so it is light. A virtual machine runs a whole second system, kernel included, so it is heavier.
6. What is a Dockerfile?
What the words mean
- A Dockerfile is a short text recipe. It says: start from a base image, copy files in, install what is needed, say what to run.
- A base image is the starting box the recipe builds on — for example, an image that already holds a web server program.
- An image is the packed box the recipe produces. A container is the image running.
Why they ask it
They want to know you can describe a build recipe in plain words. If you can say it plainly, you understand it.
Sample answer: a short text recipe — start from a base image, copy files in, install what is needed, say what to run. docker build turns it into an image.
7. Your container starts and stops at once. Where do you look first?
What the words mean
- A container lives only as long as its main program runs. The main program is the one program the container was told to run. If that program finishes, the container stops. A program that finishes instantly — like a program with nothing to do — makes the container stop at once.
- Foreground means the program stays in front, running, instead of finishing and handing control back. A container needs a foreground program to stay alive.
Why they ask it
They want to know you check docker logs before guessing. The error is almost always in the logs.
Sample answer: a container lives only as long as its main program runs. Check docker ps -a to see it exited, then docker logs for the error — the program probably crashed or had nothing to do.
8. Why map ports with -p 8080:80?
What the words mean
- A port is a numbered door a program listens on.
8080is a door on YOUR machine.80is a door inside the container.- localhost means "this machine".
http://localhost:8080means "the program on this machine, door 8080". -p 8080:80connects the two doors. The order is always outside:inside.
Why they ask it
They want to know you understand the container's door and your machine's door are two different doors, and the mapping joins them.
Sample answer: 8080 is your machine's door, 80 is the container's door. Without the mapping, your browser cannot reach the app inside the container.
Kubernetes
9. What is a pod?
What the words mean
- Kubernetes is a system that runs containers across several machines and keeps them running.
- A pod is the smallest thing Kubernetes runs, usually holding one container. Think of it as one wrapper around one container.
- A pod has its own network address (its own place on the cluster's network, so other things can reach it) and its own storage (a place to keep files while it runs).
Why they ask it
They want to know you know the basic building block before anything else. Everything in Kubernetes is built from pods.
Sample answer: the smallest thing Kubernetes runs, usually holding one container, with its own shared network address and storage.
10. What does a deployment do?
What the words mean
- A deployment is a manager. You tell it "I want 3 copies of my app running", and it starts 3, replaces any that die, and handles updates for you.
- A copy here is one pod running your app. Kubernetes calls copies replicas. "3 replicas" means "3 copies".
Why they ask it
They want to know you understand Kubernetes keeps a chosen number of copies running and replaces failed ones — you do not restart things by hand.
Sample answer: it keeps the number of copies you set running, replaces failed ones, and handles updates for you.
11. Your pod keeps crashing and restarting. How do you debug it?
What the words mean
- Debug means find the cause of a problem, step by step, instead of guessing.
kubectl get podslists pods. TheRESTARTScolumn shows how many times each pod has restarted. More than 0 means it crashed before.kubectl describe podshows full details. TheEvents:section at the bottom is a short history of what happened to the pod, newest last.kubectl logsshows what the program printed in the current run.kubectl logs --previousshows what the program printed in the run BEFORE this one — the run that crashed. Use it when the current logs look clean because the pod already restarted and the crashing run is gone. (Full explanation: the cheat sheets lesson, phase2/cheat-sheets.md, Kubernetes section.)
Why they ask it
They want to know you can read pod logs and describe the failure, instead of just restarting it again. Restarting without fixing the cause makes it crash again.
Sample answer: kubectl get pods, then kubectl describe pod (read the Events at the bottom), then kubectl logs, and kubectl logs --previous for the crashed run's output. Fix the cause — bad image, bad setting — not just restart it again.
12. What is a service in Kubernetes?
What the words mean
- Pods come and go: they die, they are replaced, and each new pod gets a new address. That makes them hard to reach.
- A service is a stable address inside the cluster that always points at the current healthy pods. The address stays the same even when the pods change.
- A label is a small name tag stuck on a pod, like
app: my-site. The service finds its pods by matching these tags. kubectl port-forwardmakes a temporary tunnel from your machine to the service so your browser can reach it. It does not put the service on the internet.
Why they ask it
They want to know you understand the problem a service solves: pods change, so you need one address that does not change.
Sample answer: a stable address inside the cluster for pods that come and go — it matches pods by their labels. In this kit's local lab, your browser reaches it through kubectl port-forward; that does not expose it publicly.
Terraform and CI/CD
13. What is "infrastructure as code"?
What the words mean
- Infrastructure means the things your app runs on: containers, networks, machines, storage.
- As code means written down in files, like a recipe, instead of clicked together by hand on a screen.
- A tool here is a program — Terraform — that reads the files and creates the things.
Why they ask it
They want to know you can explain the idea in plain words: write it down once, create it the same way every time.
Sample answer: writing down the infrastructure you want in files, and letting a tool create it — repeatable, reviewable, and the same every time, instead of clicking around by hand.
14. What is Terraform state, and why does it matter?
What the words mean
- State is Terraform's notebook. It maps each thing in your files to the real thing Terraform created, and stores what it needs to plan the next change.
- "Maps" means it keeps a list saying "this line in your file = this real container that exists now".
- Private values means secrets: passwords, keys, tokens. State can hold these, because Terraform needs them to manage things.
- A public repository is a project folder on GitHub that anyone on the internet can read. Putting state there means putting secrets where anyone can read them.
Why they ask it
They want to know you understand state is not just a list — it is the map Terraform uses to plan, and it must be protected.
Sample answer: state maps each thing in your files to the real thing Terraform created, and stores what it needs to plan the next change. It can hold private values, so it must never go into a public repository.
15. What happens in a CI/CD pipeline when you push code?
What the words mean
- CI/CD stands for Continuous Integration / Continuous Delivery (or Deployment). It is an automatic chain of steps that runs when you push code.
- A pipeline is that automatic chain of steps. A workflow is another word for the same chain — the file that describes the steps.
- Push means send your saved code up to GitHub.
- A test step checks the code (for example, "does the file exist, does it hold the right heading?"). A build step builds the Docker image.
- Delivery means a change is tested and ready to release. Deployment means it is released automatically, with no human step in between.
Why they ask it
They want to know you can walk through test and build in order, and say what delivery and deployment each mean. The order matters: test first, so a broken site never gets built.
Sample answer: the push starts the workflow — it runs the test step, then the build step. Delivery means a change is tested and ready to release; deployment means it is released automatically. This kit's pipeline tests and builds; it does not deploy.
16. A pipeline fails. What is your first step?
What the words mean
- A run is one execution of the pipeline — one time the chain of steps ran.
- The Actions tab is the page on GitHub, inside your repository, that shows pipeline runs. Each run is a row. A green tick means it passed. A red cross means it failed.
- A step's log is the printed output of one step in the chain. Click the failed run, then click the failed step, and the log opens.
Why they ask it
They want to know you read the failed step's log before changing anything. Guessing wastes time; the first error line names the one thing to fix first.
Sample answer: open the failed run, read the failed step's log, find the first error line, and fix that one thing first.
Monitoring and general
17. How do you know if an app is healthy?
What the words mean
- Healthy means working well, not just working once.
- Up means it answers when asked.
- Fast enough means it answers without a long wait. A page that takes 30 seconds to load is not healthy even if it loads.
- Errors low means very few requests fail. If 1 in 10 requests fails, that is not healthy.
- Memory and CPU sane means the program is not using a wild amount of memory or processor power. "Sane" here means "a normal amount, not a runaway amount".
Why they ask it
They want to know you check more than "it opened once". One good load proves almost nothing.
Sample answer: check more than "it opened once" — is it up, is it fast enough, are errors low, are memory and CPU sane?
How to check, in this kit: docker ps shows whether the container is up. docker logs shows errors. Prometheus and Grafana in Portfolio Project 3 show the numbers over time.
18. What is the difference between a metric and a log?
What the words mean
- A metric is a number measured over time. Example: CPU use is 40% now, 45% a minute later. You can draw it as a line on a chart.
- A log is a written record of events. Example: "at 10:04, the program printed 'started'". You read it line by line, like a diary.
Why they ask it
They want to know you use the right tool for the right question: numbers for "how much, how fast", written records for "what happened, and when".
Sample answer: a metric is a number over time (like CPU use); a log is a written record of events ("at this time, this happened").
From this kit: Prometheus collects metrics. docker logs shows logs.
19. Describe a project you built and one problem you fixed in it.
What the words mean
- This is the question that usually decides the interview. It is not a test of memory. It is a test of whether you can explain your own work clearly.
- The shape has four parts: what you built, what broke, how you found it, how you fixed it and proved it.
Why they ask it
Anyone can list tools on a resume. Explaining one real problem, start to finish, proves you actually did the work.
Sample answer (shape, in your own words): "I built [project]. One problem was [symptom]. I found it by [what you checked]. I fixed it by [change], and proved it by [how you checked]."
A filled-in example from this kit — use it as a model, then write your own with your real project:
"I built a website in a Docker container — Portfolio Project 1. One problem was the browser showed nothing even though the container was running. I found it by checking the PORTS column in docker ps — I had forgotten the -p 8080:80 mapping, so there was no door from my machine into the container. I fixed it by stopping the container and running it again with -p 8080:80. I proved it by opening http://localhost:8080 and seeing my page."
If you have not finished a project yet: do not invent one. Say "I am building [project] now. So far I have done [true part]. The problem I hit was [true problem]." An unfinished true project beats a finished invented one.
20. You do not know the answer to a question. What do you say?
What the words mean
- "Reproduce it small" means make the problem happen again in the smallest possible way — one tiny test, not the whole system — so you can see it clearly.
- "Test one idea at a time" means change one thing, check the result, then change the next thing. If you change five things at once, you never learn which one fixed it.
Why they ask it
They are testing honesty and method. "I don't know, but here is how I would find out" beats a confident guess, because a confident guess in real work breaks things.
Sample answer: "I don't know, but here is how I would find out" — then name the steps: check the docs, reproduce it small, test one idea at a time.
21. What is the difference between an image and a container?
What the words mean
- The Dockerfile is the recipe.
- The image is the built copy — the packed box, sitting still.
- The container is the image running — the box opened and working.
- One image can run as many containers. Think of one recipe making many cakes: same recipe, many cakes, each one separate.
Why they ask it
They want to know you keep the three ideas apart. People who mix them up give confused answers about everything else in Docker.
Sample answer: the Dockerfile is the recipe, the image is the built copy, and a container is the image running. One image can run as many containers.
22. Your YAML file fails with a strange error. What do you check first?
What the words mean
- YAML is a settings-file format. Files ending in
.ymlare YAML files. - Indentation means spaces at the start of a line. YAML uses indentation to show which lines belong together. Two spaces in the wrong place changes the meaning.
- A Tab is the Tab key. It looks like spaces on screen, but it is a different character, and YAML refuses it.
Why they ask it
They want to know your first check is the spaces — the most common cause — not a long hunt through the whole file.
Sample answer: the spaces — YAML breaks on tabs and wrong indentation. Check the line the error names first.
What that error looks like: the error names a line number, like line 4. Open the file, go to that line, and look at the spaces at the start of it. Compare them with the lines above it.
23. You wrote a script but running it says "permission denied". What do you do?
What the words mean
- A script is a text file full of commands, meant to be run as a program.
- The execute bit is the "allowed to run" mark on a file.
chmod +xadds it. (Full explanation: the cheat sheets lesson, phase2/cheat-sheets.md, file section.) - The owner is the person who owns the file. The folder's permissions are the rules on the folder the file sits in — if you cannot go inside the folder, you cannot run the file.
- The interpreter is the program that reads the script. The script's first line names it, for example
#!/bin/bashmeans "read this with the bash program". If that program is not installed, the script cannot run. - "The disk allows running files" means the disk is not mounted with a rule that forbids running programs from it. This is rare on a practice machine, and it is the last thing to check, not the first.
Why they ask it
They want to know chmod +x is only the first check, not the only possible cause. A good answer lists the checks in order.
Sample answer: first check the execute bit — chmod +x if it is missing. If that does not fix it, check the file's owner, the folder's permissions, and whether the disk allows running files. If it names a missing interpreter, check the script's first line and whether that program is installed.
Kafka, PostgreSQL, Redis, object store, load balancer (Phase 1)
These questions cover the Phase 1 labs. Answer them only with what you actually did in those labs. If you have not done a lab yet, say so — then say how you would find out (question 20).
24. What is a Kafka topic, and what is the difference between a producer and a consumer?
What the words mean
- Kafka is a message line. Programs put messages into a named line, and other programs take them out.
- A topic is one named line of messages, kept in order. Think of one labelled queue at a counter: messages join at the back and are taken from the front.
- A producer is a program that puts messages into the topic.
- A consumer is a program that takes messages out of the topic and does the work.
- "Kept in order" means messages stay in the order they arrived. (Inside, Kafka splits a topic into slices called partitions; for this answer, "one line, in order" is enough.)
Why they ask it
They want to know you can explain the line, the sender, and the reader in plain words — the three parts of the idea.
Sample answer: a topic is a named line of messages, kept in order. A producer puts messages into the topic. A consumer takes messages out and does the work. If the consumer is slow, the messages wait safely in the topic.
25. What is the difference between a PostgreSQL primary and a replica?
What the words mean
- PostgreSQL is a database: a program that stores rows in tables.
- The primary is the main database. It takes writes — new and changed rows.
- The replica (also called a standby) is the second copy. It follows the primary by reading its change log and takes reads only.
- WAL streaming is how the replica follows: WAL stands for Write-Ahead Log — the primary's diary of every change, written down before the change itself. "Streaming" means the replica reads that diary continuously, as new lines appear, and copies each change. So the replica stays up to date.
Why they ask it
They want to know the primary writes and the replica reads, and why the replica refuses writes — because its job is to be an exact copy, not a second writer.
Sample answer: the primary takes writes — new and changed rows. The replica follows the primary by reading its change log (WAL streaming) and takes reads only. If you try to write on the replica, it refuses — that is correct, not a bug.
26. Your main database dies. What do you do, step by step?
What the words mean
- Failover means switching work from the dead main database to the standby, so the app keeps running.
- Promote means telling the standby "stop following, become the main database now". The command is
pg_promote(), run inside the standby's container. - In recovery means "still following someone else". After promoting, the standby is no longer in recovery —
pg_is_in_recovery()answersf(false). - Rebuild the old main database means the dead one cannot just rejoin as a standby. It must be set up fresh and copied from the new main database, because it missed changes while it was dead.
Where you do this: in the Phase 1 PostgreSQL lab, on your own machine. Open your terminal, move into the lab folder with cd phase1/postgresql-lab, and run the commands there. The standby container is named pg-replica. The promote command is:
docker exec pg-replica psql -U learner -d practice -c "SELECT pg_promote();"Word by word: docker exec runs a command inside a running container; pg-replica is the standby container; psql is the PostgreSQL command tool; -U learner means "log in as the user called learner"; -d practice means "use the database called practice"; -c "SELECT pg_promote();" means "run this one command, then stop".
Why they ask it
They want to know you can walk through failover in order, and that you know the old primary needs rebuilding — the step most beginners forget.
Sample answer: first check the standby has the same data, then promote it with pg_promote(), check it is no longer in recovery, point the app at it, and prove a new write works. Then rebuild the old main database from the new one — it cannot just rejoin.
Say where you did this: "I did this in the Phase 1 PostgreSQL lab on my own machine, with two containers." That one line turns a memorised answer into proof.
27. What does Patroni do, and why not just promote the replica by hand every time?
What the words mean
- Patroni is a watcher program. It watches the databases and promotes the standby by itself within seconds when the leader stops.
- The leader is the database currently taking writes. Patroni's job includes leader election: when the leader dies, the watchers agree on which standby becomes the new leader.
- By hand means a person typing the promote command. That is fine for learning, and fine once. It is not fine at 3 a.m. when nobody is awake.
- On-call means being the person who must wake up and fix things when they break at night. In real work, somebody is always on-call. Patroni exists so the on-call person is not woken for every failover.
Why they ask it
They want to know you understand when automatic beats manual: when the fix must happen in seconds, at any hour, without a human.
Sample answer: Patroni watches the databases and promotes the standby by itself within seconds, so nobody has to be awake at 3 a.m. to run the command. By hand is fine for learning; in real work, the automatic watcher is what keeps the system up while people sleep.
28. What is Redis used for, and why not put everything in it?
What the words mean
- Redis is a fast memory store. It keeps small answers in memory, so reads are very fast.
- A cache is a saved copy of an answer, kept close by so you do not have to compute it again. Example: instead of asking the database the same question 100 times, you save the answer once in Redis and read it from there.
- A counter is a number Redis adds to, like a count of orders.
- A short-lived code is a small value that deletes itself after a short time, like a login code that works for 60 seconds.
- "Memory is small and expensive" means the fast memory Redis uses costs far more per unit than disk storage, and there is less of it. So Redis holds small, short-lived things, not your whole history.
Why they ask it
They want to know you know Redis is for fast, small, short-lived data — and that the database is still the record book.
Sample answer: Redis keeps small answers in memory, so reads are very fast — caches, counters, short-lived codes. It is not the main record book: memory is small and expensive, and the real records belong in the database, where they are safe even when the power goes out.
29. What is an object store, and how is it different from a database?
What the words mean
- An object store keeps whole files by name — pictures, documents, uploads. You ask a store for a file by name.
- A database keeps rows in tables and answers questions about them. You ask a database for rows that match a question, like "all orders from today".
- An object is one file in the store, with a name.
Why they ask it
They want to know files go in the store and rows go in the database. Mixing them up is a common beginner mistake.
Sample answer: an object store keeps whole files by name — pictures, documents, uploads. A database keeps rows in tables and answers questions about them. You ask a store for a file by name; you ask a database for rows that match a question.
30. What does a load balancer do, and what happens when one backend dies?
What the words mean
- A load balancer stands in front of copies of your app and sends each visitor to a different copy, so no single copy gets all the work.
- A backend is one copy of your app behind the balancer. In the Phase 1 lab there are three backends. They live in the load balancer lab folder,
phase1/load-balancer-lab, and they are namedweb1,web2, andweb3. - "The site stays up" means visitors still get answers, because the balancer skips the dead copy and uses the ones still alive.
Why they ask it
They want to know you understand the two jobs: share traffic, and skip dead backends.
Sample answer: it stands in front of copies of your app and sends each visitor to a different copy, so no single copy gets all the work. If a copy dies, the balancer skips it and uses the ones still alive — the site stays up.
31. What is replication, in one line?
What the words mean
- Replication means keeping a second copy up to date by copying every change from the main one, so the copy is ready to take over.
- The main one is the primary (PostgreSQL) or the main store (Redis). The copy is the replica or standby.
Why they ask it
They want to know you can say it without jargon. One clean line proves you understand it.
Sample answer: keeping a second copy up to date by copying every change from the main one, so the copy is ready to take over.
No promises
Knowing these answers does not guarantee a job. Interviews also test communication, teamwork, and the employer's own needs. Use this pack to practise, not as a promise of any result.
Advanced questions
These questions are for the reader who did the Advanced sections in the labs. They test the production ideas — backups, durability, eviction, health checks, probes, remote state, and incidents — not the beginner steps. Each one follows this pack's format: what the words mean, why they ask it, and a sample answer. A note on question 30 first: its short answer — "if a copy dies, the balancer skips it" — is the beginner version. Question 35 below is the advanced follow-up to it. In an interview, give the short answer first, then add the correction ("with the default config...") to show depth. Never lead with the correction and never contradict your own short answer.
32. How do you back up PostgreSQL, and how do you prove the backup works?
What the words mean
- Logical backup (
pg_dump) copies one database as instructions. Physical backup (pg_basebackup) copies the database's actual files while it is running. - WAL archiving means saving every change-log file the moment the database finishes writing it, so you can restore to any moment — that is called point-in-time recovery.
- Proving a backup means restoring it somewhere harmless and checking the data — a backup you have never restored is a guess, not a backup.
Why they ask it
They want to know you understand replication is not a backup — a deleted table is copied to the standby in seconds — and that you check a restore instead of trusting a file exists.
Sample answer: replication protects against a dead machine, not against a mistaken delete — the delete is copied too. I take a logical backup with pg_dump, and a physical backup with pg_basebackup for the whole cluster, and I verify it with pg_verifybackup and by restoring it into a scratch database and comparing the row counts. A physical backup alone only restores to the moment it finished; restoring to any later moment needs WAL archiving.
33. A Kafka producer uses acks=all. What does that guarantee, and what is min.insync.replicas for?
What the words mean
acks=allmeans the producer waits until every in-sync replica has the message before it calls the write done.- In-sync replicas (ISR) are the copies currently caught up with the leader.
min.insync.replicasis the smallest number of in-sync copies that must say yes before anacks=allwrite succeeds.
Why they ask it
They want to know you understand durability is a combination — replication factor, acks, and min in-sync replicas together — not one setting.
Sample answer: acks=all means the leader waits for every in-sync replica before answering, so the message survives the leader dying. min.insync.replicas is the floor: with replication factor 3 and min.insync.replicas=2, one broker may die and writes still succeed, but if two die, writes stop rather than risk losing data. And acks=all on a replication-factor-1 topic buys nothing — there is only one copy.
34. Redis is out of memory. What happens, and how do you fix it?
What the words mean
maxmemoryis the most memory Redis may use. By default it is 0, which means no limit.- Eviction policy is the rule for which old keys to delete when the memory is full. The default is
noeviction: delete nothing, and fail new writes with an OOM error. evicted_keysis the count of keys Redis deleted to make room — the number to check when keys disappear.
Why they ask it
They want to know you have seen the default fail — no limit, no eviction — and that you set both together, policy first.
Sample answer: by default Redis has no memory limit and the policy is noeviction, so it grows until the machine kills it, or writes start failing with OOM errors. I set a limit below the machine's memory and a policy first — allkeys-lru for a pure cache — then the limit, and I check evicted_keys when keys disappear. A volatile policy only evicts keys with an expiry, so with no expiries it behaves like noeviction.
35. Your load balancer keeps sending traffic to a backend that returns 500s. Why?
What the words mean
- Passive health check means the balancer learns from real visitor requests only — it never asks a backend "are you alive?" on its own.
proxy_next_upstreamis the list of failures NGINX retries on the next backend. By default it is onlyerrorandtimeout— a failed connection or a wait that ran out. A 500 answer is not in the list.max_failsandfail_timeoutsay how many failures set a backend aside, and for how long. The defaults are 1 failure and 10 seconds.
Why they ask it
They want the correction to the beginner answer: the balancer does not "skip dead backends by itself" — a backend that answers with errors looks alive to it.
Sample answer: open-source NGINX only does passive checks, and by default a 500 is not a failure to it — the backend answered, so it stays in rotation. I add http_500 http_502 http_503 to proxy_next_upstream and tune max_fails and fail_timeout, and I test with nginx -t before reloading. Active health checks, where NGINX asks on its own schedule, are a paid NGINX Plus feature.
36. What is the difference between a readiness probe and a liveness probe?
What the words mean
- A readiness probe asks "are you ready to take traffic?" A pod that fails it is not sent traffic, but it is not restarted.
- A liveness probe asks "are you still alive?" A pod that fails it is restarted.
initialDelaySecondsis the wait after the container starts before the first check.periodSecondsis how often the check repeats.
Why they ask it
They want to know you have implemented probes, not just defined them — and that you know the two failure modes (a probe that is too strict, and a liveness probe that checks a dependency).
Sample answer: readiness gates traffic — the pod shows 0/1 until it passes, and the Service skips it. Liveness restarts a stuck pod. I set a short initial delay on readiness and a longer one on liveness so a slow start does not look like a dead app, and I probe the app itself, never its database — a liveness probe on a database restarts the pod in a loop whenever the database is slow.
37. Where does Terraform state live on a team, and why not on your laptop?
What the words mean
- State is Terraform's notebook: the map from your files to the real things, which can hold private values.
- A remote backend stores that notebook in a shared place — an S3 bucket, for example — instead of a file on one machine.
- Locking stops two applies running at once and corrupting the notebook.
Why they ask it
They want to know you understand state is shared, protected, and locked — and that local state on a laptop is a single point of failure with secrets in it.
Sample answer: on a team, state lives in a remote backend — an S3 bucket with versioning and encryption on, and locking on (use_lockfile), so two applies can never run at once. The bucket must exist before Terraform can use it. State can hold private values, so it never goes into a shared repository, and it is split by environment so one mistake cannot take down everything.
38. Production is down. What do you do first, and what do you write down?
What the words mean
- Severity grades how bad it is: S1 means everything is down or money or data is being lost; S4 is cosmetic.
- An incident timeline is the written record made while you work: start time, what users see, severity, checks, changes, recovery time, and what is still unknown.
- Rollback means undoing the last change to restore the working version.
Why they ask it
They want to hear process, not panic: grade first, write things down, restore service before root-causing.
Sample answer: first I grade it — who is hurt, is there a workaround, is money or data being lost — and I write the start time and what users see in one line. Then I check, fix the first error in the chain, and write down every check and every change with the time. If a deploy just went out, I roll back first and investigate second. Recovery is a number — error rate back to zero — not "it looks fine". Afterward, a blameless review: one fix to the system, not to a person.
What you can now say, truthfully — advanced
- "I can answer backup, durability, eviction, health-check, probe, remote-state, and incident questions from work I did in the Advanced sections — not from reading about them." (Only if you did the Advanced section each question points to. If you only read the question, say so: "I have read about it, I have not done it." That honesty is worth more than the answer.)
Quick check — try it yourself
Question: When interviewers ask questions about running software, what are they really testing?
Open the practice terminal to test this →
Show answer
They want to check whether you understand how systems work and fail, not whether you memorised syntax.