AT0-001
Free AT0-001 practice questions
10 questions from our AT0-001 practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.
Question 1 of 10, Automation Coding Concepts
A Python automation script provisions user accounts from a list. The engineer wants the provisioning logic in one place so it can be called for each user and unit-tested separately. Which change BEST meets this goal?
- AReplace the loop with a while True construct that reads the next user from a counter until an IndexError occurs
- BStore the provisioning steps in a global variable as a string and run it with exec() for each user in the list
- CCopy the provisioning block once per user so each account has its own clearly separated section of code
- DMove the provisioning steps into a function that takes the username as a parameter and call it inside the loop Correct answer
Answer and explanation: A parameterised function encapsulates the logic, removes duplication and can be called by unit tests directly. Copying the block per user multiplies maintenance effort and defeats reuse. Running code stored in a string with exec() is hard to test and a security risk, and an endless loop that relies on an exception for termination is fragile and does not make the logic more testable.
Question 2 of 10, Automation Coding Concepts. Choose 2.
A team adopts trunk-based development for its automation repository. Which two practices are characteristic of this branching strategy? (Choose two.)
- AEach release is maintained on its own permanent branch that never merges back
- BFeature flags hide incomplete work that has already been merged to main Correct answer
- CLong-lived feature branches are merged only at the end of each quarter
- DDevelopers merge small changes into the main branch at least daily Correct answer
- EA separate develop branch collects features before release branches are cut
Answer and explanation: Trunk-based development relies on frequent, small merges into a single main branch and uses feature flags to keep unfinished functionality inactive in production. Long-lived feature branches contradict the model, a develop branch plus release branches describes Git Flow, and permanent per-release branches are a release-maintenance pattern rather than trunk-based development.
Question 3 of 10, Automation Coding Concepts
An operations engineer writes a Bash script that must stop immediately when any command returns a non-zero exit status, instead of continuing with later steps. Which line should be added near the top of the script?
- Atrap '' EXIT
- Bset -x
- Cexport PIPESTATUS=1
- Dset -e Correct answer
Answer and explanation: The set -e option makes Bash exit as soon as a command returns a non-zero status. The set -x option only prints each command before running it for debugging. An empty trap on EXIT merely registers a no-op handler and does not stop on failures, and PIPESTATUS is a read-only array Bash fills with pipeline exit codes rather than a switch that changes error handling.
Question 4 of 10, System Configuration
An engineer uses curl to send JSON to an API, but the server responds with 415 Unsupported Media Type. Which curl option is MOST likely missing?
- A-H "Content-Type: application/json" Correct answer
- B-H "Cache-Control: no-cache"
- C-H "Connection: keep-alive"
- D-H "Accept-Encoding: gzip"
Answer and explanation: 415 means the server does not accept the request body's declared media type, which happens when JSON is sent without a Content-Type of application/json (curl defaults to form encoding with -d). Accept-Encoding concerns response compression, Cache-Control concerns caching, and Connection controls connection reuse; none of them declares the body format.
Question 5 of 10, System Configuration
A team writes an Ansible playbook that lists the packages and services that should exist on each host, and the tool works out which steps are needed. Another team writes a shell script that lists each command to run in order. Which statement correctly compares the two approaches?
- AThe playbook is declarative because it describes the end state, while the script is imperative because it lists the steps Correct answer
- BThe playbook is imperative because tasks run in order, while the script is declarative because it is easier to read
- CBoth are imperative because the target servers receive commands over SSH in each of the two approaches
- DBoth are declarative because each of them can be stored in Git and reviewed by the team before execution
Answer and explanation: Declarative automation describes the desired end state and lets the tool determine the actions, which is how the playbook is described. Imperative automation specifies the exact sequence of commands, as in the shell script. Storing code in Git does not make it declarative, and the transport (SSH) does not determine the paradigm.
Question 6 of 10, System Configuration
An automation server calls an API using mutual TLS. After the security team renewed certificates, the API rejects connections with "bad certificate" during the handshake, while server certificate validation on the client still succeeds. What is the MOST likely cause?
- AThe API changed its REST endpoint paths, so the handshake fails until the client uses the new URLs
- BThe client certificate presented by the automation server was not renewed or is not trusted by the API's client CA list Correct answer
- CThe automation server's DNS cache returns an old IP address for the API after the certificate renewal
- DThe API's server certificate expired, so the client refuses to continue the handshake with the server
Answer and explanation: In mutual TLS the server also validates the client certificate; a "bad certificate" alert from the server while the client trusts the server points to an expired, replaced or untrusted client certificate. The client already validates the server certificate successfully, DNS issues would not produce a certificate alert, and URL paths are sent only after the handshake.
Question 7 of 10, Continuous Integration
A team stores deployment credentials in a CI secrets store. A pull request from a fork modifies the workflow to print every environment variable. Which configuration BEST prevents the secrets from being exposed?
- ADo not make secrets available to workflows triggered by pull requests from forks, and require approval for outside contributors Correct answer
- BRotate the secrets after every pull request is merged so that any leaked value expires within a day
- CStore the secrets as base64-encoded strings in the repository so that they are not obvious in the logs
- DRely on the platform's log masking, since masked secrets can never be revealed by modified workflow steps
Answer and explanation: Withholding secrets from untrusted fork-triggered runs and requiring approval stops modified workflows from accessing them at all. Masking can be bypassed by transforming the value before printing it, base64 encoding in the repository is not protection, and rotating after merge still leaves secrets exposed while the pull request runs.
Question 8 of 10, Continuous Integration
A pipeline has three jobs: build, unit-test and integration-test. Both test jobs require the build output, but they do not depend on each other. Which pipeline design minimises total run time?
- ARun all three jobs in a single sequential stage so the build output stays on one agent
- BDeclare integration-test as dependent on unit-test, and unit-test as dependent on build
- CDeclare that both test jobs depend on build so they start in parallel once build succeeds Correct answer
- DRun all three jobs in parallel immediately so that none of them waits for the others
Answer and explanation: Expressing only the real dependency lets both test jobs run concurrently after the build, which is the shortest path. A single sequential stage or a chain from unit-test to integration-test adds unnecessary waiting. Starting the test jobs before the build finishes fails because their input does not yet exist.
Question 9 of 10, Continuous Delivery
A Kubernetes Deployment of 10 replicas is updated with a rolling update strategy of maxUnavailable: 0 and maxSurge: 2. What happens during the rollout?
- ATwo old pods are terminated before any new pod is created, keeping the total at eight pods
- BAll ten old pods are terminated first, and then ten new pods are started at the same moment
- CTraffic is switched from a full set of old pods to a full set of new pods in one single step
- DUp to two extra new pods are created at a time, and old pods are removed only after new ones are ready Correct answer
Answer and explanation: With maxSurge 2 the controller may run two pods above the desired count, and maxUnavailable 0 means it waits for new pods to become ready before removing old ones, so capacity never drops. Terminating everything first describes a recreate strategy, removing pods first would require maxUnavailable above zero, and an all-at-once switch describes blue-green.
Question 10 of 10, Continuous Delivery. Choose 2.
A team wants its CI/CD pipeline to authenticate to a cloud provider for deployments WITHOUT storing long-lived access keys anywhere. Which two approaches meet this requirement? (Choose two.)
- AEncrypt an access key with a passphrase and commit it to the repository with the pipeline code
- BRun the deployment on a self-hosted runner that uses an attached instance role or managed identity Correct answer
- CConfigure OpenID Connect federation so the pipeline exchanges its identity token for short-lived cloud credentials Correct answer
- DCreate a personal user account for the pipeline and save its password as a protected variable
- EStore an access key pair in the CI secrets store and rotate it manually every 90 days
Answer and explanation: OIDC workload identity federation and instance roles or managed identities both provide short-lived credentials without a stored long-term secret. Access keys in a secrets store or encrypted in the repository are still long-lived secrets, and a user account password is a reusable credential that also blurs human and machine identities.