Search Tutorials


Docker and Kubernetes Quiz - MCQ - Multiple Choice Questions | JavaInUse

Docker and Kubernetes Quiz - MCQ - Multiple Choice Questions

Q. What is Docker?

A. A container management platform
B. An open-source operating system
C. A virtualization technology
D. A cloud-based development environment

Q. What is the main purpose of using Docker containers?

A. Resource isolation
B. Portable and consistent environments
C. Lightweight virtualization
D. All of the above

Q. What is a Docker image?

A. A lightweight, stand-alone executable
B. A template for creating Docker containers
C. A snapshot of a container at a particular point in time
D. A package containing the source code of an application

Q. How do you build a Docker image?

A. Use the docker build command and provide a Dockerfile
B. Run a container and commit the changes to create an image
C. Use the docker create command and specify the image name
D. Download an existing image from a registry and modify it

Q. What is a Kubernetes cluster?

A. A set of nodes managed by Kubernetes
B. A group of containers running on a single node
C. A distributed system for managing containerized applications
D. A platform for deploying and scaling microservices

Q. What are the main components of a Kubernetes cluster?

A. Master node, worker nodes, and pods
B. Control plane, etcd, and container runtime
C. API server, scheduler, and controller manager
D. All of the above

Q. What is a pod in Kubernetes?

A. A group of containers with shared storage and network
B. A single instance of a container running an application
C. A virtual machine running on a node
D. A logical unit for managing and scaling applications

Q. How does Kubernetes handle scaling?

A. By using horizontal pod autoscaling
B. Through manual scaling based on resource utilization
C. By dynamically adjusting the number of nodes in the cluster
D. All of the above

Q. What is a Deployment in Kubernetes?

A. A way to define the desired state of a pod or replica set
B. A tool for managing and updating applications in a cluster
C. A method for rolling out new versions of an application
D. All of the above





Q. What is a Service in Kubernetes?

A. An abstract way to expose an application
B. A way to define a network policy
C. A method for load balancing traffic
D. All of the above

Q. What is a Namespace in Kubernetes?

A. A way to isolate resources within a cluster
B. A logical grouping of objects, such as pods and services
C. A security mechanism to control access to resources
D. All of the above

Q. What is a DaemonSet in Kubernetes?

A. A type of controller that runs a single instance of a pod on each node
B. A method for deploying applications across multiple nodes
C. A way to ensure high availability of an application
D. A tool for managing and monitoring node-level services

Q. How do you update an application deployed in Kubernetes?

A. Use the kubectl apply command to update the deployment
B. Edit the deployment YAML file and apply the changes
C. Delete the old deployment and create a new one
D. All of the above

Q. What is a Kubernetes Ingress?

A. A rule for routing incoming network traffic
B. A type of controller that manages external access to services
C. A method for load balancing external traffic
D. A security mechanism for controlling incoming requests

Q. What is a Kubernetes Operator?

A. A tool for packaging, deploying, and managing Kubernetes applications
B. A method for extending the Kubernetes API with custom resources
C. A way to automate complex tasks and customize application behavior
D. All of the above

Q. Which of the following commands is used to build a Docker image based on a Dockerfile in the current directory?

A.
docker build
B.
docker create
C.
docker run
D.
docker pull

Q. Which of the following Docker commands is used to run a container based on a specific image?

A.
docker start
B.
docker create
C.
docker run
D.
docker exec

Q. Which of the following commands is used to stop a running Docker container?

A.
docker stop
B.
docker kill
C.
docker rm
D.
docker pause

Q. Which of the following commands is used to remove a Docker image from the local registry?

A.
docker rmi <image_name>
B.
docker rm <image_name>
C.
docker delete <image_name>
D.
docker remove <image_name>

Q. Which of the following commands is used to list all running Docker containers?

A.
docker ps
B.
docker ls
C.
docker list
D.
docker show

Q. Which of the following is a valid Dockerfile instruction to set the working directory inside the container?

A.
WORKDIR /app

B.
WORKINGDIR /app

C.
WORKING_DIR /app

D.
SETWORKDIR /app

Q. Which of the following is a valid Kubernetes object for managing a group of pods and providing service discovery and load balancing?

A.
Deployment
B.
Service
C.
ReplicaSet
D.
StatefulSet

Q. Which of the following is a valid Kubernetes object for defining the desired state of the cluster and its resources?

A.
Pod
B.
Deployment
C.
Service
D.
Manifest

Q. Which of the following is a valid Kubernetes object for defining a single instance of an application?

A.
Pod
B.
Deployment
C.
ReplicaSet
D.
Service

Q. Which of the following is a valid Kubernetes object for defining the desired state of a pod and its replicas?

A.
Deployment
B.
Service
C.
ReplicaSet
D.
StatefulSet