Free CompTIA AT0-001 Practice Questions 2026 - Page 5
Automation Coding Concepts
A server is replaced with a newly built image instead of patched in place. Which principle fits?
A. Immutability
B. Log filtering
C. Imperative editing
D. Branch merging
Answer Option (Which option is correct) A. Immutability
Explanation:
Replacing a server from a newly built image treats the deployed instance as an immutable unit. Changes are introduced through a new image and replacement rather than accumulated patches on the running server. This approach improves consistency only when the image inputs and replacement process are controlled.
Why the other options are incorrect:
B. Log filtering:
Log filtering changes which log records are selected. It does not replace an infrastructure instance. The rebuild-and-replace behavior concerns infrastructure lifecycle.
C. Imperative editing:
Imperative editing generally prescribes actions against the existing system. The scenario replaces the server with a new image. That distinction supports immutability rather than repeated in-place edits.
D. Branch merging:
Branch merging integrates source histories. It does not define how running servers are updated. Repository integration and instance replacement are separate operations.
References:
Kubernetes: deployments
Terraform: infrastructure as code
Declaring a desired replica count is an example of declarative configuration.
A. TRUE
B. FALSE
Answer Option (Which option is correct) A. True
Explanation:
The declaration specifies the state to achieve.
Why the other options are incorrect:
B. False:
False rejects the desired-state interpretation. A replica declaration describes the target state. The controller decides how to reach that state.
References:
Kubernetes: deployments
Terraform: infrastructure as code
A script says create directory then copy file then restart service. Which approach fits?
A. Imperative
B. Declarative desired state
C. Source-control fetch
D. Immutable artifact
Answer Option (Which option is correct) A. Imperative
Explanation:
The script states a sequence of actions that must be performed: create, copy, and restart. That is an imperative description of how to reach the result. A desired-state declaration would instead specify the required end state and let the automation determine the necessary changes.
Why the other options are incorrect:
B. Declarative desired state:
Declarative state describes the outcome to maintain. This script instead specifies ordered actions. The stated commands make the approach imperative.
C. Source-control fetch:
Source-control fetch downloads repository information. It does not describe the script's execution model. The sequence of system actions remains imperative.
D. Immutable artifact:
An immutable artifact describes unchanging built content. It does not classify an ordered procedural script. Artifact identity and automation style are separate properties.
References:
Ansible: desired state and architecture
A configuration run makes no additional changes when repeated against compliant hosts. What property fits?
A. Randomization
B. Idempotency
C. Authentication
D. Parallelism
Answer Option (Which option is correct) B. Idempotency
Explanation:
An idempotent configuration operation produces no additional changes when the target already satisfies the desired state. Repeating the operation should not duplicate entries or cause unnecessary mutations. The first run may change a noncompliant host; subsequent compliant runs should leave that state stable.
Why the other options are incorrect:
A. Randomization:
Randomization changes values or execution choices. It does not guarantee stable effects on repeated runs. The unchanged result is evidence of idempotency.
C. Authentication:
Authentication verifies identity. It does not specify whether applying configuration again changes state. Access checks and repeat-run behavior are independent.
D. Parallelism:
Parallelism concerns concurrent execution. Repeated runs can be idempotent whether sequential or parallel. Concurrency does not explain the absence of further changes.
References:
Ansible: desired state and architecture
Choose TWO IaC practices that support reuse across environments.
A. Hardcode every account identifier
B. Maintain shared reviewed modules
C. Parameterize environment inputs
D. Copy and diverge every script
C. Parameterize environment inputs
Answer Option (Which option is correct) B. Maintain shared reviewed modules
Answer Option (Which option is correct) C. Parameterize environment inputs
Explanation:
Option B centralizes the reviewed implementation in shared modules. Option C exposes environment-specific values as inputs rather than embedding them in copied code. Together these practices let environments vary their configuration while retaining a common implementation.
Why the other options are incorrect:
A. Hardcode every account identifier:
Hardcoded account identifiers couple the implementation to one environment. Reuse then requires code edits or duplication. Environment parameters avoid that dependency.
D. Copy and diverge every script:
Divergent copies create multiple independently changing implementations. Fixes may not reach every environment. Shared reviewed modules reduce this inconsistency.
References:
Terraform: reusable modules
A team uses a reviewed module for all environments. What benefit follows?
A. Consistent reusable configuration
B. No need for credentials
C. Automatic elimination of all costs
D. Guaranteed zero failures
Answer Option (Which option is correct) A. Consistent reusable configuration
Explanation:
Using the same reviewed module across environments reduces divergence in how resources are declared. Environment differences can be supplied through parameters instead of separate copies of the implementation. Changes to the shared module still need version control and testing before broad adoption.
Why the other options are incorrect:
B. No need for credentials:
Credentials may still be required to apply the module. Reviewed configuration does not remove authentication needs. Authorized access remains part of deployment.
C. Automatic elimination of all costs:
All costs cannot be eliminated by module reuse. Resources and operational work still have costs. Reuse improves consistency without promising free infrastructure.
D. Guaranteed zero failures:
Zero failures are not guaranteed by review. Provider outages and invalid inputs can still occur. Shared modules still require validation and monitoring.
References:
Terraform: reusable modules
A Python file is missing a closing parenthesis. What should catch this first?
A. DNS lookup
B. Load testing
C. Artifact promotion
D. Syntax validation
Answer Option (Which option is correct) D. Syntax validation
Explanation:
A missing closing parenthesis prevents Python from parsing the file correctly. Syntax validation detects that structural error before the intended program can execute. Runtime tests become useful after the source is syntactically valid.
Why the other options are incorrect:
A. DNS lookup:
A DNS lookup checks name resolution. It does not parse Python punctuation. The missing parenthesis remains a code defect.
B. Load testing:
Load testing evaluates behavior under demand. A file with a parse error cannot run normally for that test. Syntax validation should happen earlier.
C. Artifact promotion:
Artifact promotion moves an approved build toward release. It does not diagnose malformed source syntax. Promoting invalid code is not a corrective step.
References:
Python: errors and exceptions
A script parses correctly but divides by zero during execution. What kind of error is this?
A. SemVer prerelease
B. Branch naming error
C. TLS expiration
D. Runtime error
Answer Option (Which option is correct) D. Runtime error
Explanation:
The program passes parsing, but an operation fails when it executes. Division by zero raises an exception during runtime. This separates the failure from a syntax error, which would prevent the program from being parsed in the first place.
Why the other options are incorrect:
A. SemVer prerelease:
A prerelease version is a release identifier. It does not classify an arithmetic exception. The failure occurs during execution.
B. Branch naming error:
A branch name describes source organization. Division by zero is not a naming violation. Valid repository naming cannot prevent this runtime exception.
C. TLS expiration:
TLS expiration concerns certificate validity. The question specifies arithmetic failure inside a script. Certificate renewal would not fix that operation.
References:
Python: errors and exceptions
Git displays conflict markers after merging two edits to the same lines. What should happen next?
A. Delete the remote automatically
B. Push the markers unchanged
C. Resolve the content then stage and commit the resolution
D. Run git config user.email only
Answer Option (Which option is correct) C. Resolve the content then stage and commit the resolution
Explanation:
Conflict markers identify content that Git could not reconcile automatically. Review the competing changes, edit the file into the intended final content, and remove the markers. Stage the resolved file and complete the merge commit after checking that the combined behavior is correct.
Why the other options are incorrect:
A. Delete the remote automatically:
Deleting the remote does not reconcile the two edits. It risks losing shared history without correcting local content. The conflict requires an intentional resolution.
B. Push the markers unchanged:
Conflict markers indicate unresolved competing changes. Publishing them preserves the conflict instead of settling it. The file must be edited into valid intended content.
D. Run git config user.email only:
Author email configuration sets commit identity. It does not choose between conflicting code changes. Content resolution and staging are still necessary.
References:
Git: git merge
Git: git push
Order a deliberate merge-conflict resolution.
|
Stage the resolved files
Complete the merge commit
Edit to the intended combined content
Inspect conflicting changes
|
|
Supplied source solution: A. Inspect conflicting changes -> D. Edit to the intended combined content -> B. Stage the resolved files -> C. Complete the merge commit
Explanation:
Inspect the conflicting changes before deciding how to combine them. Edit the content, stage the resolved files, and then complete the merge commit. Staging records the chosen resolution, so it must follow the actual content repair. Import review: The source solution is preserved above. The sample does not establish the application's Ordering answer representation, so the existing answer-storage fields remain unchanged.
Why the other options are incorrect:
Not applicable: the supplied items are sequence steps or matching choices, rather than incorrect distractors.
References:
Git: git merge
Git: git push
| Page 5 out of 22 Pages |