All LPI exams
Free 701-200 practice test: 30 questions with answers
30 original questions for DevOps Tools Engineer, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.
- Free questions
- 30
- Full bank
- 112 questions
- Real exam
- 60 questions, 90 min
All 30 701-200 questions with answers
The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.
701 Software Engineering (8 questions)
Question 1
A team is splitting a large application into smaller services, and each service will be built, tested and deployed independently by its own team. Which architectural style does this describe?
- AA monolithic architecture in which all features ship together as one deployable unit
- BA microservices architecture in which each service can be deployed independently
- CA waterfall delivery model in which all features are released once at the end
- DA shared-database architecture in which every module writes to one common schema
Show answer and explanationHide answer
Correct answer: BMicroservices split an application into small services that are owned and deployed independently. A monolith ships as one unit, waterfall is a sequential project model rather than an architecture, and a shared schema is a data design choice that tends to couple modules.
Question 2
Which practice from the twelve-factor app methodology keeps deployment-specific settings such as database addresses and API keys out of the application code?
- ACompiling a separate binary for each environment with its settings built in
- BHard-coding production connection strings in the source files and excluding test values
- CCommitting a settings file with live credentials to the main branch of the repository
- DReading settings from environment variables that are supplied when the application starts
Show answer and explanationHide answer
Correct answer: DThe twelve-factor methodology keeps configuration separate from code and supplies it through environment variables, so one build can run in any environment. Per-environment binaries, hard-coded values and committed credentials tie configuration to the code, which the methodology avoids.
Question 3
A developer needs one command that compiles a Java project, downloads its declared library dependencies from a central repository and runs the unit tests. Which type of tool provides this capability?
- AA version control system that records the history of each file in the project
- BA text editor with syntax highlighting and code completion for many languages
- CA build automation tool such as Maven or Gradle
- DA container registry that stores and serves the image layers used by containers
Show answer and explanationHide answer
Correct answer: CBuild automation tools such as Maven and Gradle compile code, resolve declared dependencies and run tests from one command. An editor only helps write code, version control only records changes, and a container registry only stores and serves images.
Question 4
A project depends on a library whose new major release changes behaviour in ways that would break the application. Which practice keeps the build repeatable until the team chooses to upgrade?
- APinning the library to a tested version in a lock file that is committed with the source code
- BInstalling the library globally on each build server without recording which version was installed
- CDeclaring the library with an open-ended version so that the newest release is always used
- DDeleting the library's test suite so that the build no longer checks its behaviour
Show answer and explanationHide answer
Correct answer: AA lock file records the exact resolved versions, so builds stay repeatable and a new major release cannot change them unnoticed. Open-ended versions pull in whatever is newest, an untracked global install cannot be reproduced, and deleting tests removes the check rather than protecting the build.
Question 5
A developer pushed a commit containing a mistake to a shared feature branch, and teammates have already pulled it. The developer wants to undo that change while keeping the history that others depend on. Which action is most appropriate?
- ARun git reset --hard to the commit before the mistake, then force-push the branch to the remote
- BRun git revert with the identifier of the mistaken commit, then push the new commit
- CRun git rebase -i to delete the mistaken commit from the shared branch history
- DRun git stash drop to remove the stored copy of the mistaken commit
Show answer and explanationHide answer
Correct answer: Bgit revert adds a new commit that reverses the earlier change, so the shared history stays intact and teammates can pull normally. Resetting and force-pushing or rebasing a shared branch rewrites history that others have pulled, and git stash drop does not touch commits at all.
Question 6
Which statement correctly contrasts git merge with git rebase when bringing changes from one branch into another?
- AMerge replays the current branch's commits on top of the target, while rebase keeps the original commits unchanged
- BMerge joins the histories with a new merge commit, while rebase replays the branch's commits onto the target
- CRebase joins both histories with a new merge commit, while merge leaves every commit identifier unchanged in the result
- DMerge deletes the source branch automatically after joining, while rebase only moves the branch pointer and keeps its files
Show answer and explanationHide answer
Correct answer: BMerge creates a merge commit that joins two histories, while rebase rewrites the current branch's commits so they sit on top of the target. The other options swap the two commands or describe behaviour that neither command has.
Question 7
A team wants every change pushed to the shared repository to be built and tested automatically, so that integration problems appear within minutes. Which practice describes this?
- AContinuous integration, in which automated builds and tests run on every push
- BQuarterly manual reviews in which a change advisory board approves each code change
- CLong-lived feature branches that are merged together only at the end of a release cycle
- DWaterfall planning with a single integration phase scheduled close to the release date
Show answer and explanationHide answer
Correct answer: AContinuous integration merges changes frequently and runs automated builds and tests on every push, so integration problems surface early. The other options describe waterfall planning, manual approval boards and long-lived branches, all of which delay integration.
Question 8
In continuous delivery the software is always kept in a releasable state. What distinguishes continuous delivery from continuous deployment?
- AContinuous delivery keeps a manual release decision before production, while continuous deployment releases each passing change automatically
- BContinuous delivery skips automated tests, while continuous deployment runs the complete test suite on every change
- CContinuous delivery applies only to infrastructure definitions, while continuous deployment applies only to application source code
- DContinuous delivery is run by a separate operations team on dedicated servers, while continuous deployment is run by one developer from a laptop
Show answer and explanationHide answer
Correct answer: AContinuous delivery keeps software ready to release at any time, with a person deciding when it reaches production, while continuous deployment releases every passing change automatically. The other options misplace automated testing or assign scope and roles that do not define the difference.
704 Security and Observability (8 questions)
Question 9
A container image runs its application as root, but the application only needs to write to one data directory. Which change best reduces the impact of a compromise?
- AAdd the root user to every group in the image so that file permissions stay consistent
- BRun the process as a dedicated non-root user that can write only to the data directory
- CPublish every container port on the host so that the application is easy to reach
- DStart the container with the privileged flag so that it can reach every host device
Show answer and explanationHide answer
Correct answer: BA non-root user with write access limited to the data directory restricts what an attacker can change after compromising the application. Root group membership, privileged mode and publishing every port each widen the attack surface.
Question 10
What is the purpose of a Kubernetes NetworkPolicy?
- AIt controls which pods may send or receive traffic on selected connections
- BIt stores the TLS certificates that an ingress controller uses for encryption
- CIt assigns CPU and memory limits to each container that runs inside a pod
- DIt records an audit event for every request that is sent to the API server
Show answer and explanationHide answer
Correct answer: AA NetworkPolicy selects pods and defines their allowed ingress and egress traffic, and it is enforced only when the cluster's network plugin supports policies. Certificates belong in Secrets, resource limits are set on containers, and audit events come from the audit policy.
Question 11
Which statement describes how Prometheus usually collects metrics?
- APrometheus periodically scrapes the metrics endpoints of its configured targets over HTTP
- BPrometheus receives every log line from each host through a syslog socket it listens on
- CPrometheus reads the memory of running containers directly, without any HTTP metrics endpoint
- DEach application pushes its metrics into a relational database that Prometheus then queries
Show answer and explanationHide answer
Correct answer: APrometheus normally uses a pull model, scraping HTTP metrics endpoints of its configured targets at a set interval. The other options describe log collection, a push-into-database design or direct memory access, none of which is how Prometheus usually works.
Question 12
An operator wants an alert when the rate of HTTP 500 responses over the last five minutes becomes high. The metric http_requests_total is a counter with a status label. Which approach is appropriate?
- APlot the raw counter value, since it already shows how many requests arrive each second
- BDivide the counter by the pod count in the namespace to get an average per pod
- CConvert the metric into a gauge, which lets its value drop back to zero over time
- DUse rate() over a five-minute range on the 500 status series and alert on that result
Show answer and explanationHide answer
Correct answer: DCounters only increase, so the useful signal is their rate of change, which rate() computes over a time range. A raw counter is cumulative, a gauge is the wrong metric type for a counter, and dividing by pod count does not measure the error rate.
Question 13
A team wants to search logs from many containers across a cluster by severity and request ID. Which practice makes this easiest?
- AWrite logs to a file inside each container, which is lost whenever the container is replaced
- BPrint plain messages with no timestamp or fields so that each log line is kept short
- CWrite structured entries with consistent fields such as level and request ID to a central store
- DTurn off application logging in production to reduce storage use and noise
Show answer and explanationHide answer
Correct answer: CStructured entries with consistent fields can be filtered and aggregated, and a central store keeps them after containers are replaced. Container-local files are lost on replacement, while untimestamped text or disabled logging makes searching impossible.
Question 14
Which two statements about distributed tracing are correct? (Choose two.)
- AA span records one timed operation, and spans that share a trace ID form a single trace
- BTrace context is passed between services in request headers so that their spans can be linked
- CA trace replaces the need for metrics, because each trace also counts requests per second
- DA span is a single log file that stores every message written by one service instance
Show answer and explanationHide answer
Correct answer: A, BA span is one timed operation, and spans that share a trace ID are grouped into one trace. Context propagated in headers, such as the W3C traceparent header, links spans across services, while traces do not replace metrics and a span is not a log file.
Question 15
A CI job's service account needs only to read pods in one namespace. Which configuration follows the principle of least privilege?
- AA Role that allows get and list on pods in that namespace, bound to the service account with a RoleBinding
- BA ClusterRole bound across the whole cluster to the cluster-admin group for all CI jobs
- CThe cluster administrator's kubeconfig file mounted into the CI container so that the job can read every pod in the cluster
- DAdding the service account to the system:masters group so that it can call any API
Show answer and explanationHide answer
Correct answer: AA namespaced Role limited to get and list on pods, bound to the one service account, grants only the access the job needs. The other options grant cluster-wide or administrative access, which goes far beyond what the job requires.
Question 16
What is the default protection for Kubernetes Secret values stored in the cluster's data store?
- AValues are only base64-encoded unless encryption at rest has been configured for the API server
- BValues are rotated automatically by the kubelet each time the pod restarts
- CValues are encrypted with a per-user key that is stored in the kubelet's local configuration
- DValues are embedded in the container image, so each image pull includes them
Show answer and explanationHide answer
Correct answer: ASecrets are only base64-encoded by default, so encryption at rest must be configured on the API server to protect them in etcd. Encoding is not encryption, and the other options describe per-user key encryption, automatic rotation and image storage, none of which is the default behaviour.
702 Application Container (7 questions)
Question 17
A database container must keep its data when the container is removed and a new container is started from the same image. Which Docker feature provides this?
- AA published port that forwards database traffic to a directory on the host filesystem
- BThe container's writable layer, which the container engine keeps after the container is removed
- CAn environment variable that stores the path of the data directory inside the image
- DA named volume mounted at the directory where the database writes its data files
Show answer and explanationHide answer
Correct answer: DNamed volumes are managed by the container engine and exist independently of any single container, so the data survives removal of the container. A writable layer is deleted together with its container, and an environment variable or port mapping does not store any data.
Question 18
What is the relationship between a container image and a running container?
- AA container is a read-only template, and an image is the running instance created from that template
- BAn image is a read-only, layered template, and a container is a running instance created from it
- CAn image is a running process, and a container is the stored file that records its saved state
- DA container is a separate virtual machine with its own kernel, and an image is its virtual disk
Show answer and explanationHide answer
Correct answer: BAn image is a read-only, layered template, and each container is a runnable instance that adds a writable layer on top. Containers share the host kernel rather than booting their own, so the options that reverse the roles or call containers virtual machines are wrong.
Question 19
A web application runs as three replicas on two hosts. When one host fails, the team wants replacement containers started on healthy hosts without an operator logging in. Which capability of a container orchestrator provides this?
- ASelf-healing, in which the orchestrator keeps comparing actual containers with the declared desired state
- BBind mounts, which copy the application's data to a backup disk on each host automatically whenever a change occurs
- CManual restarts, in which an operator logs into each host and starts the containers again
- DMulti-stage builds, which reduce the size of the image that the cluster pulls and runs on each host
Show answer and explanationHide answer
Correct answer: AOrchestrators such as Kubernetes and Docker Swarm compare actual state with the declared desired state and start replacements when containers or hosts fail. Manual restarts defeat the goal, while bind mounts and multi-stage builds do not restore lost containers.
Question 20
Which two statements about Docker image layers are correct? (Choose two.)
- AEach Dockerfile instruction that changes the filesystem adds a new layer to the image
- BImages built on the same base image can share its layers on disk and in a registry
- CAn existing layer can be edited in place after the image has been built, to fix one file
- DChanging an early Dockerfile instruction does not affect the cache used by later instructions
Show answer and explanationHide answer
Correct answer: A, BLayers are created by filesystem-changing instructions and are reused by images that share a base, which saves disk space and transfer time. Existing layers are immutable, and changing an early instruction invalidates the cache for every later instruction.
Question 21
A Dockerfile copies the entire project into the image before installing dependencies, so every small source edit forces a full dependency reinstall during the build. Which change best reduces rebuild time?
- ARemove the FROM instruction so that the build starts from an empty image every time
- BMove the USER instruction above every RUN instruction so that the installs run faster
- CRun each RUN instruction in a separate container that is started by hand during the build
- DCopy only the dependency manifest first, install the dependencies, then copy the source code
Show answer and explanationHide answer
Correct answer: DDocker reuses cached layers until an instruction's inputs change, so copying the dependency manifest before the source keeps the install layer cached across code edits. Removing FROM, moving USER or running steps by hand does not reduce the cost of rebuilding.
Question 22
A compiled application needs a full compiler toolchain to build, but the production image should contain only the runtime files. Which Dockerfile technique fits this need?
- AInstall the compiler in the final image and remove it in a later RUN instruction
- BRun docker commit on a build container and save its state as the production image
- CUse a multi-stage build that copies only the compiled output into a slim final stage
- DStore the compiler in a named volume that the production container mounts at start
Show answer and explanationHide answer
Correct answer: CA multi-stage build keeps the toolchain in an intermediate stage and copies only the artifacts into the final image. Deleting files in a later layer does not shrink the earlier layers, and docker commit or volumes do not produce a minimal image.
Question 23
A web server container must not use more than a fixed amount of memory on a shared host. Which Docker mechanism enforces this limit?
- AResource limits applied through cgroups when the container starts, such as a memory limit option
- BLinux namespaces, which hide the host's process list from the container and separate its network
- CAn environment variable named MEMORY_LIMIT that the application reads and then chooses to respect
- DA bind mount that restricts how much data the container can see in a host directory
Show answer and explanationHide answer
Correct answer: AControl groups (cgroups) enforce resource limits such as memory, and Docker exposes them through options on docker run. Namespaces only isolate what a process can see, an environment variable is just data the application may ignore, and a bind mount does not limit usage.
703 Kubernetes (7 questions)
Question 24
Which Kubernetes component stores the cluster's state and configuration data?
- AThe kube-scheduler, which assigns newly created pods to suitable nodes
- BThe kube-proxy component, which maintains the network forwarding rules on each node
- CThe kubelet agent, which runs and monitors the pods assigned to its node
- DThe etcd key-value store, which holds the cluster state and configuration
Show answer and explanationHide answer
Correct answer: Detcd is the consistent key-value store that backs the Kubernetes API and holds the cluster's state and configuration. kube-proxy handles service networking, the kubelet runs pods on one node and the scheduler chooses nodes, so none of them is the state store.
Question 25
A new Deployment creates pods that do not yet have a node assigned. Which control plane component decides which node each of these pods runs on?
- AThe kubelet on the first worker node, which claims every pod in its namespace
- BThe container image registry, which decides where each image layer is pulled
- CThe kube-scheduler, which selects a suitable node for each unscheduled pod
- DThe etcd store, which compares the free memory on every worker node
Show answer and explanationHide answer
Correct answer: CThe kube-scheduler watches for pods without a node and assigns each one based on resource requests, constraints and policies. The kubelet only runs pods already assigned to its node, the registry only stores images, and etcd stores state without making placement decisions.
Question 26
A team changed a Deployment to a new container image, and the new pods fail their health checks. Which command returns the Deployment to its previous revision?
- Akubectl scale deployment/<name> --replicas=0
- Bkubectl get pods --watch
- Ckubectl label deployment/<name> revision=previous
- Dkubectl rollout undo deployment/<name>
Show answer and explanationHide answer
Correct answer: Dkubectl rollout undo switches a Deployment back to its previous revision by rolling out the earlier ReplicaSet. Scaling to zero stops the application, watching pods only displays them, and a label changes metadata without changing the running image.
Question 27
A pod has stayed in the Pending state since it was created. Which command shows the scheduling events that explain why the pod has not started?
- Akubectl logs <pod-name>
- Bkubectl describe pod <pod-name>
- Ckubectl get nodes --output wide
- Dkubectl exec -it <pod-name> -- /bin/sh
Show answer and explanationHide answer
Correct answer: Bkubectl describe prints a pod's status and its events, including scheduling messages such as FailedScheduling. Logs show container output that does not exist yet for a pending pod, and the node list and an exec session do not show the scheduling events.
Question 28
A team deploys one web application to development, test and production clusters. Each environment needs its own replica count and hostname, but the team wants a single versioned package with defaults. Which Kubernetes package management approach fits this need?
- AA ConfigMap that contains the complete source code of the application
- BA pod that is edited by hand on each cluster after the deployment
- CA Helm chart with a values file for each environment
- DA namespace that copies the workload definitions from the production cluster
Show answer and explanationHide answer
Correct answer: CA Helm chart packages Kubernetes manifests as a versioned unit with templated defaults, and a values file per environment overrides settings such as replica count and hostname. A ConfigMap holds configuration rather than a package, and hand-edited pods or namespace copies give no versioned packaging.
Question 29
Which two statements about Kubernetes pods and Deployments are correct? (Choose two.)
- AA pod is the smallest deployable unit, and its containers share one network namespace
- BA Deployment manages ReplicaSets so that a declared number of pod replicas keeps running
- CThe containers in one pod are always placed on separate nodes so that they stay isolated
- DA Deployment stores the persistent data of its pods inside the Deployment object itself
Show answer and explanationHide answer
Correct answer: A, BA pod is the smallest unit Kubernetes schedules, and its containers share one network namespace. A Deployment uses ReplicaSets to keep a declared number of replicas running, while containers in one pod are not forced onto separate nodes and Deployments do not store data.
Question 30
In a Kubernetes control plane, which component is the only one that talks directly to etcd, with the other components going through it?
- AThe kube-proxy on each node, which replicates the etcd data to the other worker nodes
- BThe kubelet on each worker node, which writes the status of every pod it runs straight into the etcd data store
- CThe kube-scheduler, which stores its node assignments in etcd before it binds pods to nodes
- DThe kube-apiserver, which all other control plane components and node agents use to read and write state
Show answer and explanationHide answer
Correct answer: DThe API server is the only component that talks to etcd directly, and all other components read and write cluster state through its API. The kubelet, the scheduler and kube-proxy do not access etcd themselves, and kube-proxy does not replicate cluster data.