DevOps Interview Prep
Prepare clear, evidence-led answers for Linux, containers, CI/CD, Terraform, Kubernetes, cloud, SRE, troubleshooting, and incident scenarios.
Explain the Request Path Before Guessing at a Fix
Strong DevOps answers start with what the user sees, what the system is expected to do, and where evidence can be collected. Avoid reciting commands without explaining the question each command answers. These model answers are frameworks: adapt them to tools you have actually used and state clearly when a detail depends on the environment.
| Answer step | What to explain |
|---|---|
| Scope | Name the user impact, service, and time window. |
| Evidence | Explain what a signal or command tests. |
| Decision | Describe a safe next action and how you will verify it. |
1. A service is slow. How do you begin investigating on Linux?
I confirm the affected journey, scope, start time, and recent changes. Then I compare host pressure, service logs, and request or dependency latency with a healthy instance. I change one thing at a time and preserve evidence before restarting unless an approved mitigation is needed.
What interviewers look for:
- A user-impact-first approach instead of blindly running commands.
- A structured sequence that distinguishes symptoms from causes.
- Safe handling of evidence and awareness that a restart can erase context.
2. A domain name resolves but the application is unreachable. What layers do you check?
I verify the resolved address, then test the client path through firewall rules, load balancer, TLS, proxy, and service. I inspect the response and certificate, compare a known-good path, and review recent changes before altering DNS.
What interviewers look for:
- A layered model from name resolution through application response.
- Use of client-side evidence and comparison across paths.
- Care with DNS propagation and potentially disruptive changes.
Describe What the Image Actually Contains
3. What is the difference between an image and a container?
An image is a packaged, mostly immutable template of filesystem layers and configuration. A container is a running process created from an image with runtime isolation and configuration. Container layers can be shared, while writable runtime data is ephemeral unless deliberately mounted or persisted. An image is not a virtual machine: it shares the host kernel and needs appropriate isolation and resource controls.
What interviewers look for:
- Correct distinction between artifact and running process.
- Awareness of image layers, ephemeral files, and host-kernel sharing.
- A reminder that containers do not automatically provide security.
4. How would you make a container image safer and smaller?
I start from a suitable maintained base, copy only required application files, avoid build tools in the runtime image when a multi-stage build is appropriate, run as a non-root user, and keep secrets out of layers and build arguments. I scan the result, update dependencies through a reviewed process, and test the actual image. Image size is one concern; provenance, patchability, reproducibility, and a clear runtime contract matter too.
FROM python:3-slim
WORKDIR /app
COPY app.py ./app.py
ENV PORT=8080
USER 10001
CMD ["python", "app.py"]What interviewers look for:
- Least privilege and an explanation of what is copied into the image.
- No claim that a small image is automatically a secure image.
- A practical testing and patching approach.
Separate Repeatable Checks from Approval
5. What should a CI pipeline do for a pull request?
It should provide fast, repeatable evidence such as linting, tests, static checks, and an image build. A release stage can publish a versioned artifact after review, while deployment to a sensitive environment uses protected identity and approval controls. I keep permissions scoped to each job, avoid exposing secrets to untrusted code, and make failures clear enough that developers can reproduce them locally.
What interviewers look for:
- A clear distinction among verification, artifact publishing, and deployment.
- Least privilege and protection against secret exposure.
- Actionable logs, deterministic artifacts, and branch protection.
6. How do you handle a Terraform plan that proposes an unexpected replacement?
I do not apply it until I understand the cause. I confirm the workspace, account, provider configuration, state, and exact resource attributes that changed. I check whether the provider marks the changed field as replacement-only, whether configuration or remote infrastructure drifted, and whether another operation changed state. Then I discuss the intended behavior, refresh or import only through a reviewed recovery path if needed, and produce a fresh plan. State surgery is a last-resort, documented operation, not a way to make a plan look green.
terraform fmt -check -recursive
terraform validate
terraform plan -out=reviewed.tfplan
terraform show reviewed.tfplan
# Stop and investigate any unexpected replacement or deletion.What interviewers look for:
- Understanding that Terraform state maps configuration to real resources.
- Plan review, identity verification, and caution around state recovery.
- No blind apply or manual state editing to silence a diff.
Debug the Workload, Not Just the Cluster
7. A pod is Pending. What do you inspect?
I inspect pod events and scheduling conditions first. Common causes include insufficient requested resources, node selectors or affinity with no matching node, taints without tolerations, storage claims that are not bound, or quota constraints. I compare requested resources with node capacity and recent cluster changes. I do not lower requests or remove scheduling rules until I understand why they were set and what capacity or isolation the workload needs.
What interviewers look for:
- Use of events and scheduling evidence rather than guesswork.
- Understanding requests, capacity, constraints, storage, and quotas.
- Safe changes that preserve workload guarantees.
8. A pod is Running but users receive errors. Why?
Running means the container process exists; it does not mean the application is ready or the user path works. I check readiness, service selectors and endpoints, port mappings, ingress or gateway routing, network policies, application logs, and dependency health. I test from inside and outside the cluster using an approved path and compare the actual response with the expected one. A misleading probe can keep a broken pod in service or restart a healthy one.
kubectl get pods -l app=learning-api
kubectl describe pods -l app=learning-api
kubectl get endpoints learning-apiWhat interviewers look for:
- Understanding of pod state versus application health and service routing.
- A layered check from the container to the client.
- Awareness of probe semantics and failure consequences.
Tie Metrics to User Impact
9. When would you use metrics, logs, or traces?
Metrics summarize trends and are useful for alerting and capacity views; logs capture individual events and context; traces connect spans across a request path. I might use an error-rate metric to detect a broad issue, a trace to find which dependency added latency, and a structured log to understand the specific failure. I control label cardinality, retention, access, and redaction because telemetry can expose sensitive data and grow costly.
What interviewers look for:
- Choosing a signal based on the question rather than tool preference.
- Connections among metrics, logs, and traces.
- Privacy, cost, cardinality, and retention awareness.
10. What makes a useful SLI and SLO?
The SLI measures an important user outcome with a defined event population, numerator, denominator, and window. The SLO is the team's agreed target for that indicator over that window. I document exclusions and telemetry gaps, choose a target with product and engineering based on user expectations and evidence, and review it when service behavior changes. I keep internal objectives distinct from external SLA commitments.
What interviewers look for:
- A measurable user journey, not just a host metric.
- Clear window, population, and treatment of exclusions.
- Distinction between SLO, SLA, and error budget.
11. How do you design an alert that does not cause fatigue?
I page when a human needs to act promptly because users are affected or a meaningful objective is burning quickly. The alert should state the symptom, affected service or journey, duration and scope, owner, and first safe diagnostic step. Lower urgency capacity trends can create tickets. I review noisy alerts after incidents and test the runbook rather than adding pages for every metric fluctuation.
What interviewers look for:
- User impact and urgency as the basis for paging.
- An owner, useful context, and actionable next step.
- A feedback loop for tuning alerts and runbooks.
Narrate a Safe Incident Response
12. A release causes a rise in server errors. What do you do?
I acknowledge the alert, confirm the affected journeys and scope, and compare the timing with the release. I open a shared incident channel, assign an incident lead if needed, and preserve a short timeline. If evidence points to the change and rollback is safe, I mitigate using the approved release path, then verify the error ratio and representative user journey. I communicate confirmed impact and the next update time, and investigate root causes after users are protected.
What interviewers look for:
- Mitigation and coordination before an unbounded investigation.
- Evidence-based rollback decision and verification.
- Clear updates, timeline, and awareness of rollback risk.
13. A database dependency is timing out. How do you reduce impact?
I verify whether the timeouts are broad or isolated and check database health, connection pool saturation, query latency, and the application's retry behavior. I look for a recent query, traffic, or configuration change. To limit cascading failure, I use the service's established timeout, concurrency, circuit-breaker, queueing, or degraded-mode controls rather than adding unbounded retries. Any mitigation should preserve data correctness and avoid duplicate writes; I coordinate with the database owner and keep the user impact visible.
What interviewers look for:
- Recognition of saturation and cascading failures.
- Careful retry and idempotency reasoning.
- Coordination across service ownership boundaries.
Show How You Learn and Work with Others
14. Tell me about an operational mistake or incident you learned from.
I use a concise situation, action, and result structure. I explain the system conditions and what evidence I had, describe the decision I made and how I communicated it, then share the user impact and concrete follow-up. I take responsibility for my actions without turning the answer into blame. If I have not handled a production incident, I say so and describe a relevant drill or project honestly rather than inventing experience.
What interviewers look for:
- Honesty and a specific example with context.
- Ownership, communication, and learning without blaming others.
- Evidence that follow-up changed a guardrail, test, or runbook.
15. How do you respond when a runbook is missing or outdated?
During the incident, I use known safe checks, consult the service owner, and record observations rather than guessing at destructive commands. I identify the next escalation contact and communicate uncertainty. Afterward, I update the runbook with tested steps, expected results, permissions, rollback boundaries, and a review owner. I ask another responder to follow it in a drill so the documentation is validated by someone other than its author.
What interviewers look for:
- Safe escalation when documentation is incomplete.
- Clear distinction between known facts and hypotheses.
- A tested documentation improvement with ownership.
Turn the Questions into Your Own Evidence
Reciting a memorized command sequence
Why: The answer does not show how the command reduces uncertainty.
Fix: State the question, evidence, interpretation, and next safe step for each check.
Claiming production experience you do not have
Why: An interviewer may ask for details and trust is lost.
Fix: Separate hands-on lab work from production ownership and explain what you learned.
Jumping to restart or rollback before assessing impact
Why: Evidence may disappear and the action may worsen a data or dependency issue.
Fix: Check the runbook, scope, recent changes, and rollback safety; mitigate deliberately.
Calling a pod healthy because it is Running
Why: Process state is confused with readiness and user-visible behavior.
Fix: Check probes, endpoints, application response, and the user journey.
Practice
Build concise, evidence-based interview answers
- Choose five questions and answer each aloud in under two minutes using one real lab, project, or work example.
- For one troubleshooting scenario, write the first three read-only checks and explain what each result would mean.
- Draw the path from DNS to a containerized service and label where TLS, routing, health checks, and logs are observed.
- Prepare an honest story about a mistake, the impact, your communication, and one verified follow-up improvement.
- Ask a peer to challenge one assumption in each answer; update your explanation without overstating certainty.
Hint: A strong answer does not need every tool name. Make the sequence, evidence, risk, and decision clear, and say when an assumption depends on the environment.
Before an interview, review the target organization's public engineering context and the job description. Do not disclose confidential architecture or customer data from a previous employer. Use generic diagrams and anonymized examples, and be prepared to discuss trade-offs rather than claim one tool is right for every team.
🎯 Key Takeaways
- ✓Start troubleshooting from user impact and gather evidence before changing the system.
- ✓Explain the distinction between an image and a running container, and discuss least privilege and reproducible builds.
- ✓Separate CI checks, artifact promotion, infrastructure review, deployment approval, and verification.
- ✓For Kubernetes, use events, probes, service routing, and application behavior to locate the failing layer.
- ✓Choose observability signals and alerts that answer a clear operational question and protect sensitive data.
- ✓Describe incident mitigation, communication, rollback limits, and learning with honest ownership.
Next course
What comes next
Continue into machine learning foundations and its MLOps section to connect infrastructure practices with data pipelines, model serving, and ML lifecycle operations.
Next course · AI & Machine Learning →HELP US IMPROVE
How was this lesson?
Your note is shared with the Chaduvuko team for review. Please don’t include personal or sensitive information.
Spotted a mistake or something unclear? Suggest a fix on GitHub or email us. Select the text first and it is quoted for you.
Discussion
0Have a better approach? Found something outdated? Share it — your knowledge helps everyone learning here.
