200-301 exam dumps

200-301 practice question 502 of 506

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

200-301 Question 502

Select 3

You are troubleshooting an API response from a web service that returns data in JSON format. The response includes the following snippet:

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

Which of the following statements correctly identify components of the JSON data?

  1. A

    "device" is a JSON object.

  2. B

    "interfaces" is an array containing JSON objects.

  3. C

    "status" is a key in the "interfaces" objects and has a value of type boolean.

  4. D

    "hostname" is a key in the "device" object and its value is a string.

Show answer and explanation

Correct answers: A, B, D

Explanation

JSON data is structured with key-value pairs. Objects are enclosed in curly braces {}, arrays are enclosed in square brackets [], and values can be strings, numbers, booleans, null, objects, or arrays. Analyzing the structure of the provided JSON snippet, the correct answers identify the components accurately.

  • A. Correct.

    "device" is a JSON object because it contains key-value pairs enclosed in curly braces {}.

  • B. Correct.

    "interfaces" is an array because it is a list of items enclosed in square brackets []. Each item in the array is a JSON object.

  • C. Incorrect.

    "status" is a key in the "interfaces" objects, but its value is a string (e.g., "up" or "down"), not a boolean.

  • D. Correct.

    "hostname" is a key in the "device" object, and its value is indeed a string ("router1").

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