PRACTICE TRACK / 108 QUESTIONS

Docker
Think it through.

Images, layers, networking, and container internals.

Choose a question, explain your approach, then reveal the supplied answer. Difficulty labels come from the existing question library.

108 questions

Answers stay closed until you choose to reveal them.

QUESTION 01DockerEasy

What is the difference between an image and a container?

#
Reveal answer guidance

An image is a read-only, layered template (the blueprint). A container is a running, writable instance created from an image — image + a thin writable layer + an isolated process namespace. You can run many containers from one image.

QUESTION 02DockerEasy

What is the difference between CMD and ENTRYPOINT?

#
Reveal answer guidance

ENTRYPOINT sets the fixed executable that always runs; CMD provides default arguments that are easily overridden at docker run. Best practice: ENTRYPOINT for the binary, CMD for default flags. If you give both in exec form, CMD's values are appended as args to ENTRYPOINT.

QUESTION 03DockerMedium

How does Docker layer caching work and how do you optimize a Dockerfile for it?

#
Reveal answer guidance

Each instruction creates a layer; Docker reuses cached layers until something changes — after which every later layer is rebuilt. So order from least- to most-frequently-changing: copy dependency manifests and install deps before copying source, so editing code doesn't invalidate the dependency layer. Combine related RUN commands, use .dockerignore, and prefer multi-stage builds to keep the final image small.

QUESTION 04DockerMedium

What is a multi-stage build and why use one?

#
Reveal answer guidance

A Dockerfile with multiple FROM stages: you build/compile in a heavy stage (with compilers, dev deps) and COPY only the resulting artifacts into a minimal final stage (e.g. distroless or alpine). Result: much smaller, more secure runtime images with no build toolchain or source left behind.

QUESTION 05DockerHard

How are containers isolated from each other and the host?

#
Reveal answer guidance

Mainly via Linux kernel features: namespaces give each container its own view of PIDs, network, mounts, users, IPC, and hostname; cgroups limit and account CPU/memory/IO; capabilities drop privileged kernel operations; and seccomp/AppArmor/SELinux restrict syscalls. Containers share the host kernel — that's why isolation is weaker than a VM and why you run as non-root and drop capabilities.

QUESTION 06DockerMedium

A Node.js application running in a Docker container crashes with exit code 137 after a few hours. Docker logs show no application errors. What is the most likely cause and how do you verify and fix it?

#
Reveal answer guidance

Exit code 137 = 128 + 9 (SIGKILL), meaning the kernel OOM-killed the container. Verify: docker inspect <container> --format '{{.State.OOMKilled}}' returns true; dmesg | grep -i oom shows the kill; docker stats <container> replay shows memory hitting the limit. Fix: increase --memory, set Node.js --max-old-space-size to leave GC headroom, check for memory leaks via heap snapshots (--inspect), or add --memory-reservation so Docker signals the app before the hard limit. Also verify swap: --memory-swap must be >= --memory or OOM kills happen sooner.

QUESTION 07DockerHard

Explain the full flow of how Docker's overlay2 driver handles image layers and copy-on-write. What happens when you run docker commit on a running container?

#
Reveal answer guidance

Overlay2 stacks layers: lowerdir (shared read-only image layers), upperdir (per-container writable layer), mergeddir (union via kernel overlayfs). Read: if file exists in upperdir return it, else search lowerdir top-to-bottom. Write (copy-up): modifying a file in lowerdir copies it to upperdir first, then modifies — expensive for large files. docker commit snapshots the upperdir into a new image layer: Docker tars the container's filesystem diff, compresses it, computes a sha256 digest, and creates a new layer stacked on the parent layers. The new layer is immutable. CoW performance trap: frequently writing to large files in base images causes repeated copy-up. Use volumes (bind mounts) for runtime data to bypass the CoW layer entirely.

QUESTION 08DockerHard

You have Docker Compose with 5 services including Redis. Redis needs a config change without downtime. Walk through the sequence, data persistence, and health-check strategy.

#
Reveal answer guidance

Docker Compose cannot natively do rolling updates on a single service. Strategy: (1) Deploy a redis-failover service with the new config alongside the old redis. (2) Update app configs (via env vars or config service) to point to redis-failover first. (3) Restart dependent services one at a time: docker compose up -d --no-deps web api worker. (4) Health checks: healthcheck: {test: ["CMD","redis-cli","ping"], interval:5s, retries:3, start_period:10s}. (5) Once all traffic routes to redis-failover, stop old redis: docker compose stop redis. (6) Rename redis-failover -> redis in compose file, docker compose up -d to align. For data persistence: run docker compose exec redis redis-cli SAVE before cutover to ensure the latest RDB is on a volume. The better long-term solution: use Redis Sentinel or a managed Redis (ElastiCache, Upstash) for real HA.

QUESTION 09DockerHard

Docker incident: Docker builds jumped from 4 minutes to 35 minutes after a small source change. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker build --progress=plain, docker history, BuildKit cache logs, and layer size inspection. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Order Dockerfile layers from stable to volatile, copy lockfiles before source, use BuildKit cache mounts for package managers, keep secrets in --secret mounts, and push only minimal runtime images.

QUESTION 10DockerHard

Docker architecture scenario: Your team needs fast, reproducible images for a monorepo with multiple services. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Order Dockerfile layers from stable to volatile, copy lockfiles before source, use BuildKit cache mounts for package managers, keep secrets in --secret mounts, and push only minimal runtime images.

QUESTION 11DockerMedium

Docker security scenario: Developers are copying secrets into images during build. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Order Dockerfile layers from stable to volatile, copy lockfiles before source, use BuildKit cache mounts for package managers, keep secrets in --secret mounts, and push only minimal runtime images.

QUESTION 12DockerHard

Docker release scenario: You need to move services to multi-stage builds without breaking runtime behavior. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Order Dockerfile layers from stable to volatile, copy lockfiles before source, use BuildKit cache mounts for package managers, keep secrets in --secret mounts, and push only minimal runtime images.

QUESTION 13DockerMedium

Docker reliability/cost scenario: CI minutes and registry storage costs are rising every sprint. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Order Dockerfile layers from stable to volatile, copy lockfiles before source, use BuildKit cache mounts for package managers, keep secrets in --secret mounts, and push only minimal runtime images.

QUESTION 14DockerHard

Docker incident: A container exits immediately in Kubernetes but works on a developer laptop. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker run --rm -it --entrypoint sh, docker inspect, container logs, and environment comparison. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use exec-form ENTRYPOINT, make required env explicit, run as a non-root UID, write only to declared writable paths, and test the exact production command in CI.

QUESTION 15DockerHard

Docker architecture scenario: You need one image that runs consistently across local Docker, CI, and production. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use exec-form ENTRYPOINT, make required env explicit, run as a non-root UID, write only to declared writable paths, and test the exact production command in CI.

QUESTION 16DockerMedium

Docker security scenario: The image runs as root and writes to unexpected filesystem paths. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use exec-form ENTRYPOINT, make required env explicit, run as a non-root UID, write only to declared writable paths, and test the exact production command in CI.

QUESTION 17DockerHard

Docker release scenario: You are changing the entrypoint and user for a production service. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use exec-form ENTRYPOINT, make required env explicit, run as a non-root UID, write only to declared writable paths, and test the exact production command in CI.

QUESTION 18DockerMedium

Docker reliability/cost scenario: Frequent crash loops are consuming on-call time. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use exec-form ENTRYPOINT, make required env explicit, run as a non-root UID, write only to declared writable paths, and test the exact production command in CI.

QUESTION 19DockerHard

Docker incident: A Node or Python service image is over 2 GB and cold starts are slow. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker image ls, docker history --no-trunc, dive, and vulnerability scan output. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use multi-stage builds, copy only runtime artifacts, remove package caches, choose slim or distroless bases deliberately, and keep a separate debug image instead of bloating production images.

QUESTION 20DockerHard

Docker architecture scenario: You need smaller images without losing debugging ability. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use multi-stage builds, copy only runtime artifacts, remove package caches, choose slim or distroless bases deliberately, and keep a separate debug image instead of bloating production images.

QUESTION 21DockerMedium

Docker security scenario: Build tools and package manager tokens remain in the final image. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use multi-stage builds, copy only runtime artifacts, remove package caches, choose slim or distroless bases deliberately, and keep a separate debug image instead of bloating production images.

QUESTION 22DockerHard

Docker release scenario: You need to replace base images across many services. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use multi-stage builds, copy only runtime artifacts, remove package caches, choose slim or distroless bases deliberately, and keep a separate debug image instead of bloating production images.

QUESTION 23DockerMedium

Docker reliability/cost scenario: Registry transfer, deploy time, and vulnerability scan noise are high. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use multi-stage builds, copy only runtime artifacts, remove package caches, choose slim or distroless bases deliberately, and keep a separate debug image instead of bloating production images.

QUESTION 24DockerHard

Docker incident: Two containers on the same host cannot connect even though exposed ports look correct. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker network inspect, docker port, ss -ltnp, container DNS checks, and curl from inside the network. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Distinguish container ports from published host ports, use user-defined networks for DNS, bind admin ports to localhost only, and avoid host networking unless there is a clear reason.

QUESTION 25DockerHard

Docker architecture scenario: You need predictable service-to-service networking for local integration tests. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Distinguish container ports from published host ports, use user-defined networks for DNS, bind admin ports to localhost only, and avoid host networking unless there is a clear reason.

QUESTION 26DockerMedium

Docker security scenario: A container exposes internal admin ports to the host network. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Distinguish container ports from published host ports, use user-defined networks for DNS, bind admin ports to localhost only, and avoid host networking unless there is a clear reason.

QUESTION 27DockerHard

Docker release scenario: You are moving from host networking to bridge or compose networks. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Distinguish container ports from published host ports, use user-defined networks for DNS, bind admin ports to localhost only, and avoid host networking unless there is a clear reason.

QUESTION 28DockerMedium

Docker reliability/cost scenario: Test flakiness is blocking releases. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Distinguish container ports from published host ports, use user-defined networks for DNS, bind admin ports to localhost only, and avoid host networking unless there is a clear reason.

QUESTION 29DockerHard

Docker incident: Data disappears after recreating a database container. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker volume ls, docker volume inspect, mount inspection, and filesystem ownership checks. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use named volumes for managed persistence, bind mounts only when host-path coupling is intentional, set correct UID/GID ownership, and prune unused volumes through controlled cleanup jobs.

QUESTION 30DockerHard

Docker architecture scenario: You need persistent local and staging state with clean teardown rules. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use named volumes for managed persistence, bind mounts only when host-path coupling is intentional, set correct UID/GID ownership, and prune unused volumes through controlled cleanup jobs.

QUESTION 31DockerMedium

Docker security scenario: Containers mount the host Docker socket or broad host paths. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use named volumes for managed persistence, bind mounts only when host-path coupling is intentional, set correct UID/GID ownership, and prune unused volumes through controlled cleanup jobs.

QUESTION 32DockerHard

Docker release scenario: You are replacing bind mounts with named volumes. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use named volumes for managed persistence, bind mounts only when host-path coupling is intentional, set correct UID/GID ownership, and prune unused volumes through controlled cleanup jobs.

QUESTION 33DockerMedium

Docker reliability/cost scenario: Disk usage on CI runners keeps growing. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use named volumes for managed persistence, bind mounts only when host-path coupling is intentional, set correct UID/GID ownership, and prune unused volumes through controlled cleanup jobs.

QUESTION 34DockerHard

Docker incident: Deploys fail with image pull errors only in production nodes. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker login, pull events, registry audit logs, node image pull errors, and credential helper config. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use short-lived tokens or workload identity where possible, scope pull permissions by repository, pre-warm critical images, and rotate credentials with overlapping validity.

QUESTION 35DockerHard

Docker architecture scenario: You need private registry access across CI, staging, and production. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use short-lived tokens or workload identity where possible, scope pull permissions by repository, pre-warm critical images, and rotate credentials with overlapping validity.

QUESTION 36DockerMedium

Docker security scenario: Long-lived registry credentials are stored in plain text. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use short-lived tokens or workload identity where possible, scope pull permissions by repository, pre-warm critical images, and rotate credentials with overlapping validity.

QUESTION 37DockerHard

Docker release scenario: You are rotating registry credentials without stopping deployments. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use short-lived tokens or workload identity where possible, scope pull permissions by repository, pre-warm critical images, and rotate credentials with overlapping validity.

QUESTION 38DockerMedium

Docker reliability/cost scenario: Image pulls are rate limited during autoscaling events. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use short-lived tokens or workload identity where possible, scope pull permissions by repository, pre-warm critical images, and rotate credentials with overlapping validity.

QUESTION 39DockerHard

Docker incident: A container is running but the application is unavailable. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker inspect --format, health status, app logs, and direct health endpoint calls. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Separate liveness from readiness, make health checks cheap and deterministic, hide sensitive output, and align Docker health checks with orchestrator probes.

QUESTION 40DockerHard

Docker architecture scenario: You need reliable health signals for orchestration. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Separate liveness from readiness, make health checks cheap and deterministic, hide sensitive output, and align Docker health checks with orchestrator probes.

QUESTION 41DockerMedium

Docker security scenario: Health endpoints expose sensitive dependency details. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Separate liveness from readiness, make health checks cheap and deterministic, hide sensitive output, and align Docker health checks with orchestrator probes.

QUESTION 42DockerHard

Docker release scenario: You are adding health checks to existing images. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Separate liveness from readiness, make health checks cheap and deterministic, hide sensitive output, and align Docker health checks with orchestrator probes.

QUESTION 43DockerMedium

Docker reliability/cost scenario: Bad containers stay in service and cause user-facing errors. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Separate liveness from readiness, make health checks cheap and deterministic, hide sensitive output, and align Docker health checks with orchestrator probes.

QUESTION 44DockerHard

Docker incident: A container is killed under load with exit code 137. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker stats, kernel OOM logs, cgroup metrics, and application heap profiles. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Set memory based on real peak plus headroom, tune runtime heap limits, avoid CPU throttling surprises, and alert on saturation before OOM kills happen.

QUESTION 45DockerHard

Docker architecture scenario: You need predictable CPU and memory behavior on shared hosts. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Set memory based on real peak plus headroom, tune runtime heap limits, avoid CPU throttling surprises, and alert on saturation before OOM kills happen.

QUESTION 46DockerMedium

Docker security scenario: No limits allow noisy containers to starve critical workloads. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Set memory based on real peak plus headroom, tune runtime heap limits, avoid CPU throttling surprises, and alert on saturation before OOM kills happen.

QUESTION 47DockerHard

Docker release scenario: You are introducing memory and CPU limits for existing services. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Set memory based on real peak plus headroom, tune runtime heap limits, avoid CPU throttling surprises, and alert on saturation before OOM kills happen.

QUESTION 48DockerMedium

Docker reliability/cost scenario: Host saturation causes multiple unrelated containers to degrade. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Set memory based on real peak plus headroom, tune runtime heap limits, avoid CPU throttling surprises, and alert on saturation before OOM kills happen.

QUESTION 49DockerHard

Docker incident: Container logs fill the host disk overnight. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker system df, log driver config, /var/lib/docker/containers, and log pipeline metrics. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use log rotation, ship logs centrally, redact secrets at the application layer, and alert on disk usage. Do not depend on unlimited local JSON logs.

QUESTION 50DockerHard

Docker architecture scenario: You need centralized logs with bounded local disk usage. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use log rotation, ship logs centrally, redact secrets at the application layer, and alert on disk usage. Do not depend on unlimited local JSON logs.

QUESTION 51DockerMedium

Docker security scenario: Logs include tokens, passwords, or personal data. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use log rotation, ship logs centrally, redact secrets at the application layer, and alert on disk usage. Do not depend on unlimited local JSON logs.

QUESTION 52DockerHard

Docker release scenario: You are changing Docker logging drivers and retention. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use log rotation, ship logs centrally, redact secrets at the application layer, and alert on disk usage. Do not depend on unlimited local JSON logs.

QUESTION 53DockerMedium

Docker reliability/cost scenario: Disk pressure causes containers to fail scheduling. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use log rotation, ship logs centrally, redact secrets at the application layer, and alert on disk usage. Do not depend on unlimited local JSON logs.

QUESTION 54DockerHard

Docker incident: A critical CVE appears in a base image used by many services. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: SBOM scan, image digest comparison, signature verification, and base image dependency graph. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Pin by digest for production, rebuild regularly, sign images, generate SBOMs, block critical vulnerabilities with expiry-based exceptions, and define owners for every base image.

QUESTION 55DockerHard

Docker architecture scenario: You need a repeatable image rebuild and promotion process. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Pin by digest for production, rebuild regularly, sign images, generate SBOMs, block critical vulnerabilities with expiry-based exceptions, and define owners for every base image.

QUESTION 56DockerMedium

Docker security scenario: Images are built from unpinned tags and cannot be reproduced. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Pin by digest for production, rebuild regularly, sign images, generate SBOMs, block critical vulnerabilities with expiry-based exceptions, and define owners for every base image.

QUESTION 57DockerHard

Docker release scenario: You are enforcing signed images and SBOM generation. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Pin by digest for production, rebuild regularly, sign images, generate SBOMs, block critical vulnerabilities with expiry-based exceptions, and define owners for every base image.

QUESTION 58DockerMedium

Docker reliability/cost scenario: Security exceptions are piling up because ownership is unclear. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Pin by digest for production, rebuild regularly, sign images, generate SBOMs, block critical vulnerabilities with expiry-based exceptions, and define owners for every base image.

QUESTION 59DockerHard

Docker incident: A Compose stack starts but the app fails because the database is not ready. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker compose ps, service health, app retry logs, and DNS checks between services. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use health checks plus application-level retries, keep service names stable, avoid hardcoded localhost between containers, and document reset commands.

QUESTION 60DockerHard

Docker architecture scenario: You need deterministic local environments for onboarding. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use health checks plus application-level retries, keep service names stable, avoid hardcoded localhost between containers, and document reset commands.

QUESTION 61DockerMedium

Docker security scenario: Default Compose networks expose services more broadly than intended. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use health checks plus application-level retries, keep service names stable, avoid hardcoded localhost between containers, and document reset commands.

QUESTION 62DockerHard

Docker release scenario: You are adding dependency health checks to Compose files. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use health checks plus application-level retries, keep service names stable, avoid hardcoded localhost between containers, and document reset commands.

QUESTION 63DockerMedium

Docker reliability/cost scenario: New engineers waste time debugging local startup order. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use health checks plus application-level retries, keep service names stable, avoid hardcoded localhost between containers, and document reset commands.

QUESTION 64DockerHard

Docker incident: Security requires rootless Docker but builds and mounts start failing. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: rootless Docker diagnostics, UID mapping checks, mount permission checks, and CI runner logs. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use rootless mode where compatible, avoid privileged Docker-in-Docker, prefer BuildKit/buildx or remote builders, and document volume permission constraints.

QUESTION 65DockerHard

Docker architecture scenario: You need safer local and CI container execution. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use rootless mode where compatible, avoid privileged Docker-in-Docker, prefer BuildKit/buildx or remote builders, and document volume permission constraints.

QUESTION 66DockerMedium

Docker security scenario: Privileged containers can mutate the host. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use rootless mode where compatible, avoid privileged Docker-in-Docker, prefer BuildKit/buildx or remote builders, and document volume permission constraints.

QUESTION 67DockerHard

Docker release scenario: You are moving CI runners away from privileged Docker-in-Docker. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use rootless mode where compatible, avoid privileged Docker-in-Docker, prefer BuildKit/buildx or remote builders, and document volume permission constraints.

QUESTION 68DockerMedium

Docker reliability/cost scenario: Security review blocks container platform adoption. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use rootless mode where compatible, avoid privileged Docker-in-Docker, prefer BuildKit/buildx or remote builders, and document volume permission constraints.

QUESTION 69DockerHard

Docker incident: Intermittent DNS failures occur only inside containers. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: cat /etc/resolv.conf inside the container, nslookup, Docker daemon DNS config, and host resolver logs. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use reliable upstream resolvers, avoid tiny DNS timeouts, keep search domains intentional, and make applications retry DNS failures with backoff.

QUESTION 70DockerHard

Docker architecture scenario: You need reliable name resolution in containerized workloads. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use reliable upstream resolvers, avoid tiny DNS timeouts, keep search domains intentional, and make applications retry DNS failures with backoff.

QUESTION 71DockerMedium

Docker security scenario: Containers bypass corporate DNS controls. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use reliable upstream resolvers, avoid tiny DNS timeouts, keep search domains intentional, and make applications retry DNS failures with backoff.

QUESTION 72DockerHard

Docker release scenario: You are changing DNS settings for Docker daemon or Compose. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use reliable upstream resolvers, avoid tiny DNS timeouts, keep search domains intentional, and make applications retry DNS failures with backoff.

QUESTION 73DockerMedium

Docker reliability/cost scenario: Transient DNS failures trigger retry storms. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use reliable upstream resolvers, avoid tiny DNS timeouts, keep search domains intentional, and make applications retry DNS failures with backoff.

QUESTION 74DockerHard

Docker incident: A non-root container cannot write to mounted directories in production. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: id, ls -ln, mount metadata, Dockerfile USER, and storage driver details. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Set a stable runtime UID, create writable directories at build time, align volume ownership, and fail CI if images run as root without an approved exception.

QUESTION 75DockerHard

Docker architecture scenario: You need non-root images that still work with persistent storage. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Set a stable runtime UID, create writable directories at build time, align volume ownership, and fail CI if images run as root without an approved exception.

QUESTION 76DockerMedium

Docker security scenario: Teams switch back to root to bypass permission errors. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Set a stable runtime UID, create writable directories at build time, align volume ownership, and fail CI if images run as root without an approved exception.

QUESTION 77DockerHard

Docker release scenario: You are standardizing UID/GID across images. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Set a stable runtime UID, create writable directories at build time, align volume ownership, and fail CI if images run as root without an approved exception.

QUESTION 78DockerMedium

Docker reliability/cost scenario: Permission issues slow every deployment. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Set a stable runtime UID, create writable directories at build time, align volume ownership, and fail CI if images run as root without an approved exception.

QUESTION 79DockerHard

Docker incident: Images work on amd64 but fail on arm64 nodes. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker buildx imagetools inspect, uname -m, binary architecture checks, and manifest list inspection. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Build and test per architecture, publish multi-arch manifests, avoid downloading architecture-specific binaries without checks, and run smoke tests on each target architecture.

QUESTION 80DockerHard

Docker architecture scenario: You need one release process for mixed architecture fleets. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Build and test per architecture, publish multi-arch manifests, avoid downloading architecture-specific binaries without checks, and run smoke tests on each target architecture.

QUESTION 81DockerMedium

Docker security scenario: Architecture-specific binaries are copied into generic images. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Build and test per architecture, publish multi-arch manifests, avoid downloading architecture-specific binaries without checks, and run smoke tests on each target architecture.

QUESTION 82DockerHard

Docker release scenario: You are adding buildx multi-platform builds. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Build and test per architecture, publish multi-arch manifests, avoid downloading architecture-specific binaries without checks, and run smoke tests on each target architecture.

QUESTION 83DockerMedium

Docker reliability/cost scenario: ARM migration savings are blocked by image incompatibility. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Build and test per architecture, publish multi-arch manifests, avoid downloading architecture-specific binaries without checks, and run smoke tests on each target architecture.

QUESTION 84DockerHard

Docker incident: The Docker host runs out of disk even after containers are removed. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker system df -v, image/container/volume lists, builder cache usage, and filesystem mount checks. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Separate build cache cleanup from runtime data cleanup, label protected volumes, set retention windows, and monitor Docker root filesystem usage.

QUESTION 85DockerHard

Docker architecture scenario: You need predictable cleanup without deleting active data. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Separate build cache cleanup from runtime data cleanup, label protected volumes, set retention windows, and monitor Docker root filesystem usage.

QUESTION 86DockerMedium

Docker security scenario: A cleanup job removes volumes still needed by stateful containers. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Separate build cache cleanup from runtime data cleanup, label protected volumes, set retention windows, and monitor Docker root filesystem usage.

QUESTION 87DockerHard

Docker release scenario: You are adding scheduled pruning on shared build hosts. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Separate build cache cleanup from runtime data cleanup, label protected volumes, set retention windows, and monitor Docker root filesystem usage.

QUESTION 88DockerMedium

Docker reliability/cost scenario: Build agents fail randomly due to disk pressure. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Separate build cache cleanup from runtime data cleanup, label protected volumes, set retention windows, and monitor Docker root filesystem usage.

QUESTION 89DockerHard

Docker incident: A CI job mounting /var/run/docker.sock can control unrelated host containers. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: CI config review, socket mount search, runner permissions, and audit logs. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use isolated builders, rootless build tools, remote BuildKit, or per-job ephemeral runners. Treat Docker socket access as privileged and require explicit approval.

QUESTION 90DockerHard

Docker architecture scenario: You need container builds without broad host control. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use isolated builders, rootless build tools, remote BuildKit, or per-job ephemeral runners. Treat Docker socket access as privileged and require explicit approval.

QUESTION 91DockerMedium

Docker security scenario: Docker socket access is effectively root on the host. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use isolated builders, rootless build tools, remote BuildKit, or per-job ephemeral runners. Treat Docker socket access as privileged and require explicit approval.

QUESTION 92DockerHard

Docker release scenario: You are replacing socket mounts in CI pipelines. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use isolated builders, rootless build tools, remote BuildKit, or per-job ephemeral runners. Treat Docker socket access as privileged and require explicit approval.

QUESTION 93DockerMedium

Docker reliability/cost scenario: Compliance requires stronger isolation for build jobs. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use isolated builders, rootless build tools, remote BuildKit, or per-job ephemeral runners. Treat Docker socket access as privileged and require explicit approval.

QUESTION 94DockerHard

Docker incident: The same image behaves differently between staging and production. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker inspect, environment diff, image digest comparison, and config source review. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Build once and promote by digest, inject environment config at runtime, keep secrets outside the image, and make startup validate required config.

QUESTION 95DockerHard

Docker architecture scenario: You need immutable images with environment-specific runtime config. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Build once and promote by digest, inject environment config at runtime, keep secrets outside the image, and make startup validate required config.

QUESTION 96DockerMedium

Docker security scenario: Secrets and config are baked into images. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Build once and promote by digest, inject environment config at runtime, keep secrets outside the image, and make startup validate required config.

QUESTION 97DockerHard

Docker release scenario: You are removing environment-specific image builds. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Build once and promote by digest, inject environment config at runtime, keep secrets outside the image, and make startup validate required config.

QUESTION 98DockerMedium

Docker reliability/cost scenario: Promotions are slow because every environment rebuilds artifacts. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Build once and promote by digest, inject environment config at runtime, keep secrets outside the image, and make startup validate required config.

QUESTION 99DockerHard

Docker incident: Requests fail during container termination. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: docker stop timing, signal handling tests, app logs, and load balancer drain metrics. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use exec-form entrypoints, handle SIGTERM, stop accepting new work before exit, configure grace periods, and test termination behavior under load.

QUESTION 100DockerHard

Docker architecture scenario: You need zero-loss rolling restarts. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use exec-form entrypoints, handle SIGTERM, stop accepting new work before exit, configure grace periods, and test termination behavior under load.

QUESTION 101DockerMedium

Docker security scenario: PID 1 does not forward signals to the application. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use exec-form entrypoints, handle SIGTERM, stop accepting new work before exit, configure grace periods, and test termination behavior under load.

QUESTION 102DockerHard

Docker release scenario: You are changing base images and init behavior. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use exec-form entrypoints, handle SIGTERM, stop accepting new work before exit, configure grace periods, and test termination behavior under load.

QUESTION 103DockerMedium

Docker reliability/cost scenario: Deployments cause short but visible error spikes. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use exec-form entrypoints, handle SIGTERM, stop accepting new work before exit, configure grace periods, and test termination behavior under load.

QUESTION 104DockerHard

Docker incident: A minimal production image lacks shell tools during an incident. How do you investigate, recover service, and prevent the same failure?

#
Reveal answer guidance

Start by proving scope and recent change: container logs, /proc inspection from host or sidecar, debug image attach, and orchestrator debug features. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Keep production images minimal, maintain a matching debug image, rely on structured logs and metrics, and use controlled debug workflows instead of shipping shells everywhere.

QUESTION 105DockerHard

Docker architecture scenario: You need debuggability without increasing production attack surface. What design would you choose, and what tradeoffs would you call out in an interview?

#
Reveal answer guidance

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Keep production images minimal, maintain a matching debug image, rely on structured logs and metrics, and use controlled debug workflows instead of shipping shells everywhere.

QUESTION 106DockerMedium

Docker security scenario: Debug tools introduce extra CVEs and shell access. How do you harden it without breaking production?

#
Reveal answer guidance

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Keep production images minimal, maintain a matching debug image, rely on structured logs and metrics, and use controlled debug workflows instead of shipping shells everywhere.

QUESTION 107DockerHard

Docker release scenario: You are moving to distroless or scratch images. How do you ship the change safely?

#
Reveal answer guidance

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Keep production images minimal, maintain a matching debug image, rely on structured logs and metrics, and use controlled debug workflows instead of shipping shells everywhere.

QUESTION 108DockerMedium

Docker reliability/cost scenario: Incidents take longer because engineers cannot inspect runtime state. What signals do you inspect and what changes do you make?

#
Reveal answer guidance

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Keep production images minimal, maintain a matching debug image, rely on structured logs and metrics, and use controlled debug workflows instead of shipping shells everywhere.

CONTINUE PRACTICING

Try another perspective.