Unit 3: Deploying Microservices - Practice Quiz

INT363 — Cloud Microservices 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is the main purpose of containerization?

Containerization with Docker Easy
A. To package an application with its dependencies
B. To store source code in repositories
C. To create physical servers for applications
D. To replace application code with scripts

2 What is Docker primarily used for?

Containerization with Docker Easy
A. Designing relational databases
B. Writing operating system kernels
C. Creating and running containers
D. Managing physical network cables

3 What is a running instance of a Docker image called?

Containerization with Docker Easy
A. A repository
B. A container
C. A volume
D. A cluster

4 Which Docker command builds an image from a Dockerfile in the current directory?

Dockerfile and container image creation Easy
A. docker stop .
B. docker pull .
C. docker build .
D. docker run .

5 Which Dockerfile instruction specifies the base image?

Dockerfile and container image creation Easy
A. CMD
B. COPY
C. RUN
D. FROM

6 Which Dockerfile instruction copies files from the build context into an image?

Dockerfile and container image creation Easy
A. ENTRYPOINT
B. EXPOSE
C. COPY
D. WORKDIR

7 What is a Docker image?

Dockerfile and container image creation Easy
A. A process that monitors network traffic
B. A log generated by an application
C. A template used to create containers
D. A server that schedules virtual machines

8 What is container orchestration?

Container orchestration Easy
A. Writing code inside a container
B. Compressing images into smaller files
C. Converting containers into virtual machines
D. Automating the management of containers

9 Which task is commonly handled by a container orchestration platform?

Container orchestration Easy
A. Designing user interfaces
B. Scaling container instances
C. Editing application source code
D. Creating database table names

10 Why is container orchestration useful for microservices?

Container orchestration Easy
A. It manages many distributed containers
B. It combines all services into one process
C. It removes the need for application testing
D. It converts source code into documentation

11 What is Kubernetes?

Overview of Kubernetes and its architecture Easy
A. A programming language compiler
B. A container orchestration platform
C. A source code text editor
D. A relational database system

12 What is the smallest deployable unit in Kubernetes?

Overview of Kubernetes and its architecture Easy
A. A node
B. A pod
C. A namespace
D. A cluster

13 Which part of Kubernetes manages the overall state of a cluster?

Overview of Kubernetes and its architecture Easy
A. The control plane
B. The application volume
C. The container image
D. The service endpoint

14 What is the role of a Kubernetes worker node?

Overview of Kubernetes and its architecture Easy
A. To build physical network devices
B. To design container image layers
C. To store Git commit history
D. To run application workloads

15 Which Kubernetes component communicates with the control plane and manages pods on a worker node?

Overview of Kubernetes and its architecture Easy
A. kubectl
B. etcdctl
C. kubelet
D. Dockerfile

16 Which Kubernetes resource is commonly used to manage replicated instances of a microservice?

Deploying microservices Easy
A. Deployment
B. ConfigMap
C. Namespace
D. Secret

17 Which Kubernetes resource provides a stable network endpoint for a set of pods?

Deploying microservices Easy
A. Service
B. ReplicaSet
C. ConfigMap
D. Namespace

18 What does increasing the replica count of a microservice do?

Deploying microservices Easy
A. Deletes the image from the registry
B. Runs more instances of the service
C. Disables communication between the pods
D. Combines all services into one container

19 What is Continuous Integration?

Continuous Integration (CI) principles Easy
A. Frequently merging code into a shared repository
B. Replacing source code with container images
C. Running every service on one computer
D. Deploying code only once each year

20 What commonly happens after code is committed in a CI process?

Continuous Integration (CI) principles Easy
A. All project files are deleted
B. Automated builds and tests run
C. Manual testing becomes impossible
D. The production server is removed

21 A microservice writes uploaded files inside its container. The files disappear whenever the container is replaced. Which Docker feature should be used to preserve the files?

Containerization with Docker Medium
A. A health check
B. A named volume
C. A custom bridge network
D. A container label

22 A web service works inside a Docker container but cannot be reached through its published host port. The service is listening only on 127.0.0.1 inside the container. What is the most appropriate correction?

Containerization with Docker Medium
A. Bind the service to 0.0.0.0
B. Change the container hostname
C. Create an anonymous volume
D. Run the image in privileged mode

23 A Dockerfile copies the entire source tree before running npm install. Small source-code changes therefore cause dependencies to be reinstalled. Which change best improves build caching?

Dockerfile and container image creation Medium
A. Run npm install after CMD
B. Combine the build with container startup
C. Copy dependency files before source files
D. Place EXPOSE before the base image

24 A compiled microservice image contains compilers, source code, and temporary build files, making it unnecessarily large. Which Dockerfile technique best addresses this issue?

Dockerfile and container image creation Medium
A. Use a multi-stage build
B. Add more image tags
C. Expose fewer container ports
D. Use a larger base image

25 A security review finds that a microservice runs as root inside its container even though it requires no privileged operations. Which Dockerfile instruction should be used to change its runtime identity?

Dockerfile and container image creation Medium
A. ARG appuser
B. WORKDIR /app
C. USER appuser
D. LABEL user=appuser

26 An orchestrator is configured to maintain five instances of a payment service. One host fails and two instances stop. What should the orchestrator do under a desired-state model?

Container orchestration Medium
A. Route all traffic to the failed host
B. Start two replacement instances
C. Wait for an administrator to restart them
D. Reduce the desired count to three

27 During a rolling update, new containers start quickly but need 20 seconds before they can serve requests. Which mechanism should prevent traffic from reaching them too early?

Container orchestration Medium
A. A storage driver
B. A build argument
C. A restart policy
D. A readiness check

28 Several replicas of a microservice are created and removed dynamically. Client services should not track the IP address of each replica. Which orchestration capability solves this problem?

Container orchestration Medium
A. Service discovery
B. Image compression
C. Volume formatting
D. Layer caching

29 A newly created Pod remains pending because Kubernetes has not yet selected a worker node for it. Which control-plane component is primarily responsible for this selection?

Overview of Kubernetes and its architecture Medium
A. etcd
B. kubelet
C. kube-proxy
D. kube-scheduler

30 The Kubernetes control plane needs a consistent key-value store for cluster configuration and desired-state data. Which component provides this storage?

Overview of Kubernetes and its architecture Medium
A. CoreDNS
B. kube-proxy
C. kubelet
D. etcd

31 A container in a Pod terminates unexpectedly. Which node-level Kubernetes component observes the Pod specification and works with the container runtime to restart it?

Overview of Kubernetes and its architecture Medium
A. kube-scheduler
B. kubelet
C. cloud-controller-manager
D. etcd

32 A team directly creates a single Kubernetes Pod for a microservice. After the Pod is deleted, no replacement appears. Which resource should the team normally create instead?

Overview of Kubernetes and its architecture Medium
A. A Deployment
B. A Namespace
C. A ConfigMap
D. A PersistentVolume

33 A Kubernetes Deployment runs three replicas whose Pod IP addresses change over time. Which resource should expose them through a stable internal address?

Deploying microservices Medium
A. A PersistentVolumeClaim
B. A ClusterIP Service
C. A ConfigMap
D. A ReplicaSet

34 A microservice requires database credentials at runtime. The team wants to avoid embedding them in the container image. Which Kubernetes resource is most appropriate?

Deploying microservices Medium
A. A Service
B. A Deployment
C. A Secret
D. A StorageClass

35 A Kubernetes cluster has sufficient total CPU, but a Pod remains pending because its declared CPU requirement cannot fit on any single node. Which setting is the scheduler primarily evaluating?

Deploying microservices Medium
A. The container's CPU request
B. The container's CPU limit
C. The Service's target port
D. The image's compressed size

36 A team wants to release a new microservice version to a small percentage of users before wider deployment. Which deployment strategy best supports this goal?

Deploying microservices Medium
A. Manual restart
B. Recreate deployment
C. Canary deployment
D. Vertical scaling

37 Developers merge code only once every few weeks, producing large and difficult integration conflicts. Which CI practice most directly reduces this problem?

Continuous Integration (CI) principles Medium
A. Delay testing until release
B. Integrate small changes frequently
C. Maintain long-lived feature branches
D. Build only production images

38 A CI pipeline takes 45 minutes, but simple formatting errors are discovered only in its final stage. How should the pipeline be improved to fail faster?

Continuous Integration (CI) principles Medium
A. Deploy before executing validation
B. Build the image before checking syntax
C. Run linting near the beginning
D. Run all tests in one final stage

39 The same Git commit sometimes produces different container images because dependency versions are resolved differently on each build. Which action best improves reproducibility?

Continuous Integration (CI) principles Medium
A. Disable the automated test stage
B. Build on developer machines only
C. Pin dependency and base-image versions
D. Use the latest dependency versions

40 A microservice image passes all CI tests in staging. For production, the team rebuilds the source and produces a slightly different image. Which practice better preserves release consistency?

Continuous Integration (CI) principles Medium
A. Replace the image tag during startup
B. Rebuild the image for each environment
C. Promote the tested image unchanged
D. Install dependencies after deployment

41 A Docker container runs an HTTP server using CMD /app/server. During docker stop, the server often fails to perform its SIGTERM shutdown logic and is eventually killed. Which change most directly addresses the signal-delivery problem?

Containerization with Docker Hard
A. Add EXPOSE 8080 before the existing command
B. Run the image with an additional named volume
C. Replace the command with CMD ["/app/server"]
D. Move the existing command into a RUN instruction

42 A container writes uploaded files to /data without mounting a volume. After the container is deleted and recreated from the same image, the files disappear. Which explanation is correct?

Containerization with Docker Hard
A. Docker discarded the files because /data was not exposed
B. Docker automatically removes image layers modified after startup
C. The files were stored in an anonymous volume owned by the image
D. The files existed only in the deleted container's writable layer

43 A Node.js Dockerfile copies the entire source tree before running npm ci. Every source-code change therefore causes dependencies to be reinstalled. Which instruction order best improves cache reuse while preserving dependency correctness?

Dockerfile and container image creation Hard
A. Run npm ci, copy package-lock.json, and then copy the source
B. Copy dependency manifests, run npm ci, and then copy the source
C. Copy dependency manifests, copy the source, and then run npm ci
D. Copy the source, copy package-lock.json, and then run npm ci

44 A private package registry requires a token during image construction. The final image and its layer history must not contain the token. Which approach is most appropriate?

Dockerfile and container image creation Hard
A. Use a BuildKit secret mount only in the installation step
B. Pass the token with ARG and delete it in the next layer
C. Store the token in ENV and unset it before CMD executes
D. Copy the token, install packages, and remove it in one RUN

45 A Go service is compiled in one stage and its binary is copied into a scratch final stage. The container starts but fails when making HTTPS requests because certificate authorities are unavailable. What is the smallest targeted correction?

Dockerfile and container image creation Hard
A. Copy the compiler toolchain from the builder into the final stage
B. Run the binary through a shell installed in the final stage
C. Copy a CA certificate bundle into the expected runtime path
D. Add the source repository and module cache to the final stage

46 A team must publish one image tag that runs natively on both linux/amd64 and linux/arm64 clusters. What should the registry tag reference?

Dockerfile and container image creation Hard
A. A Docker volume containing binaries for both processor architectures
B. An OCI image index referencing architecture-specific image manifests
C. A single AMD64 image rebuilt by each node at container startup
D. A single ARM64 image containing an AMD64 compatibility shell

47 A service has six replicas. Replicas must be distributed as evenly as possible across zones, and no two replicas may run on the same node. Which scheduling policy combination best expresses both requirements?

Container orchestration Hard
A. Zone topology spread constraints plus required pod anti-affinity by hostname
B. Required node affinity by hostname plus preferred pod affinity by zone
C. A service selector by zone plus a resource quota for each hostname
D. Preferred node affinity by zone plus a pod disruption budget by hostname

48 During rolling updates, some requests fail because terminating instances exit while still receiving in-flight traffic. Which design best supports graceful termination?

Container orchestration Hard
A. Disable readiness checks, extend the startup delay, and immediately stop the process
B. Catch SIGKILL, remove the service endpoint, and checkpoint every open connection
C. Handle SIGTERM, stop accepting work, drain requests, and allow sufficient grace time
D. Ignore SIGTERM, shorten the grace period, and retry every failed request

49 Which sequence most accurately describes how a newly submitted Pod normally becomes a running workload in Kubernetes?

Overview of Kubernetes and its architecture Hard
A. The API server persists intent, the scheduler binds a node, and the kubelet starts containers
B. The controller manager launches containers, and the scheduler records them in etcd
C. The kubelet selects a node, the controller manager binds it, and etcd starts containers
D. The scheduler writes directly to etcd, and the API server launches the runtime

50 In a cluster where all etcd members become unavailable but worker nodes and their networking remain healthy, which immediate behavior is most likely?

Overview of Kubernetes and its architecture Hard
A. The scheduler reconstructs cluster state from container runtimes automatically
B. Existing workloads may continue, but new control-plane state changes fail
C. Existing containers stop because kubelets require continuous etcd leases
D. Service networking stops because kube-proxy reads etcd for every request

51 A Pod is Running, but its readiness probe is failing. Assuming default Service behavior and no special endpoint publication settings, how is the Pod treated?

Overview of Kubernetes and its architecture Hard
A. It is excluded from ready Service endpoints while its containers keep running
B. It is rescheduled to another node while preserving its current IP address
C. It is immediately restarted and permanently removed from its ReplicaSet
D. It remains a normal Service endpoint but receives reduced traffic

52 A Deployment has 10 desired replicas, maxSurge: 25%, and maxUnavailable: 25%. Ignoring terminating Pods and probe delays, which limits apply during a rolling update?

Deploying microservices Hard
A. At most 12 total Pods and at least 8 available Pods
B. At most 13 total Pods and at least 7 available Pods
C. At most 13 total Pods and at least 8 available Pods
D. At most 12 total Pods and at least 7 available Pods

53 A legacy service legitimately needs four minutes to initialize, but after startup it should be restarted if it deadlocks. Which Kubernetes probe arrangement best prevents premature restarts without hiding later failures?

Deploying microservices Hard
A. Use a startup probe followed by independent liveness and readiness probes
B. Use only a readiness probe with a four-minute timeout
C. Use only a liveness probe with failure detection disabled after startup
D. Use a readiness probe that permanently succeeds after its first success

54 An HPA targets 50% average CPU utilization. Four ready Pods each have valid CPU requests, and the measured average utilization is 80%. Ignoring stabilization, tolerance, and scaling limits, what replica count does the basic HPA formula select?

Deploying microservices Hard
A. 5 replicas
B. 8 replicas
C. 7 replicas
D. 6 replicas

55 A Deployment consumes application configuration through environment variables sourced from a ConfigMap. The ConfigMap is updated, but existing Pods retain the old values. Which deployment technique reliably applies the change?

Deploying microservices Hard
A. Change the Service selector so it references the ConfigMap resource name
B. Increase the Deployment revision history and wait for environment refresh
C. Recreate the ConfigMap with the same name while leaving the Pod template unchanged
D. Add a ConfigMap checksum annotation to the Pod template and redeploy

56 A team runs stable and canary Deployments simultaneously and wants exactly 5% of requests sent to the canary. Why is adding both versions behind a standard Kubernetes Service insufficient for precise weighting?

Deploying microservices Hard
A. A Service routes canary traffic only when both images share one digest
B. A Service balances among endpoints without expressing exact version weights
C. A Service forwards only to Pods created by the oldest ReplicaSet
D. A Service requires every selected Pod to use a distinct container port

57 Service A is deployed before Service B, and both versions temporarily coexist during rolling updates. A database column must be renamed without downtime. Which migration strategy is safest?

Deploying microservices Hard
A. Pause all old Pods, rename the column, and resume them with cached connections
B. Add the new column, support both forms, migrate data, then remove the old column
C. Delete the old column, restore its data, and then add compatibility code
D. Rename the column first and deploy both services after the migration completes

58 Two pull requests independently pass CI against the current main branch, but their combination fails after both are merged. Which CI practice most directly prevents this integration race?

Continuous Integration (CI) principles Hard
A. Require developers to rebuild only the files modified by their own branches
B. Use a merge queue that tests the prospective combined main-branch state
C. Allow parallel merges and schedule a complete regression suite each night
D. Run each pull request only against the commit from which its branch originated

59 A CI pipeline produces different container contents from the same Git commit on different days because base images and packages move. Which policy most improves reproducibility?

Continuous Integration (CI) principles Hard
A. Store build timestamps in every layer and select the newest package versions
B. Use floating base tags and clear every dependency cache before each build
C. Pin base images by digest and resolve dependencies from locked, immutable artifacts
D. Rebuild the image repeatedly and publish whichever build completes first

60 A provider microservice changes a response field from an integer to a string. The provider's unit tests pass, but several independently deployed consumers depend on the integer type. Which CI technique most directly detects this breaking interaction without running every consumer end-to-end?

Continuous Integration (CI) principles Hard
A. Provider code-coverage thresholds generated from internal unit tests
B. Load tests that measure provider throughput with synthetic requests
C. Consumer-driven contract tests verified in the provider pipeline
D. Container vulnerability scans executed after publishing the image