Top 30 Intermediate Docker & Kubernetes Concepts Quiz
30 intermediate multiple-choice Docker & Kubernetes concept questions, the mechanics underneath the basics: how the pieces relate and where the usual mental model stops holding. They come from 30 bites in the Docker & Kubernetes library, the middle slice of the 148 Docker & Kubernetes concept questions in the library. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.
Containers, Helm, orchestration, service mesh
30 questions. Pick an answer, or open “Show the answer” to read it.
Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.
Question 1 of 30
Which statement accurately describes a key characteristic of Linux namespaces?
Show the answer
Answer: c · They enable processes to have isolated views of system resources while sharing the host's single kernel.
Linux namespaces provide isolated environments for resources like process IDs and network interfaces, but they all share the host's single kernel. This is a fundamental difference from virtual machines, which run their own independent kernels. The card explicitly states that namespaces are not a sole security boundary for untrusted code.
Read the full bite: Linux Namespaces: A Virtual Slice of the OS
Question 2 of 30
What is the primary problem that Linux cgroups were designed to solve in a multi-tenant server environment?
Show the answer
Answer: c · Preventing a single application from consuming all available CPU or memory, thus starving other processes.
The card explicitly states that cgroups were introduced because 'a single runaway process could consume all available CPU or memory, starving every other process and crashing the system.' While cgroups are related to container isolation, their primary role is resource limiting, not network traffic isolation or secure communication.
Read the full bite: Linux cgroups: Resource Fences for Processes
Question 3 of 30
Which component in a Kubernetes node is directly responsible for pulling container images and setting up their isolated execution environment?
Show the answer
Answer: a · The container runtime, which executes containers based on instructions from the kubelet
The container runtime is the low-level engine that directly pulls images and creates isolated container environments using features like namespaces and cgroups. The kubelet acts as a 'transmission,' translating Kubernetes commands into instructions for the runtime, but does not perform the execution itself.
Read the full bite: Container Runtime: The Engine That Runs Your Containers
Question 4 of 30
A team avoids public Docker images in their non-Docker runtime, believing the format is proprietary to Docker. Which statement corrects this misunderstanding?
Show the answer
Answer: a · Docker images are OCI-compliant bundles that run on any compliant runtime without conversion.
The card calls this belief a footgun, emphasizing that Docker images are OCI-compliant bundles executable by any compliant runtime, much like USB-C devices work with any compliant charger. Option C invents a translation step that the standard eliminates, and option B confuses interface compatibility with performance guarantees.
Question 5 of 30
What fundamental problem are Docker Volumes primarily designed to solve?
Show the answer
Answer: a · The loss of data written inside a container's filesystem when the container is removed.
Docker Volumes exist because data written directly into a container's filesystem is lost when the container is removed, which is problematic for stateful applications. Option D describes the ephemeral nature of containers, which is the problem volumes counteract, not what they provide.
Read the full bite: Docker Volumes: Persistent Data for Ephemeral Containers
Question 6 of 30
For multi-service applications on a single host, why are user-defined bridge networks preferred over the default bridge network?
Show the answer
Answer: b · They provide an internal DNS service for containers to resolve each other by name.
The card explicitly states that user-defined bridge networks are superior because they provide an internal DNS service, allowing containers to find each other by name, which is essential for multi-service applications. The default bridge network lacks this feature, making it brittle due to changing IP addresses.
Read the full bite: Docker Networking: How Containers Talk to Each Other
Question 7 of 30
To maximize Docker build cache efficiency, how should Dockerfile instructions be ordered?
Show the answer
Answer: c · Arrange instructions from least frequently changing to most frequently changing, top to bottom.
The card advises placing infrequently changing instructions at the top and frequently changing ones as late as possible to optimize cache. Placing frequently changing instructions early, as in option D, is identified as a 'footgun' that invalidates the cache for subsequent steps unnecessarily.
Read the full bite: Docker Build Cache: Don't Rebuild What Hasn't Changed
Question 8 of 30
What is the primary function of a .dockerignore file in a Docker project?
Show the answer
Answer: d · To prevent specific files from being included in the build context sent to the Docker daemon.
The .dockerignore file's main role is to instruct the Docker client to omit specified files and directories from the build context before it's archived and sent to the daemon. While this can lead to smaller final images (C) if those files would have been copied, its direct and primary function is to filter the build context itself, improving build speed and security.
Read the full bite: The .dockerignore File: Keep Your Build Context Lean
Question 9 of 30
In a Docker Compose application, how should one service (e.g., 'web') typically refer to another service (e.g., 'database') to establish a connection?
Show the answer
Answer: d · By using the service name 'database' as the hostname.
Docker Compose creates a private network with a built-in DNS service, allowing services to communicate by using their defined service names as hostnames. The card explicitly states that using 'localhost' is a footgun, as it refers to the container itself, not other services.
Read the full bite: Docker Compose Networking: How Services Talk to Each Other
Question 10 of 30
What type of configuration is generally NOT recommended to be managed directly via environment variables in docker-compose.yml or .env files for production deployments?
Show the answer
Answer: d · Sensitive production credentials, such as private API keys or database passwords.
The card explicitly advises against storing sensitive production secrets directly in docker-compose.yml or .env files for production, recommending dedicated secrets management tools instead. The other options describe valid and recommended uses for environment variables in Docker Compose.
Question 11 of 30
A developer uses depends_on to ensure a web app starts after its database. What problem might still occur?
Show the answer
Answer: a · The web app might attempt to connect to the database before it's ready to accept connections.
The card states that depends_on only waits for the container to start, not for the application inside to be ready. Therefore, the web app could try to connect before the database is fully initialized. For true readiness, a healthcheck with condition: service_healthy is needed, which is not guaranteed by depends_on alone.
Read the full bite: Docker Compose: Control Startup with `depends_on`
Question 12 of 30
To ensure a Docker Compose service's image is rebuilt from its Dockerfile after changes, which command is necessary?
Show the answer
Answer: d · docker-compose up --build
The `docker-compose up --build` command explicitly instructs Compose to rebuild images defined with a `build:` key. Running `docker-compose up` without `--build` will use existing images, even if the Dockerfile has been modified, which is a common 'footgun'.
Question 13 of 30
What is a key advantage of using Amazon EC2 for deploying applications, especially concerning resource management?
Show the answer
Answer: c · It allows dynamic scaling of computing resources to match fluctuating demand.
The card emphasizes EC2's ability to "add or remove server instances to match demand" for "fluctuating computing needs," which is dynamic scaling. EC2 operates on a pay-per-use model, meaning costs are variable rather than fixed upfront.
Read the full bite: Amazon EC2: Rentable Virtual Servers on AWS
Question 14 of 30
What is the primary advantage of configuring a Virtual repository in Google Cloud's Artifact Registry?
Show the answer
Answer: d · It provides a unified endpoint for accessing artifacts from multiple underlying repositories.
A Virtual repository's main benefit is to group multiple standard and remote repositories behind a single endpoint, simplifying artifact access for developers. Option B describes a Remote repository, which is a component that a Virtual repository can group, but not the primary advantage of the Virtual repository itself.
Read the full bite: Artifact Registry: Google's Universal Package Manager
Question 15 of 30
Why is using an image digest crucial for production deployments, especially compared to using a mutable tag?
Show the answer
Answer: b · Digests guarantee that the exact, tested version of an image is deployed, preventing unintended updates.
Digests provide an immutable reference, ensuring that the specific, tested version of an image is consistently deployed, which is vital for reproducibility and stability in production. Option D is incorrect because digests prevent automatic updates; they pin an image to a specific, unchanging version, which is the opposite of automatically pulling the 'most recent' version.
Read the full bite: Image Digest: The Immutable Image Identifier
Question 16 of 30
A company's CI/CD system frequently pulls public Docker images, leading to slow builds and rate limit issues. Which statement accurately describes the role of a Docker Registry Mirror in this scenario?
Show the answer
Answer: b · It acts as a read-only cache for public images, speeding up subsequent pulls and avoiding rate limits.
A Docker Registry Mirror is specifically designed as a read-only pull-through cache for public images, which speeds up subsequent pulls and helps avoid rate limits, as stated in the card. Option C describes the function of a full-fledged private registry, not a mirror, which cannot host private images.
Read the full bite: Docker Registry Mirror: A Local Cache for Faster Pulls
Question 17 of 30
How do Kubernetes components, such as the scheduler or controller manager, typically interact with the cluster's state stored in etcd?
Show the answer
Answer: d · They communicate with the Kubernetes API server, which acts as the sole intermediary for all etcd operations.
The card explicitly states that the Kubernetes API server is the primary client for etcd, mediating all reads and writes. Other components interact with the cluster state by communicating with the API server, not by directly accessing etcd, which ensures validation and consistency.
Read the full bite: etcd: Kubernetes's Single Source of Truth
Question 18 of 30
How does the Kubelet primarily receive instructions for managing Pods on its assigned node?
Show the answer
Answer: b · By continuously watching the Kubernetes API server for Pod assignments.
The Kubelet's core function involves continuously watching the API server for Pods scheduled to its node. It does not directly read local files, receive commands from kubectl, or query etcd; these interactions are mediated by the API server.
Question 19 of 30
A web application is running but temporarily loses its connection to the backend database. To prevent new requests from being routed to this unhealthy instance without restarting it, which Kubernetes probe should be configured to fail?
Show the answer
Answer: c · The Readiness probe, to temporarily remove the pod from service endpoints.
The Readiness probe is designed to stop sending traffic to a pod when it's not ready to serve requests, such as when a database connection is lost, without restarting the container. A Liveness probe failure would cause an unnecessary restart, as the application itself is still running and capable of recovery once again connecting to the database.
Read the full bite: Kubernetes Probes: Liveness, Readiness, and Startup
Question 20 of 30
Which statement accurately describes the execution behavior of Init Containers in a Kubernetes Pod?
Show the answer
Answer: b · They execute in a defined sequence, and each must complete successfully before the next or the main application starts.
Init containers are designed to run sequentially and must complete successfully before the main application containers are started, acting as a pre-flight checklist. Options A and C describe sidecar containers, which run alongside the main application for ongoing tasks, while option A incorrectly states they run after the main application.
Read the full bite: Init Containers: Setup Tasks Before Your Main App Runs
Question 21 of 30
To prevent a Kubernetes CronJob from initiating a new task while a previous instance is still running, which configuration is most critical?
Show the answer
Answer: b · Configuring the concurrencyPolicy to define how overlapping job executions are managed.
The card highlights concurrency as a 'footgun' and explicitly mentions that setting the 'concurrencyPolicy' to 'Forbid' is a 'critical configuration' to prevent new tasks from starting if a previous one is still running. While a well-chosen schedule is beneficial, the 'concurrencyPolicy' directly controls the CronJob's behavior regarding overlapping executions, unlike 'activeDeadlineSeconds' which only terminates individual pods within a job.
Read the full bite: Kubernetes CronJob: Scheduled Tasks in Your Cluster
Question 22 of 30
What is the primary advantage of using Kubernetes Ingress for exposing multiple services compared to using a separate Service of type LoadBalancer for each?
Show the answer
Answer: d · It consolidates external HTTP/S traffic routing for multiple services through a single entry point, reducing infrastructure costs and management overhead.
Ingress's core purpose is to consolidate external HTTP/S traffic routing for multiple services through a single entry point, which significantly reduces costs by minimizing the number of expensive cloud load balancers. Option B is incorrect because Ingress aims to reduce the number of public IP addresses, not assign one to each service.
Read the full bite: Kubernetes Ingress: The Cluster's Smart Receptionist
Question 23 of 30
Which of the following is the primary advantage of using an Ingress Controller for exposing applications in a Kubernetes cluster?
Show the answer
Answer: c · It enables advanced HTTP/S routing from a single public endpoint, reducing cost and complexity.
The card states an Ingress Controller provides "a single, intelligent, and cost-effective entry point for all external HTTP and HTTPS traffic" and is used for "host-based routing... and path-based routing." Option D is incorrect because the card explicitly mentions that exposing services with "a unique LoadBalancer per service is expensive and complex," which an Ingress Controller aims to avoid by providing a single entry point.
Read the full bite: Ingress Controller: Your Cluster's Smart Reverse Proxy
Question 24 of 30
What inherent characteristic of a Kubernetes LoadBalancer Service makes it potentially expensive when exposing many applications?
Show the answer
Answer: a · It provisions a dedicated cloud load balancer for each individual service.
The card states, "Each LoadBalancer Service typically provisions a new, dedicated, and billable cloud load balancer, which gets expensive quickly." This dedicated provisioning per service is the primary reason for potential high costs. LoadBalancer Services provide stable public IPs and automatically handle NodePort configuration, making those options incorrect.
Read the full bite: Kubernetes LoadBalancer: Your App's Public Entry Point
Question 25 of 30
What is the main advantage of using a projected volume for configuration over traditional environment variables?
Show the answer
Answer: d · It enables configuration updates to be applied to a running Pod without requiring a restart.
The card states that projected volumes provide a way to "push configuration updates to running Pods without a restart," which is their primary benefit over environment variables. Option B is incorrect because the card explicitly mentions that "updates aren't instant; there's a delay."
Read the full bite: Projected Volumes: Mount Config as Live Files
Question 26 of 30
Which task is NOT suitable for the Kubernetes Downward API?
Show the answer
Answer: a · A microservice querying the status of other Pods in its Deployment.
The Downward API is designed solely for a Pod to gain information about itself, such as its own name, IP, or resource limits. It cannot be used to query information about other Pods or any other Kubernetes objects; such cluster-wide information requires interacting with the main Kubernetes API server.
Read the full bite: The Kubernetes Downward API: Pod Self-Awareness
Question 27 of 30
What is the primary reason to mark a Kubernetes Secret or ConfigMap as immutable?
Show the answer
Answer: c · To reduce the load on the Kubernetes API server by eliminating constant polling for changes.
The card explicitly states that immutable objects reduce API server load by eliminating the need for Kubernetes to constantly check for updates. Option D is incorrect because immutable objects prevent automatic updates; changes require creating a new object and rolling out new Pods.
Read the full bite: Immutable Secrets & ConfigMaps: Write-Once Configuration
Question 28 of 30
When managing Kubernetes configurations across dev, staging, and production, which tool is best for applying minor, declarative environment-specific changes to a shared base without complex templating?
Show the answer
Answer: d · Kustomize, as it uses overlays to patch a base configuration declaratively.
Kustomize is specifically designed for applying slight, declarative variations to a base configuration using overlays, which aligns with the scenario described. Helm, while powerful, is intended for configurations requiring complex logic or conditionals, which Kustomize aims to avoid.
Read the full bite: Kustomize: Template-Free Kubernetes Configuration
Question 29 of 30
For which scenario is configuring a custom Kubernetes ServiceAccount for a Pod most appropriate?
Show the answer
Answer: a · When the application running in the Pod requires programmatic interaction with the Kubernetes API.
The card states that a custom ServiceAccount is used "whenever a Pod needs to programmatically interact with the Kubernetes API." While a ServiceAccount can enable a Pod to read Secrets (which store sensitive data), its core purpose is authentication to the API, not the secure storage of data within the Pod's filesystem itself.
Read the full bite: Kubernetes ServiceAccounts: Identity for Pods
Question 30 of 30
In which scenario would you typically not use a StorageClass for Kubernetes storage provisioning?
Show the answer
Answer: b · When integrating pre-existing, manually managed storage resources.
The card states that StorageClasses are not typically used when working with pre-existing, manually provisioned storage volumes; instead, PersistentVolume objects would be created manually. The other options describe key benefits or use cases for StorageClasses.
Read the full bite: Kubernetes StorageClass: A Menu for Your Data
Could you explain these out loud?
That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.