Cisco Certified Network Associate (CCNA) 200-301 Practice Test 70
Question 690
A Terraform configuration and its tracked state were reconciled after a plan unexpectedly proposed destroying an in-use network resource. Before anyone applies another change, which action most directly verifies that the unintended deletion is no longer proposed?
- Run `terraform apply -auto-approve` and assume the result is safe if no CLI error appears.
- Run an unrelated Ansible playbook and inspect only its `ok` task count.
- Run `terraform plan` and inspect the resource diff, confirming there is no unexpected `destroy` or replacement action for the live resource.
- Read `terraform output` values without checking the planned actions or tracked resource change set.
Explanation
Correct Answer
C:Terraform evaluates configuration against refreshed real-world state and tracks planned create, update, replace or destroy operations. An inspected `terraform plan` is the direct opportunity to catch or confirm removal of an unintended deletion proposal before applying.
Incorrect Answers
A:Blindly applying a plan that proposes resource deletion could cause an outage. The proper safe checkpoint is review of the planned diff before making modifications, not applying without operator inspection.
B:Ansible results describe that playbook and its managed tasks, not Terraform's resource graph or planned deletes. An Ansible `ok` result cannot validate a Terraform state correction.
D:`terraform output` reads declared output values and does not list every planned infrastructure change. It can remain unchanged even while a pending plan would destroy an unrelated resource.
Question 691
The ACL automation was changed to compare the existing rules before applying updates. It is run once to install the approved permit and then repeated with identical input. Which observation best establishes idempotence for the second execution?
- The first playbook run reports tasks with `changed=1`, without examining the switch afterward.
- The automation inventory includes all intended switches, but no repeat operation was performed.
- Terraform shows a clean plan for a cloud resource not controlled by the ACL playbook.
- The second run reports no ACL changes and `show access-lists 120` still contains exactly one correct permit entry.
Explanation
Correct Answer
D:The defining property is that repeating the identical desired-state operation produces no additional change. If the second run records zero ACL updates and a fresh device inspection still finds exactly one approved permit, both tool feedback and actual configuration agree. This proves the prior blind-append behavior was corrected for the test case. It differs from diagnosing non-idempotence, which relied on the duplicate produced by the old script. Running a repeat test in a safe environment catches this class of automation regression.
Incorrect Answers
A:A change reported on the first run is expected when the desired ACL entry was initially missing; it does not test what happens when the same automation is executed again. Idempotence concerns repeatability after the state has converged. A script might correctly make its first change but append duplicates on every later run. The second-run result and actual ACL contents must be inspected together so a misleading zero-change report or silent duplicate cannot pass the test.
B:Inventory validation is important to avoid applying a policy to the wrong switches, but accurate targeting alone cannot establish that repeated configuration updates are safe. The same correct device set could receive a duplicate permit on each execution. Because the defect was a duplicate line after rerun, the acceptance check must perform that rerun and compare the installed ACL state. Host selection is an independent operational prerequisite rather than proof of idempotence.
C:A Terraform plan can be an idempotence-related check for infrastructure managed through Terraform state, but the ACL update here is a device-level script or Ansible task. A clean plan for an unrelated cloud resource does not show whether `show access-lists 120` contains one rule or two. The test must use the same automation and target device as the original fault, repeating the exact inputs and reading the resulting access list.
Question 692
After replacing an inappropriate Terraform plan with an Ansible network playbook, operations must confirm that a read-only `show interfaces status` command runs against each of 20 IOS switches without changing their configuration. Which acceptance evidence demonstrates the corrected workflow?
- A Terraform plan displays no resource deletions but provides no live interface CLI output.
- The Ansible network task successfully collects the interface-status output from all target switches and reports no configuration changes.
- An Ansible playbook modifies switch ACL entries even though the request was read-only.
- The device inventory file exists, without proving credentials or show-command execution.
Explanation
Correct Answer
B:The goal is operational data collection across the existing network. Successful read-only command output from every targeted IOS host establishes that the transport, inventory and automation module meet the purpose.
Incorrect Answers
A:A clean Terraform resource plan says nothing about whether the required IOS operational CLI command ran on the switches.
C:Unexpected ACL modifications violate the explicit read-only requirement and represent a dangerous automation side effect.
D:Inventory presence is necessary for targeting but cannot prove successful access, CLI command execution or collected output.
Question 693
A device API returns `{"interfaces":[{"name":"Gi0/1"},{"name":"Gi0/2"}]}`. A parser must access the list of interface objects rather than treat it as one field map. Which interpretation of the JSON delimiters is correct?
- The outer `{...}` is an object with an `interfaces` property; its `[...]` value is an array containing two `{...}` objects.
- The outer braces are an array and the square brackets contain one string scalar.
- Every `{...}` contains a JSON boolean and cannot represent named properties.
- The two interface entries are separated by XML tags instead of JSON objects.
Explanation
Correct Answer
A:JSON objects use braces around named key-value pairs, while arrays use brackets for ordered elements. A client reads the `interfaces` property, iterates its array elements, and then retrieves each object’s `name` key. Treating the array as a single object confuses collection and mapping types.
Incorrect Answers
B:The delimiters have the opposite documented meanings, and the bracketed value contains two object elements.
C:The example braces surround string-keyed objects, not boolean literals.
D:The payload is JSON and uses braces, brackets, colons and commas; there are no XML tags.
Question 694
A device API returns the JSON value `{"retry":3,"enabled":false,"label":"false","owner":null}`. An automation parser must distinguish booleans, numbers, quoted strings and null. Which statement about the parsed fields is correct?
- `retry` is numeric, `enabled` is boolean false, `label` is a string containing the text false, and `owner` is null.
- All values are strings because a JSON document is transferred as text over HTTP.
- `enabled` and `label` are both booleans because both visually contain the word false.
- `owner` is the string "null" and `retry` is the Boolean value true because it is nonzero.
Explanation
Correct Answer
A:JSON defines distinct literal types. In the given object, the unquoted 3 is a number, unquoted false is a Boolean literal, quoted "false" is a string, and unquoted null is the null literal. These distinctions survive correct parsing and can affect program logic: for example, nonempty text containing the letters false may be truthy in JavaScript even though the boolean false is not. Validate schema-defined types before applying a network configuration or feature flag. A syntactically valid JSON document can still have a semantically wrong value type, so parsing and schema validation are separate safeguards.
Incorrect Answers
B:JSON is transported as a textual representation, but a conforming parser converts its tokens into typed values according to the format rules. Unquoted number, boolean and null tokens do not become strings merely because their source document consists of bytes. The quotes around the `label` value are what make that field a string.
C:The characters f-a-l-s-e appear in both fields, but syntax matters. The unquoted token false is a Boolean; the quoted text "false" is a string with five characters. Treating them as the same can make feature flags behave unexpectedly in languages with truthiness coercion.
D:The null literal is not the same as a quoted string containing the letters null. Likewise JSON numeric 3 is still a number, not automatically a true Boolean, even if some programming-language conditionals treat nonzero numbers as truthy. Type validation must use actual parsed types, not casual truthiness equivalences.
Question 695
An automation tool must send the JSON object `{"device":{"description":"core \"A\""}}`, where the description value should literally contain the quote characters around A. Which JSON construction correctly preserves the nested field and its embedded quotes?
- Send `{device:{description:"core "A""}}` with unquoted property names and unescaped internal quotes.
- Use a `device` object whose `description` string escapes embedded quotation marks as `\"`, producing the value `core "A"` when decoded.
- Wrap the description string in raw single quotes because JSON always accepts single-quoted strings.
- Change `device` into an array of standalone words and omit its `description` key entirely.
Explanation
Correct Answer
B:A nested JSON property is accessed by its full object path. Double quotes delimit JSON strings, so any quotation mark inside the value must be escaped in the serialized JSON. Proper escaping makes the document parseable and yields the intended human-readable description.
Incorrect Answers
A:Strict JSON requires quoted object keys and escaped quotation marks within a string value.
C:JSON strings must use double quotes; a single-quoted token is not valid JSON syntax.
D:That loses the requested nested property mapping and cannot represent the prescribed field.
Question 696
An API sends `[ {"name":"Gi0/1"}, {"name":"Gi0/2"} ]` as its complete valid JSON body. A client tries to read `response.name` as if the top level were an object; the application never visits either interface. What is the shape error?
- The response is invalid solely because its array contains two objects rather than one.
- The API returned the string "false", so JavaScript truthiness caused this access failure.
- The presence of curly braces anywhere requires accessing the whole document as one object with a `name` field.
- The top level is an array of objects; iterate its elements and read each element’s `name` key instead of accessing `name` on the array itself.
Explanation
Correct Answer
D:The JSON text is syntactically valid, so reparsing the same string will not fix the application’s data-model assumption. Arrays hold elements at indexes; the desired `name` properties are on those element objects, not on the top-level collection.
Incorrect Answers
A:JSON arrays may contain multiple object values; that is not a syntax error.
B:No `enabled` field or truthy string is present; the failure is a top-level array/object mismatch.
C:Nested element objects do not change the outer square-bracket collection into a keyed mapping.
Question 697
A device-monitoring API returns JSON `{"enabled":"false"}`. The controller's JavaScript client checks `if (config.enabled)` and incorrectly activates the monitoring feature even though the value appears to say false. What is the immediate defect?
- A trailing comma makes the JSON document invalid and prevents all parsing.
- The API returned HTTP 403 because the user lacks authorization for this device.
- The client treats the nonempty string value "false" as truthy instead of a JSON boolean false.
- The client received a JSON array but attempted to read a dictionary key called `enabled`.
Explanation
Correct Answer
C:In JSON, unquoted `false` is a boolean literal, but quoted `"false"` is a string containing five characters. After parsing in JavaScript, a nonempty string is truthy, so `if (config.enabled)` enters its branch even though a human reads the word false. The server should send a boolean when the schema says boolean, and the client should validate the parsed type rather than trust visually similar text. This diagnosis is separate from an acceptance test that verifies the parsed type and branch outcome.
Incorrect Answers
A:JSON does not permit trailing commas, which would make a payload syntactically invalid for strict parsers. The supplied document has no trailing comma and parses successfully. The error occurs only afterward, when the application interprets the parsed value of `enabled`. Fixing JSON syntax would not change a nonempty string into a boolean. The decisive clue is that the value is quoted; the client needs an explicit boolean or a validated conversion step, not a generic parser cleanup.
B:An HTTP 403 response means the server rejected an authorized-operation request due to insufficient permissions; in contrast, this scenario supplies a successfully received JSON document that the client has already parsed. A scope or token failure would normally prevent the client from obtaining the configuration body as described. The unwanted feature activation is a local value-interpretation problem rather than API access control. Inspect the runtime type of the parsed `enabled` field before revising authorization tokens or permission scopes.
D:Accessing a property on a JSON array instead of an object can lead to missing or undefined fields, but the sample payload is a valid JSON object with an `enabled` property. The bug is not an array-versus-object shape mismatch: the property exists and is read, yet its string type leads to the wrong condition result. Inspect the schema and value type rather than changing the parser to treat the whole configuration as an array.
Question 698
An HTTP response body is supposed to be JSON, but the producer sends `{"interfaces":["Gi0/1","Gi0/2",]}`. A strict parser rejects the payload before the application can inspect interface names. Which syntax error must be corrected?
- Replace the JSON square brackets with angle brackets to represent an array of interfaces.
- Add a semicolon after each interface name because JSON arrays are separated by semicolons.
- Change the object braces to parentheses, leaving the trailing comma in place.
- Remove the comma following the final array element so the array closes immediately after `"Gi0/2"`.
Explanation
Correct Answer
D:RFC 8259 defines JSON array elements separated by commas, but its grammar does not permit a comma after the final element before the closing bracket. The response `{"interfaces":["Gi0/1","Gi0/2",]}` therefore fails strict JSON parsing. Remove the trailing comma to produce `{"interfaces":["Gi0/1","Gi0/2"]}`. Validate the resulting document with a standards-compliant parser and separately check any API schema expected by the consumer. A lenient tool that accepts nonstandard JSON does not prove interoperability across strict networking clients. The failure is syntactic and occurs before any interface operational state is checked.
Incorrect Answers
A:Square brackets delimit JSON arrays; angle brackets are not JSON array grammar. Changing them would introduce a different syntax error rather than fix the extra separator. The valid object uses braces for its named `interfaces` member and square brackets for the ordered list of names.
B:JSON array elements are separated by commas, not semicolons. The defect is the one extra comma after the last element, not missing terminators after each item. Substituting semicolons would make the payload less compatible with strict JSON parsers and violate the published array grammar.
C:Braces are the correct delimiters for a JSON object containing a named key, and parentheses are not a JSON structural delimiter. Keeping the trailing comma would also preserve the original parse error. Repair the array's final separator while retaining the object and array nesting.
Question 699
A REST response contains a JSON array of interface objects, not one object with named interface properties. An earlier client tried to access the list as a mapping and failed. After correcting the parser, what validation proves the response shape is handled correctly?
- Validate only that the JSON is syntactically valid, ignoring whether the top level is an array or object.
- Read a single top-level `interfaces.name` key even though the response contains no such mapping.
- Convert the JSON array to an unquoted CSV string without preserving interface fields.
- Parse the top-level `[...]` array, iterate its object elements and read each interface `name` field without a type error.
Explanation
Correct Answer
D:A syntactically correct JSON list still requires array indexing or iteration. Iterating its object members and extracting expected keys validates the corrected data-type handling that the original client lacked.
Incorrect Answers
A:Both arrays and objects can be valid JSON, so a generic syntax pass cannot establish that the application handles the actual top-level collection type.
B:Dotted property access on a nonexistent top-level mapping repeats the original parser mistake.
C:Destroying structured JSON values does not establish correct parsing of each interface object in a typed collection.
Question 700
The API producer changes its response from `{"enabled":"false"}` to `{"enabled":false}` and the client now validates the schema. Which test most directly proves that the feature-flag type issue was fixed?
- Parse the response, assert `typeof config.enabled === "boolean"`, confirm its value is false, and observe that the feature remains disabled.
- Run the Ansible playbook twice and confirm no configuration changes on the second pass.
- Inspect an Ansible job recap for `failed=0`, without checking the API response at all.
- Verify only that the JSON text passes syntactic validation, even if the `enabled` value is still quoted.
Explanation
Correct Answer
A:The contract requires a JSON boolean rather than the string containing the letters false. After parsing, the JavaScript runtime type should be boolean, the value should be false, and the dependent feature should remain disabled. Testing all three prevents a false pass in which syntactically valid JSON still uses the wrong type or the application ignores the flag. It provides direct acceptance evidence for the previous truthiness defect, whereas an automation-run status or simple syntax check would not demonstrate the feature's behavior.
Incorrect Answers
B:A second identical Ansible run with no changes can be evidence of idempotent configuration automation, but this incident is a JSON data-contract and JavaScript runtime-type problem. Ansible repeatability says nothing about whether the API returned a boolean literal or a quoted string. The monitoring feature might still activate incorrectly while Ansible correctly reports no changes. To validate this fix, test the parsed `enabled` field, the correct runtime type, and the resulting enabled/disabled branch.
C:An Ansible recap showing `failed=0` indicates that a set of tasks completed without recorded failures for its selected hosts. It does not inspect the API payload that triggered this bug, and the task might not even contact the monitoring client. The client could still misinterpret a nonempty string while network automation succeeds. A relevant regression test must parse the response and assert the schema-defined type and behavior, not rely on a success message from an unrelated workflow.
D:Both `{"enabled":"false"}` and `{"enabled":false}` are syntactically valid JSON documents. A syntax-only validator therefore accepts the defective representation and cannot establish whether the `enabled` field satisfies the required boolean schema. Because the production issue arose after successful parsing, the test must check semantic type and application behavior. A schema validator or runtime type assertion would distinguish the quoted string from the boolean literal, then a feature-state test confirms the correct branch.