Skip to content
tezvyn:

Top 30 Easy Docker & Kubernetes Concepts Quiz for Beginners

30 easy multiple-choice Docker & Kubernetes concept questions, the vocabulary and first principles, the parts you need before anything else makes sense. They come from 30 bites in the Docker & Kubernetes library, the gentlest 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.

  1. Question 1 of 30

    A developer needs to deploy a microservices application with minimal resource usage and fast startup times. Which technology is generally preferred and why?

    Show the answer

    Answer: a · Containers, because they share the host OS kernel, reducing overhead.

    Containers are preferred for microservices due to their low overhead and fast startup times, achieved by sharing the host OS kernel. VMs, while offering strong isolation, incur significant resource overhead by emulating a full OS.

    Read the full bite: VMs vs. Containers: Houses vs. Apartments

  2. Question 2 of 30

    What is Docker's primary method for resolving the 'Works on My Machine' problem?

    Show the answer

    Answer: a · It bundles the application with all its specific dependencies into a portable, consistent unit.

    The card explicitly states Docker solves this by "packaging an application with all of its dependencies... into a single, isolated unit called a container image." This ensures the environment is consistent everywhere. While related to isolation, containers are distinct from full virtual machines, which are heavier and emulate entire hardware systems.

    Read the full bite: The 'Works on My Machine' Problem

  3. Question 3 of 30

    What is the primary functional distinction between stopping a container and removing it?

    Show the answer

    Answer: d · Stopping a container allows it to be restarted later with its preserved internal state, whereas removing it permanently deletes the container instance and any data not on a volume.

    The card explicitly states that stopping a container retains its state, allowing it to be restarted, while removing it permanently deletes the container and its non-volume data. Option A is incorrect because 'stop' sends a graceful shutdown signal (SIGTERM), not an immediate termination, and 'rm' deletes an already stopped container, it doesn't initiate the shutdown process itself.

    Read the full bite: Container Lifecycle: From Create to Remove

  4. Question 4 of 30

    Which core problem in software development does a Dockerfile primarily address?

    Show the answer

    Answer: c · Guaranteeing that an application's runtime environment is identical everywhere it runs.

    The card explicitly states Dockerfiles exist "To solve the classic 'it works on my machine' problem" and "ensure that an application and its dependencies are packaged together and run consistently everywhere." This aligns perfectly with guaranteeing an identical runtime environment. While Docker is used in CI/CD (which includes testing automation), the Dockerfile's direct role is defining the environment, not the testing process itself.

    Read the full bite: The Dockerfile: A Recipe for Your Container

  5. Question 5 of 30

    What is the primary reason to avoid using the "latest" tag for Docker images in production or CI/CD pipelines?

    Show the answer

    Answer: b · The image associated with the "latest" tag can be updated at any time, leading to non-reproducible builds and unexpected behavior.

    The card explicitly states that the image 'latest' points to can change without warning, leading to unexpected failures or behavior drift, making builds non-reproducible. This mutability is the core issue, not that it's inherently unstable or automatically purged.

    Read the full bite: Docker Image Tagging: Versioning for Containers

  6. Question 6 of 30

    What is the main limitation of using Docker Compose alone for production environments?

    Show the answer

    Answer: c · It lacks features for high availability and automatic scaling.

    The card explicitly states that Docker Compose should not be used alone for production because it lacks high-availability, fault tolerance, load balancing, and auto-scaling. The other options describe functionalities that Docker Compose is designed to handle, such as defining multi-service applications, managing networks, and supporting persistent data via volumes.

    Read the full bite: The docker-compose.yml File: Your App's Blueprint

  7. Question 7 of 30

    What is the primary benefit of defining services in a Docker Compose file for an application?

    Show the answer

    Answer: c · It provides a declarative way to manage multiple interconnected containers as a single application.

    The card states that Docker Compose's purpose is to "manage multi-container applications declaratively" and allows you to "spin up a complete, interconnected environment with a single command." Option A describes features of production orchestration tools like Kubernetes, which the card explicitly states Compose is not.

    Read the full bite: Docker Compose Services: Defining Your App's Components

  8. Question 8 of 30

    For which scenario is Docker Compose most effectively utilized?

    Show the answer

    Answer: d · Orchestrating a multi-service application stack for local development and automated testing.

    Docker Compose is explicitly designed for orchestrating multi-container applications in local development environments and for automated testing, simplifying the setup of complex service dependencies. It is not recommended for large-scale production deployments, which require more advanced cluster orchestrators.

    Read the full bite: Docker Compose: Orchestrate Multi-Container Apps Locally

  9. Question 9 of 30

    What is Docker Hub's primary role within the Docker ecosystem?

    Show the answer

    Answer: d · To act as a central, public registry for sharing and discovering container images.

    Docker Hub is explicitly defined as a "central repository for finding, storing, and sharing pre-built software containers." It serves as the primary distribution channel for both official and community-contributed images, making it a central registry. The other options describe functions of other Docker components or related technologies like orchestration.

    Read the full bite: Docker Hub: The Central Repository for Containers

  10. Question 10 of 30

    What is a required step before successfully uploading a Docker image to a specific remote registry?

    Show the answer

    Answer: b · Tagging the image with the full registry address and desired name.

    The card states, "Before you can push, you must tag your image with the registry's address." This tag is essential for Docker to know which specific registry to send the image to. While logging in (option D) is often necessary for authentication, tagging (option B) is the fundamental step to specify the destination registry.

    Read the full bite: Docker Push and Pull: Moving Container Images

  11. Question 11 of 30

    What is the primary security concern when using docker login with a username and password directly in CI/CD pipelines?

    Show the answer

    Answer: a · The credentials may be exposed in build logs or stored unencrypted.

    Option A is correct because the card explicitly warns that using docker login directly in CI/CD "can expose credentials in build logs" and notes that credentials are often stored unencrypted. Option C is a plausible inconvenience, but the card emphasizes the security risk of credential exposure, not just the lack of automation.

    Read the full bite: Docker Login: Authenticating to a Container Registry

  12. Question 12 of 30

    What is the key difference in how "docker image prune" (without flags) and "docker image prune --all" operate?

    Show the answer

    Answer: d · The default command removes only dangling images, whereas --all removes all images not associated with any container.

    The card states that the default `docker image prune` targets only "dangling" images. In contrast, `docker image prune --all` removes "all images that are not associated with at least one container," which is a much broader cleanup. Option A is incorrect because the default command removes dangling images, not just failed builds, and --all removes more than just untagged images.

    Read the full bite: Docker Image Prune: Reclaim Your Disk Space

  13. Question 13 of 30

    What is the primary purpose of grouping multiple containers within a single Kubernetes Pod?

    Show the answer

    Answer: d · To ensure that tightly coupled processes can share resources and be scheduled together on one machine.

    The card states that Pods group tightly-coupled processes that need to run together, share resources, and be co-located on the same Node. Option D directly reflects this. Options A, C, and D describe scenarios that are either incorrect (containers share one IP) or explicitly advised against (independent scaling, bundling unrelated services) because Pods scale as a single unit.

    Read the full bite: Kubernetes Pods: The Atomic Unit of Deployment

  14. Question 14 of 30

    A developer wants a Service to automatically route traffic to a specific set of Pods. How would Kubernetes achieve this?

    Show the answer

    Answer: a · By matching the Service's selector to labels on the target Pods.

    The card explains that Services use selectors to identify which Pods they should operate on, matching labels on those Pods for flexible grouping. Annotations are for non-queryable metadata, not for selection by the Kubernetes control plane.

    Read the full bite: Labels and Selectors: The Glue of Kubernetes

  15. Question 15 of 30

    What is the primary advantage of having a Kubernetes Deployment manage a ReplicaSet, rather than directly creating a ReplicaSet?

    Show the answer

    Answer: c · Deployments enable advanced features like rolling updates and rollbacks for application versions.

    The card explicitly states that managing ReplicaSets directly causes you to "lose the crucial ability to perform rolling updates," which Deployments provide. While Deployments offer abstraction, their primary benefit is orchestrating updates, not just simpler YAML or namespace spanning.

    Read the full bite: ReplicaSet: Kubernetes' Pod Thermostat

  16. Question 16 of 30

    When a Kubernetes Pod is being scheduled, which resource definition is primarily used to determine its placement on a node?

    Show the answer

    Answer: b · The Pod's resource requests, to guarantee the node has sufficient minimum available capacity.

    The Kubernetes scheduler uses the Pod's resource requests to find a node with enough guaranteed capacity for placement. Limits, conversely, are enforced at runtime by the Kubelet, not during the initial scheduling phase.

    Read the full bite: Kubernetes Requests and Limits: Your Pod's Resource Contract

  17. Question 17 of 30

    Which task is best suited for a Kubernetes Job?

    Show the answer

    Answer: d · Performing a one-time database schema upgrade for an application.

    Kubernetes Jobs are designed for tasks that run to completion, such as a one-off database migration. Long-running services (options A and C) are managed by Deployments, and recurring scheduled tasks (option A) are handled by CronJobs.

    Read the full bite: Kubernetes Jobs: For Tasks That Need to Finish

  18. Question 18 of 30

    For which scenario is the Kubernetes Recreate deployment strategy the most appropriate choice?

    Show the answer

    Answer: a · Introducing a new database schema that is incompatible with the existing application version.

    Option A is correct because the Recreate strategy is specifically designed for updates with breaking changes, such as database schema migrations, where old and new versions cannot coexist. Option B is incorrect because the Recreate strategy explicitly guarantees downtime, making it unsuitable for scenarios requiring no service interruption.

    Read the full bite: Recreate Deployment: Downtime for a Clean Slate

  19. Question 19 of 30

    What is the primary advantage of using imperative kubectl commands over declarative configuration files?

    Show the answer

    Answer: b · They are ideal for quickly performing one-off tasks like debugging or testing.

    Imperative commands are best for immediate, ad-hoc tasks like debugging or testing, as they allow direct interaction without configuration files. Option A describes a benefit of declarative configuration, which is explicitly contrasted with imperative commands as the method for managing production infrastructure to avoid configuration drift and ensure reproducibility.

    Read the full bite: Imperative kubectl: Directly Command Your Cluster

  20. Question 20 of 30

    What is the primary problem a Kubernetes ClusterIP service is designed to solve?

    Show the answer

    Answer: c · Providing a stable, internal network endpoint for pods that are frequently created and destroyed.

    The card states that ClusterIP solves the problem of ephemeral pods needing a stable endpoint for internal traffic. Option C directly reflects this by highlighting the need for a consistent internal network address for pods with changing IPs. Option D is a common misconception; while services can expose applications, ClusterIP specifically does not provide external access.

    Read the full bite: ClusterIP Service: Internal-Only Networking

  21. Question 21 of 30

    What is the primary benefit of using Kubernetes DNS for internal service communication?

    Show the answer

    Answer: c · It provides stable, human-readable names for services and pods, abstracting away their ephemeral IP addresses.

    The core purpose of Kubernetes DNS is to provide stable, resolvable names for services and pods, which are inherently ephemeral and have constantly changing IP addresses. This allows applications to communicate reliably by name. Option A is incorrect because Kubernetes DNS is explicitly for internal cluster communication, not for external client access.

    Read the full bite: Kubernetes DNS: How Pods Find Each Other

  22. Question 22 of 30

    Why would you use a ConfigMap rather than hardcoding a database hostname into a container image at build time?

    Show the answer

    Answer: b · To avoid rebuilding the image when promoting the same build from staging to production

    ConfigMaps separate configuration from image content so the same immutable build can run across environments with different settings without rebuilding. Distractor A is tempting because the data is encoded, but ConfigMaps are not encrypted by default and should never hold sensitive connection strings.

    Read the full bite: ConfigMap decouples config from container images

  23. Question 23 of 30

    Which statement accurately describes how Kubernetes Secrets handle sensitive data storage?

    Show the answer

    Answer: b · Secrets base64-encode data, which is a reversible process and not a form of encryption.

    The card explicitly states that Secret values are stored as base64-encoded strings and clarifies that "This is encoding, not encryption, and is easily reversible." Option A is a common misconception, as Secrets do not provide encryption at rest by default.

    Read the full bite: Kubernetes Secrets: Managing Sensitive Data in Pods

  24. Question 24 of 30

    What is a key benefit of injecting ConfigMaps and Secrets as environment variables in Kubernetes Pods?

    Show the answer

    Answer: a · It allows a single container image to be deployed consistently across multiple environments with distinct configurations.

    The card states that externalizing configuration allows deploying the same image to different environments without rebuilding. Option B is incorrect because the card explicitly says this method is not for dynamic updates, and option C is incorrect because the card warns that any process can inspect environment variables, potentially exposing sensitive data.

    Read the full bite: Kubernetes: Inject ConfigMaps & Secrets as Env Vars

  25. Question 25 of 30

    What problem does a PersistentVolumeClaim (PVC) primarily solve in Kubernetes for stateful applications?

    Show the answer

    Answer: d · Decoupling the ephemeral lifecycle of a Pod from the durable lifecycle of its data storage.

    A PVC's main purpose is to allow application data to persist independently of a Pod's lifecycle, ensuring data survives Pod restarts or deletions. Options A, B, and D describe other Kubernetes concepts or incorrect functionalities of PVCs.

    Read the full bite: PersistentVolumeClaim: How Pods Request Storage

  26. Question 26 of 30

    To grant a user permissions to manage deployments only within a specific namespace, which RBAC object should define these permissions?

    Show the answer

    Answer: c · A Role, because its scope is inherently limited to a single namespace.

    A Role is designed to define permissions confined to a single namespace, making it ideal for namespace-specific access. Option A is incorrect because a ClusterRole defines permissions across the entire cluster, making it unsuitable for defining namespace-specific rules, even if a RoleBinding attempts to limit its application.

    Read the full bite: Kubernetes RBAC: Roles vs. ClusterRoles

  27. Question 27 of 30

    When diagnosing a performance issue in a distributed system, what is the most effective sequence for utilizing the three pillars of observability?

    Show the answer

    Answer: a · Metrics first identify the problem, logs then provide specific event context, and traces pinpoint the exact bottleneck location.

    The card's 'canonical example' illustrates that metrics first alert to a problem, logs then provide specific contextual details about the event, and traces are subsequently used to pinpoint the exact component causing the issue. Option D, while plausible, reverses the order of logs and traces in the diagnostic process for pinpointing the root cause.

    Read the full bite: The Three Pillars of Observability

  28. Question 28 of 30

    Which characteristic of Kubernetes Events makes them unsuitable for long-term auditing or historical trend analysis?

    Show the answer

    Answer: d · They are automatically purged by the API server after a relatively short time.

    The card explicitly states that Events are "garbage collected by the API server after about one hour," making them unsuitable for long-term analysis. While they are human-readable, they are also structured and include both "Normal" and "Warning" types for various objects, making the other options incorrect.

    Read the full bite: Kubernetes Events: The Cluster's Short-Term Memory

  29. Question 29 of 30

    What is the primary mechanism by which GitOps ensures infrastructure consistency?

    Show the answer

    Answer: c · Automated agents continuously pull desired state from a Git repository and reconcile the live environment.

    The card states that "software agents inside your environment automatically PULL the desired state from the source repo" and "these agents CONTINUOUSLY RECONCILE the actual state of the system with the desired state." Option B describes a push-based model, which is contrary to GitOps' pull-based nature.

    Read the full bite: GitOps Principles: Your Repo as the Source of Truth

  30. Question 30 of 30

    How does Helm primarily simplify the deployment and management of applications on Kubernetes?

    Show the answer

    Answer: b · By bundling all application YAMLs into versioned, templated packages called Charts for customizable deployments.

    Helm's core function is to solve "YAML sprawl" by packaging multiple interdependent Kubernetes YAML files into a single, versioned, and templated unit called a Chart, which allows for easy customization and repeatable deployments. Option D is incorrect because Helm generates manifests from templates, rather than providing a CLI for direct editing of individual resources.

    Read the full bite: Helm: The Package Manager for Kubernetes

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.

Get it on Google PlayiPhone app coming soon