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 replace application code with scripts
B. To package an application with its dependencies
C. To create physical servers for applications
D. To store source code in repositories

2 What is Docker primarily used for?

Containerization with Docker Easy
A. Writing operating system kernels
B. Designing relational databases
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 container
B. A cluster
C. A volume
D. A repository

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

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

5 Which Dockerfile instruction specifies the base image?

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

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

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

7 What is a Docker image?

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

8 What is container orchestration?

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

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

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

10 Why is container orchestration useful for microservices?

Container orchestration Easy
A. It combines all services into one process
B. It removes the need for application testing
C. It manages many distributed containers
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 cluster
B. A node
C. A pod
D. A namespace

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

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

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. Dockerfile
B. kubelet
C. kubectl
D. etcdctl

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

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

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

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

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

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

19 What is Continuous Integration?

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

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

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

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 container label
B. A custom bridge network
C. A health check
D. A named volume

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. Run the image in privileged mode
B. Bind the service to 0.0.0.0
C. Create an anonymous volume
D. Change the container hostname

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. Copy dependency files before source files
B. Place EXPOSE before the base image
C. Combine the build with container startup
D. Run npm install after CMD

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. Expose fewer container ports
B. Add more image tags
C. Use a larger base image
D. Use a multi-stage build

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. USER appuser
B. LABEL user=appuser
C. ARG appuser
D. WORKDIR /app

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 build argument
B. A readiness check
C. A storage driver
D. A restart policy

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. Volume formatting
B. Image compression
C. Layer caching
D. Service discovery

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. kube-proxy
B. etcd
C. kube-scheduler
D. kubelet

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. etcd
B. kube-proxy
C. CoreDNS
D. kubelet

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. cloud-controller-manager
B. kubelet
C. kube-scheduler
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 PersistentVolume
B. A Deployment
C. A Namespace
D. A ConfigMap

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 ConfigMap
B. A ReplicaSet
C. A ClusterIP Service
D. A PersistentVolumeClaim

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 Deployment
B. A Service
C. A StorageClass
D. A Secret

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 limit
B. The container's CPU request
C. The image's compressed size
D. The Service's target port

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. Canary deployment
C. Vertical scaling
D. Recreate deployment

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. Integrate small changes frequently
B. Maintain long-lived feature branches
C. Build only production images
D. Delay testing until release

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. Run linting near the beginning
B. Run all tests in one final stage
C. Build the image before checking syntax
D. Deploy before executing validation

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. Pin dependency and base-image versions
C. Build on developer machines only
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. Rebuild the image for each environment
B. Install dependencies after deployment
C. Replace the image tag during startup
D. Promote the tested image unchanged

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. Run the image with an additional named volume
B. Add EXPOSE 8080 before the existing command
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. The files existed only in the deleted container's writable layer
B. Docker discarded the files because /data was not exposed
C. The files were stored in an anonymous volume owned by the image
D. Docker automatically removes image layers modified after startup

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. Copy dependency manifests, copy the source, and then run npm ci
B. Copy the source, copy package-lock.json, and then run npm ci
C. Run npm ci, copy package-lock.json, and then copy the source
D. Copy dependency manifests, run npm ci, and then copy the source

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. Copy the token, install packages, and remove it in one RUN
B. Use a BuildKit secret mount only in the installation step
C. Store the token in ENV and unset it before CMD executes
D. Pass the token with ARG and delete it in the next layer

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. Add the source repository and module cache to 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. Copy the compiler toolchain from the builder into 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. An OCI image index referencing architecture-specific image manifests
B. A single AMD64 image rebuilt by each node at container startup
C. A Docker volume containing binaries for both processor architectures
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. Preferred node affinity by zone plus a pod disruption budget by hostname
B. Zone topology spread constraints plus required pod anti-affinity by hostname
C. A service selector by zone plus a resource quota for each hostname
D. Required node affinity by hostname plus preferred pod affinity by zone

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. Catch SIGKILL, remove the service endpoint, and checkpoint every open connection
B. Handle SIGTERM, stop accepting work, drain requests, and allow sufficient grace time
C. Ignore SIGTERM, shorten the grace period, and retry every failed request
D. Disable readiness checks, extend the startup delay, and immediately stop the process

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 scheduler writes directly to etcd, and the API server launches the runtime
B. The API server persists intent, the scheduler binds a node, and the kubelet starts containers
C. The controller manager launches containers, and the scheduler records them in etcd
D. The kubelet selects a node, the controller manager binds it, and etcd starts containers

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. Existing containers stop because kubelets require continuous etcd leases
B. The scheduler reconstructs cluster state from container runtimes automatically
C. Service networking stops because kube-proxy reads etcd for every request
D. Existing workloads may continue, but new control-plane state changes fail

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 immediately restarted and permanently removed from its ReplicaSet
B. It remains a normal Service endpoint but receives reduced traffic
C. It is rescheduled to another node while preserving its current IP address
D. It is excluded from ready Service endpoints while its containers keep running

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 12 total Pods and at least 7 available Pods
D. At most 13 total Pods and at least 8 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 readiness probe that permanently succeeds after its first success
B. Use a startup probe followed by independent liveness and readiness probes
C. Use only a liveness probe with failure detection disabled after startup
D. Use only a readiness probe with a four-minute timeout

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. 7 replicas
B. 8 replicas
C. 5 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. Increase the Deployment revision history and wait for environment refresh
B. Change the Service selector so it references the ConfigMap resource name
C. Add a ConfigMap checksum annotation to the Pod template and redeploy
D. Recreate the ConfigMap with the same name while leaving the Pod template unchanged

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 forwards only to Pods created by the oldest ReplicaSet
B. A Service routes canary traffic only when both images share one digest
C. A Service requires every selected Pod to use a distinct container port
D. A Service balances among endpoints without expressing exact version weights

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. Add the new column, support both forms, migrate data, then remove the old column
B. Delete the old column, restore its data, and then add compatibility code
C. Pause all old Pods, rename the column, and resume them with cached connections
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. Allow parallel merges and schedule a complete regression suite each night
B. Use a merge queue that tests the prospective combined main-branch state
C. Require developers to rebuild only the files modified by their own branches
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. Pin base images by digest and resolve dependencies from locked, immutable artifacts
B. Use floating base tags and clear every dependency cache before each build
C. Rebuild the image repeatedly and publish whichever build completes first
D. Store build timestamps in every layer and select the newest package versions

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. Consumer-driven contract tests verified in the provider pipeline
B. Load tests that measure provider throughput with synthetic requests
C. Container vulnerability scans executed after publishing the image
D. Provider code-coverage thresholds generated from internal unit tests