Intermediate Level
This section covers more advanced concepts in DevOps best practices, including configuration management, high availability, security, and microservices architecture.
How do you handle configuration management in DevOps?
Configuration management keeps servers and applications in a defined, auditable state:
- Declarative tools — Ansible (push model, agentless over SSH), Puppet and Chef (pull model with agents) define desired state, not steps
- Idempotency — running twice yields the same result; the tool only changes what drifted
- Drift detection — scheduled runs report or correct manual changes on managed hosts
The modern nuance to add: with containers and immutable infrastructure, much "configuration management" has moved into image building (Dockerfiles, Packer) — you configure the image once and replace instances instead of mutating them. Ansible-style config management remains the answer for long-lived hosts, network devices, and VM estates.
How do you ensure high availability in a cloud-based architecture?
HA is about removing single points of failure and designing for failure:
- Redundancy — multiple instances behind a load balancer, across availability zones (n+1 capacity minimum)
- Health checks + auto-healing — unhealthy instances are pulled out of rotation and replaced automatically
- Auto-scaling — handle load spikes and replace failed nodes
- Data layer — replicated databases with automated failover, multi-AZ by default
- Regions — multi-region (active-active or active-passive) for disaster tolerance, with defined RTO/RPO targets (how long to recover / how much data you can afford to lose)
Interview insight: availability is also a software property — graceful degradation and retries with backoff keep partial failures from cascading into full outages.
What is the difference between monolithic and microservices architectures?
- Monolith — one deployable unit; all functionality in a single codebase and process. Simple to develop, test, and operate early on; scales as a whole; one bad module can take everything down
- Microservices — many small services, each independently deployable, owning its data, communicating over the network. Independent scaling and deploys, team autonomy, blast-radius isolation — at the cost of distributed-systems complexity
The mature answer avoids religion: monoliths are often the right early choice, and the usual path is a modular monolith → extract services where independence genuinely pays (different scaling or release cadence). Distributed monoliths — microservices that must all deploy together — are the anti-pattern to name.
How do you monitor microservices effectively?
A single service's dashboard isn't enough when a request crosses ten services:
- The three pillars — metrics (Prometheus), logs (ELK/Loki), and distributed tracing (Jaeger, Tempo, X-Ray) to follow one request across service boundaries
- OpenTelemetry — vendor-neutral instrumentation standard; mention it as the modern default
- Methodology — RED (Rate, Errors, Duration) per service, USE (Utilization, Saturation, Errors) per resource
- Service mesh observability — Istio/Envoy give per-service traffic metrics without code changes
- SLO-based alerting — alert on user-facing symptoms, not every container restart
The key statement: correlation IDs + tracing turn "something is slow" into "checkout-service's call to inventory is timing out".
How do you secure a CI/CD pipeline?
The pipeline is production infrastructure — it has credentials and pushes to prod, making it a prime target:
- Least privilege — scoped, per-pipeline credentials; prefer short-lived tokens (OIDC federation to cloud roles) over stored static keys
- Secrets hygiene — secrets injected at runtime from a vault; masked in logs; never in logs or artifacts
- Supply-chain scanning — dependency (SCA: Snyk, Dependabot), static code (SAST), container image (Trivy), and IaC scans (Checkov, tfsec) as pipeline gates
- Artifact integrity — pin dependency versions and base images by digest, generate an SBOM, sign images (cosign/Sigstore)
- Runner isolation — ephemeral, single-use build runners; protect the main branch; require reviewed PRs
What are common DevOps anti-patterns?
Name each with its fix — that's what separates a list from an answer:
- Siloed teams ("devs throw it over the wall to ops") → shared ownership, embed ops knowledge in product teams, blameless culture
- Manual deployments → automate the pipeline; if deploys are scary, deploy more often in smaller pieces
- Snowflake servers → IaC + immutable infrastructure
- Big-bang releases → incremental rollouts, feature flags, canaries
- Monitoring as an afterthought → observability built in from day one, alert on symptoms
- "We'll add security later" → shift-left scanning and policy gates in CI
If asked for the root cause, say: most anti-patterns come from optimizing for change avoidance instead of fast, safe change.
How do you implement DevSecOps?
DevSecOps embeds security checks into the same pipeline developers already use, so security happens continuously instead of at an annual audit:
codeTypical tools: SonarQube (code quality/smells), Snyk or Dependabot (dependencies), Trivy/Grype (images), Checkov/tfsec (IaC), OWASP ZAP (dynamic testing). The cultural point matters as much as the tools: findings must be actionable and fast (minutes in PRs), severity-gated so builds aren't broken by noise, and security engineers enable developers rather than gatekeep them.
What is an SLA, and how does it relate to SLOs and SLIs?
The three form a chain — know all three and their order:
- SLI (indicator) — the measurement: the percentage of requests under 200 ms, as actually observed
- SLO (objective) — the internal target: "99.9% of requests under 200 ms over 30 days"
- SLA (agreement) — the external contract with customers, with consequences (credits, penalties) when breached — always slightly looser than the SLO
codeThe SRE insight to add: the gap between the SLO and 100% is the error budget — the amount of unreliability you may "spend" on risky releases and experiments. Exhaust the budget and feature work pauses in favor of reliability work.
How do you ensure compliance in DevOps?
Compliance-as-code: make the evidence a by-product of the pipeline instead of a manual audit scramble:
- Policy-as-code gates — OPA/Conftest or Checkov rules reject non-compliant IaC and configs in the PR
- Immutable audit trails — everything in Git (who changed what, approved by whom), centralized logs, pipeline run history
- Automated controls — encryption, access reviews, and patching enforced by tooling (AWS Config, Azure Policy), not spreadsheets
- Frameworks to name — SOC 2, ISO 27001, GDPR (data handling), PCI-DSS (payments), NIST; plus FedRAMP for US government cloud
The framing that lands: auditors don't ask "are you compliant?" — they ask "prove it". Pipelines that generate evidence continuously make that proof trivial.
What is a chaos engineering experiment?
Chaos engineering is the discipline of running controlled experiments that inject real-world failures to verify the system can withstand them — pioneered by Netflix with Chaos Monkey (randomly killing production instances).
The scientific structure is the interview answer:
- Define steady state — the metrics that mean "healthy" (success rate, latency)
- Form a hypothesis — "killing this pod won't break the checkout flow"
- Blast radius — start tiny: one instance, staging or a canary slice
- Run and observe — if the hypothesis fails, you found a real weakness before production did
- Automate and expand gradually (AWS FIS, Litmus, Gremlin, Pumba)
Chaos without a hypothesis and metrics isn't engineering — it's just breaking things. That sentence is worth saying verbatim.
How do you reduce deployment downtime?
Combine a zero-downtime strategy with migration discipline:
- Rolling updates — replace instances batch by batch behind health checks (Kubernetes default)
- Blue-green — switch environments atomically at the load balancer
- Canary — shift traffic gradually with metric-based promotion
- Graceful shutdown — readiness probes + connection draining so in-flight requests finish
- Schema discipline — backward-compatible database changes (add columns before writing to them) so old and new app versions can run simultaneously
The deeper answer: the goal isn't a heroic deployment trick, it's that deployments become so frequent and boring they stop being events.
How do you handle database migrations in CI/CD?
Schema changes are the riskiest part of CI/CD because the database is shared state with no instant rollback:
- Versioned migration tools — Flyway, Liquibase, Alembic, Django/Rails migrations: numbered, ordered, idempotent SQL checked into the repo, applied by the pipeline
- Expand/contract pattern — (1) expand: additive change compatible with old code (add column, backfill), (2) deploy code that uses it, (3) contract: remove the old column only after the old code is gone — several releases later
- Guardrails — test migrations against a production-size copy in staging, take a backup/snapshot first, use
--dry-runwhere available, and never couple a destructive schema change to an app deploy
The expand/contract naming is what distinguishes a real practitioner's answer.
What is an API gateway, and why is it used?
An API gateway is the single entry point in front of microservices, offloading cross-cutting concerns so services stay simple:
- Routing —
/orders/*→ orders service, without clients knowing internal topology - AuthN/AuthZ — validate JWTs/API keys once at the edge
- Rate limiting and quotas — protect backends from abuse and storms
- Resilience — timeouts, retries, circuit breaking in one place
- Observability — access logs and metrics for every API call
Tools: NGINX, AWS API Gateway, Kong, Envoy-based gateways. The trade-off to volunteer: the gateway can become a bottleneck and single point of failure — so it must be highly available, and hot paths may still call services directly (which is where a service mesh picks up).
- Routing —
How do you implement infrastructure testing?
Test IaC in layers, like application code:
- Static analysis — Checkov, tfsec, Terrascan: security misconfigurations (open security groups, unencrypted buckets) without deploying anything
- Lint and validate —
terraform validate,terraform planreview in the PR; policy-as-code (OPA/Sentinel) on the plan output - Integration tests — Terratest (Go) deploys real infrastructure in a test account, asserts it works, then destroys it
- Compliance testing — InSpec/Compliance profiles asserting the running state (ports closed, encryption on)
- Drift detection — scheduled
terraform planagainst production flags manual console changes
The punchline: "it worked in my sandbox" isn't infrastructure testing — automated verification at each layer is.
How do you manage multi-cloud deployments?
Multi-cloud (running on two or more providers) comes in two very different flavors — name the difference:
- Multi-cloud by workload — the pragmatic version: choose the best service per need (e.g., GCP for data/ML, AWS for compute), integrated via Kubernetes, Terraform, and standard networking
- Multi-cloud by portability — the aspirational version: one abstraction layer so workloads move freely — Kubernetes as the runtime, Terraform for provisioning, Vault for secrets, Istio for the mesh
Best practices: Kubernetes as the common substrate, everything as code with per-cloud provider modules, avoid the lowest-common-denominator trap (you lose each cloud's best services), and have a real reason — "avoid vendor lock-in" alone rarely justifies the operational cost.
What is the difference between SLI, SLO, and SLA?
- SLI (Service Level Indicator) — the carefully defined measurement: success rate, latency percentiles (p99), availability as observed by users (not by internal pings)
- SLO (Service Level Objective) — the internal target on an SLI over a window: "99.9% of requests succeed per 30 days". Choosing SLOs is a product decision: too high leaves no error budget, too low betrays users
- SLA (Service Level Agreement) — the business contract built on SLOs, with penalties (service credits) when breached — and therefore always more conservative than the SLO
Example chain: measured 99.95% success (SLI) → internal target 99.9% (SLO) → contractual 99.5% with credits (SLA). The SLO's remaining 0.1% is the error budget the team spends.
How do you manage dependencies in DevOps?
Dependencies are the most common supply-chain attack surface and a top source of "unexpected" production behavior:
- Pin everything — exact versions in
requirements.txt/package-lock.json, base images by digest; no floatinglatest - Private registries/proxies — Artifactory, Nexus, or GitHub Packages: build reproducibility, cached artifacts, and a buffer against upstream outages or malicious publishes
- Automated updates — Dependabot/Renovate raise PRs with changelogs and test runs, so updates are small and routine instead of a yearly crisis
- Continuous scanning — Snyk, Trivy, OWASP Dependency-Check in CI, failing builds on critical CVEs
- SBOM — generate per artifact (Syft) so you can answer "where do we use X?" in minutes — the Log4Shell question
- Pin everything — exact versions in
How do you handle rollback in a Kubernetes environment?
Kubernetes keeps previous ReplicaSet revisions precisely for this:
bashBest practices that make rollback actually work:
- Pin image tags by version/digest — never
latest, or "rollback" can redeploy the same broken image - Readiness probes — a bad version should fail its own rollout before rollback is ever needed (Kubernetes aborts automatically when pods never become ready)
- Know the limits —
rollout undoreverts the workload, not the database: schema changes must be backward-compatible (expand/contract) or rollback breaks data - Complement with GitOps: in Argo CD, rollback is
git revert+ sync, keeping the repo as the source of truth
- Pin image tags by version/digest — never
What are the best practices for writing Dockerfiles?
dockerfile- Multi-stage builds — compilers and dev dependencies never reach the final image (smaller, smaller attack surface)
- Layer ordering — copy dependency manifests before source so Docker caches the expensive layer
- No secrets in layers — they survive in image history; use runtime injection
- A
.dockerignore— keep.git, tests, and secrets out of the build context - Pin versions — base image tags (or digests) and tool versions for reproducible builds
What is FinOps in cloud computing?
FinOps brings financial accountability to cloud spend — a cross-functional practice (engineering + finance + product) with three phases: inform (visibility into who spends what), optimize (act on it), operate (continuous governance).
The levers engineers actually control:
- Rightsizing — match instance sizes to observed utilization (often 30–60% over-provisioned)
- Autoscaling and scheduling — scale down non-prod environments nights/weekends
- Spot/preemptible instances — for fault-tolerant, interruptible workloads (big discounts)
- Commitment discounts — reserved instances/savings plans for steady baselines
- Storage lifecycle — tier or expire old snapshots and logs
- Tagging and showback — cost per team/service makes spend someone's metric, not nobody's
The cultural line: FinOps makes engineers cost-aware the same way observability made them performance-aware.