Unit 3 - Practice Quiz

INT363 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 What is the primary function of Docker in the context of microservices?

A. To manage physical hardware resources manually
B. To act as a web server for static files
C. To package applications and dependencies into a portable container
D. To replace the need for an operating system

2 Which of the following describes a key difference between Virtual Machines (VMs) and Containers?

A. VMs spin up faster than containers
B. Containers have their own guest operating system, while VMs share the host OS
C. Containers share the host OS kernel, while VMs include a full guest OS
D. VMs are more lightweight than containers

3 What is a Docker Image?

A. A read-only template used to create containers
B. A writable layer on top of a file system
C. A database used by Docker
D. A running instance of a container

4 Which file is used to define the instructions for building a Docker image?

A. docker-compose.yml
B. package.json
C. container.conf
D. Dockerfile

5 In a Dockerfile, which instruction initializes a new build stage and sets the base image?

A. BASE
B. FROM
C. START
D. IMPORT

6 What is the purpose of the 'EXPOSE' instruction in a Dockerfile?

A. It documents that the container listens on the specified network ports at runtime
B. It creates a security vulnerability
C. It downloads external dependencies
D. It publishes the port to the host machine automatically

7 Which Docker command is used to list all currently running containers?

A. docker run
B. docker images
C. docker ps
D. docker list

8 What is Container Orchestration?

A. The automated management of the lifecycle of containers
B. The manual installation of Docker on servers
C. The creation of virtual machines
D. The process of writing code for microservices

9 Which of the following is the most popular open-source platform for container orchestration?

A. Ansible
B. Jenkins
C. Nagios
D. Kubernetes

10 In Kubernetes architecture, what is a 'Pod'?

A. A network firewall rule
B. The master node controller
C. A storage volume
D. The smallest deployable unit used to encapsulate one or more containers

11 What is the role of the 'Control Plane' (formerly Master Node) in Kubernetes?

A. To provide storage to containers
B. To run the actual application workloads
C. To manage the cluster, schedule pods, and maintain the desired state
D. To act as a load balancer for external traffic only

12 Which component of the Kubernetes Control Plane is a key-value store used for all cluster data?

A. etcd
B. controller-manager
C. kube-scheduler
D. kube-proxy

13 What is the function of the 'kube-scheduler'?

A. It assigns newly created Pods to nodes based on resource availability and constraints
B. It stores the cluster state
C. It exposes the Kubernetes API
D. It executes the containers on the node

14 Which agent runs on every Kubernetes node and ensures that containers are running in a Pod?

A. kubelet
B. etcd
C. kube-apiserver
D. Cloud Controller Manager

15 What is a 'Service' in Kubernetes?

A. A script that runs during startup
B. A background process in the Linux OS
C. A tool for building Docker images
D. An abstraction that defines a logical set of Pods and a policy to access them

16 Which command line tool is used to communicate with the Kubernetes cluster?

A. docker-cli
B. k8s-run
C. kube-admin
D. kubectl

17 What is the purpose of 'Continuous Integration' (CI)?

A. To deploy applications to production once a year
B. To manually compile code before release
C. To manage the physical servers in a data center
D. To automate the merging of code changes into a shared repository and running tests

18 Which of the following is a benefit of Continuous Integration?

A. It slows down the development process
B. It eliminates the need for version control
C. It allows developers to work in isolation for months
D. It detects integration errors early in the development cycle

19 In the context of CI/CD, what is a 'Build Artifact'?

A. A bug found during testing
B. A compiled and packaged file (like a JAR or Docker Image) ready for deployment
C. The source code file
D. The documentation of the project

20 What is the difference between 'ADD' and 'COPY' in a Dockerfile?

A. ADD allows extracting tar files and downloading URLs, while COPY only copies local files
B. COPY is deprecated; ADD is the new standard
C. There is no functional difference
D. COPY is for Linux, ADD is for Windows

21 What is a 'Deployment' in Kubernetes?

A. A network policy
B. A resource object that manages ReplicaSets and provides declarative updates to Pods
C. A one-time job execution
D. A method to install Kubernetes

22 Which Kubernetes concept is used to isolate resources within the same cluster?

A. Nodes
B. Volumes
C. Namespaces
D. Ingress

23 What is 'Rolling Update' in the context of microservices deployment?

A. Deploying the new version to a separate environment for testing only
B. Gradually replacing instances of the old version with the new version
C. Shutting down all instances and starting new ones simultaneously
D. Reverting to a previous version manually

24 What is the purpose of a '.dockerignore' file?

A. To list the files that should be included in the image
B. To specify files and directories that should be excluded from the build context
C. To list ignored users
D. To ignore errors during the build process

25 In Kubernetes, what is a 'ReplicaSet' responsible for?

A. Ensuring a specified number of pod replicas are running at any given time
B. Managing user permissions
C. Exposing services to the internet
D. Storing configuration data

26 Which instruction in a Dockerfile defines the command to run when the container starts?

A. EXEC
B. RUN
C. BUILD
D. CMD

27 What is 'Blue-Green Deployment'?

A. Deploying only to users with blue or green screens
B. Updating half the servers in the morning and half at night
C. A deployment that fails 50% of the time
D. A technique where two identical environments exist, one running production (Blue) and one with the new version (Green)

28 What is the 'Docker Daemon'?

A. A container analysis tool
B. The command line interface for Docker
C. The registry where images are stored
D. A background service that manages Docker objects like images, containers, and networks

29 Which Kubernetes component exposes the Kubernetes API?

A. kube-scheduler
B. kubelet
C. kube-apiserver
D. etcd

30 What is the primary purpose of 'Docker Hub'?

A. A cloud-based registry service for sharing and storing Docker images
B. A tool to compile Java code
C. To run containers on the cloud
D. A local storage for Docker logs

31 What is a 'Canary Deployment'?

A. Deploying to a bird-themed server
B. Releasing code only to internal developers
C. Releasing code to a small percentage of users before a full rollout
D. Deploying code without testing

32 Which Docker command creates an image from a Dockerfile?

A. docker create
B. docker commit
C. docker build
D. docker image-maker

33 What does the 'WORKDIR' instruction do in a Dockerfile?

A. It installs a worker process
B. It creates a new user
C. It sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow
D. It defines the network mode

34 In Kubernetes, what is an 'Ingress'?

A. A type of container image
B. A storage volume
C. A security credential
D. An API object that manages external access to the services in a cluster, typically HTTP

35 What is the role of 'kube-proxy'?

A. To build container images
B. To schedule pods
C. To maintain network rules on nodes allowing network communication to your Pods
D. To store cluster data

36 Why is immutability important in container images?

A. It ensures that the container runs exactly the same way in every environment
B. It allows the image to be changed easily at runtime
C. It prevents the image from being deleted
D. It makes the image size larger

37 Which CI tool is widely used for building and testing software projects continuously?

A. Zoom
B. Photoshop
C. Jenkins
D. Excel

38 What is a Multi-stage build in Docker?

A. Building an image on multiple computers at once
B. A method to reduce image size by using multiple FROM instructions and copying artifacts between stages
C. Running a build for more than 24 hours
D. Building multiple images for different OS versions

39 What is the relationship between a Pod and a Node in Kubernetes?

A. They are the same thing
B. A Pod runs on a Node
C. A Node is a type of storage for a Pod
D. A Node runs inside a Pod

40 Which Kubernetes object is used to store sensitive information like passwords or keys?

A. Volume
B. Deployment
C. Secret
D. ConfigMap

41 What does the 'ENV' instruction do in a Dockerfile?

A. Ends the build process
B. Installs a new environment
C. Validates the environment
D. Sets an environment variable

42 In the context of Docker, what is a 'Volume'?

A. The loudness of the container
B. A CPU limit
C. A networking protocol
D. A mechanism for persisting data generated by and used by Docker containers

43 What is the 'Self-healing' capability in Kubernetes?

A. The ability of Kubernetes to restart failed containers, replace them, and kill containers that don't respond to health checks
B. The ability of the code to fix syntax errors
C. The ability of the hardware to repair itself
D. The ability to automatically upgrade the operating system

44 Which of the following is a key principle of Continuous Integration?

A. Deploying to production manually once a month
B. Committing to the main branch frequently (at least daily)
C. Manual testing only
D. Long-lived feature branches

45 What is a 'ConfigMap' in Kubernetes?

A. A configuration file for the Docker daemon
B. An API object used to store non-confidential data in key-value pairs
C. A tool to map ports
D. A map of the physical network

46 What is the 'Sidecar' pattern in microservices deployment?

A. Deploying a helper container alongside the main application container in the same Pod
B. Running two different applications on the same server
C. Backing up data to a side server
D. Using a motorcycle for delivery

47 Which Docker command stops a running container?

A. docker halt
B. docker stop
C. docker pause
D. docker end

48 What is the difference between RUN and CMD in a Dockerfile?

A. They are identical
B. CMD executes during the build phase; RUN executes when the container starts
C. RUN executes during the build phase; CMD executes when the container starts
D. RUN is used for networking; CMD is for storage

49 In Kubernetes, what is a 'StatefulSet'?

A. A workload API object used to manage stateful applications
B. A set of stateless web servers
C. A configuration for stateless apps
D. A set of static IP addresses

50 What is the main advantage of using a 'Layered Architecture' in Docker images?

A. It looks better visually
B. It encrypts the data automatically
C. It allows the image to run on Windows and Linux simultaneously
D. It allows caching and reuse of layers, speeding up builds and reducing storage