Topic · 13 of 65 questions freeAutomation Coding Concepts
Question 11Choose 1
Match the text-processing task to its tool.
Search matching log lines Extract a JSON field Print whitespace-delimited fields
Supplied source solution: Search matching log lines -> A. grep; Extract a JSON field -> C. jq; Print whitespace-delimited fields -> B. awk Explanation:
Searching matching log lines maps to A, grep, because it selects lines containing a pattern. Extracting a JSON field maps to C, jq, which understands JSON values and property access. Printing whitespace-delimited fields maps to B, awk, which provides field references such as $2. The appropriate tool depends on the data structure being processed. Import review: The source solution is preserved above. The sample does not establish the application's ColumnMatch 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.
Which command prints lines containing ERROR from app.log?
Correct answer:
B. grep 'ERROR' app.log
Answer Option (Which option is correct) B. grep 'ERROR' app.log Explanation:
grep searches the named file and prints each line containing a match for ERROR. The quoted pattern is passed as one shell argument, and app.log is the input file. Without additional options, matching is case-sensitive, which fits the uppercase text specified in the question.
Why the other options are incorrect:
A. git add app.log: git add stages file content for a commit. It does not select matching log lines. The operator needs a text-search command.
C. jq '.ERROR' app.log: jq expects structured JSON input. The expression selects a property rather than finding arbitrary text lines. A plain application log is not necessarily a JSON document.
D. chmod ERROR app.log: chmod changes filesystem permissions. It does not search log contents for an error pattern. ERROR is not a valid symbolic permission mode here.
A space-delimited file contains host and status. Which tool naturally prints the second field?
Correct answer:
D. awk '{print $2}' file
Answer Option (Which option is correct) D. awk '{print $2}' file Explanation:
awk splits ordinary input records into whitespace-delimited fields by default. Its $2 reference selects the second field, and print writes that field for each record. This directly extracts the status column from the stated host-and-status file.
Why the other options are incorrect:
A. git fetch file: git fetch downloads repository objects and references. It does not split this text record into fields. The status column remains unextracted.
B. curl -X POST file: curl sends or retrieves data through supported protocols. POST does not mean print a text field. A local field-processing expression is needed.
C. sed -n '$2' file: The proposed sed expression is not an awk field reference. sed does not interpret dollar-two as the second whitespace field here. This command does not implement the requested extraction.
Topic · 10 of 52 questions freeSystem Configuration
Question 14Choose 1
State locking helps prevent concurrent conflicting changes to shared infrastructure state.
Correct answer:
A. TRUE
Answer Option (Which option is correct) A. True Explanation:
Locking serializes operations against shared state.
Why the other options are incorrect:
B. False: False would dismiss the serialization benefit. A supported state lock prevents overlapping writers from applying changes simultaneously. This reduces conflicting updates to shared state.
Answer Option (Which option is correct) B. Restricted state access Answer Option (Which option is correct) D. State locking Explanation:
Option B restricts who can read or change shared state, which may contain sensitive resource information. Option D prevents cooperating state-changing operations from running concurrently against the same locked state. Access controls protect authority and confidentiality, while locking protects consistency during updates.
Why the other options are incorrect:
A. Anonymous public write access: Public write access allows uncontrolled state modification. It undermines ownership and integrity. Shared state should have restricted permissions.
C. Uncoordinated concurrent updates: Uncoordinated updates can race over the same state. Neither worker may see the other's current changes. Locking or coordination prevents that overlap.
Supplied source solution: B. Edit desired configuration -> A. Validate and review the proposed change -> C. Apply the approved change -> D. Verify actual state and service health Explanation:
Edit the desired configuration before generating and reviewing the proposed change. Apply it only after validation and approval, then verify the actual state and service health. The final verification checks the result of the applied change rather than assuming successful execution proves the service is healthy. 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.
Forward between networks Distribute backend traffic Resolve a host name
Supplied source solution: Forward between networks -> B. Router; Distribute backend traffic -> A. Load balancer; Resolve a host name -> C. DNS Explanation:
Forwarding between networks maps to B, router, which selects paths for network traffic. Distributing requests across backends maps to A, load balancer. Resolving a host name maps to C, DNS. These components solve different connectivity requirements and should not be substituted for one another. Import review: The source solution is preserved above. The sample does not establish the application's ColumnMatch 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.
A new subnet overlaps an existing connected network. What should the operator do?
Correct answer:
D. Choose a non-overlapping address range
Answer Option (Which option is correct) D. Choose a non-overlapping address range Explanation:
Connected networks need an addressing plan that supports unambiguous routing. An overlapping range can conflict with an existing network and is disallowed for arrangements such as VPC peering. Choose a suitable non-overlapping range before deploying the new subnet and its routes.
Why the other options are incorrect:
A. Change commit messages: Commit messages describe recorded changes. Editing them does not change IP address allocation. The overlapping ranges remain.
B. Add a duplicate route: A duplicate route does not make overlapping destinations unique. It may add another ambiguous forwarding choice. The address plan itself needs correction.
C. Disable TLS: Disabling TLS weakens transport security. It cannot distinguish overlapping network prefixes. The subnet range must be changed.
Choose TWO settings relevant to load balancer backend readiness.
Correct answer:
A. Appropriate health-check thresholds
D. Correct health-check endpoint
Answer Option (Which option is correct) A. Appropriate health-check thresholds Answer Option (Which option is correct) D. Correct health-check endpoint Explanation:
Option A sets thresholds that determine how health observations change the backend's status. Option D ensures that the probe reaches the intended readiness endpoint. Incorrect thresholds or paths can exclude an otherwise healthy process or admit a backend that is not ready for user traffic.
Why the other options are incorrect:
B. Python variable scope: Variable scope governs access to program names. It does not specify a backend health endpoint or threshold. Load balancer readiness uses service checks.
C. Git author display name: The Git author name records who created a commit. It does not control whether a backend passes its health probe. The probe configuration must reflect actual readiness.
An IaC rule should allow HTTPS while blocking other inbound ports. Which resource fits?
Correct answer:
B. Firewall rule
Answer Option (Which option is correct) B. Firewall rule Explanation:
A firewall or security-group rule controls inbound traffic by criteria such as protocol, port, and source. Permit the required HTTPS traffic and retain the appropriate default or explicit denial for other inbound access. The exact rule syntax and stateful behavior depend on the selected network platform.
Why the other options are incorrect:
A. Git tag: A Git tag labels source history. It does not allow or block inbound network ports. Network enforcement requires a traffic rule.
C. Artifact digest: An artifact digest identifies exact built content. It does not filter incoming connections. The HTTPS-only requirement belongs to network policy.
D. A function parameter: A function parameter carries input data. By itself it does not enforce packet filtering. A configured firewall resource must implement the rule.
Get exam-ready with a timed AT0 001 CompTIA AutoOps+ V1 mock exam designed to match the official exam's question format, question count, and time limit.