200-301 exam dumps

200-301 practice question 503 of 506

Cisco Certified Network Associate. Free level, Cisco. Free question with the correct answer and a full explanation.

200-301 Question 503

Select 3

You are troubleshooting an API call that returns the following JSON data:

{ "device": { "hostname": "Router1", "interfaces": [ { "name": "GigabitEthernet0/1", "status": "up" }, { "name": "GigabitEthernet0/2", "status": "down" } ] } }

Which of the following statements correctly identifies components of this JSON-encoded data?

  1. A

    "device" is a JSON object.

  2. B

    "interfaces" is a JSON array.

  3. C

    "status" is a JSON object.

  4. D

    "hostname" is a JSON key with a string value.

  5. E

    "name" is a JSON array.

Show answer and explanation

Correct answers: A, B, D

Explanation

JSON data is structured with key-value pairs, objects (enclosed in curly braces), arrays (enclosed in square brackets), and primitive values like strings, numbers, and booleans. In this scenario, "device" is a JSON object containing nested data, "interfaces" is a JSON array containing multiple objects, and "hostname" is a JSON key with a string value. Understanding how to identify these components is crucial for interpreting JSON data in network automation and API interactions.

  • A. Correct.

    Correct: The key "device" contains a set of key-value pairs enclosed within curly braces, making it a JSON object.

  • B. Correct.

    Correct: The key "interfaces" contains multiple objects enclosed in square brackets, making it a JSON array.

  • C. Incorrect.

    Incorrect: The key "status" contains a string value ("up" or "down"), not a set of key-value pairs, so it is not a JSON object.

  • D. Correct.

    Correct: The key "hostname" contains a single string value ("Router1"), making it a JSON key with a string value.

  • E. Incorrect.

    Incorrect: The key "name" contains a string value (e.g., "GigabitEthernet0/1"), not an array, so it is not a JSON array.

Timed practice exam

Take a 200-301 practice test under exam conditions

75 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam