200-301 exam dumps

200-301 practice question 505 of 506

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

200-301 Question 505

Select 3

You are troubleshooting an API response from a web server that provides JSON-encoded data. The response contains the following JSON object:

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

Which of the following statements about the JSON structure are correct?

  1. A

    The value of the key 'hostname' is a string.

  2. B

    The 'interfaces' key holds a JSON object.

  3. C

    The JSON structure is invalid because it contains an array.

  4. D

    The 'device' key holds another JSON object.

  5. E

    Each item in the 'interfaces' array is a JSON object.

Show answer and explanation

Correct answers: A, D, E

Explanation

In JSON, data is represented in key-value pairs, with values being strings, numbers, objects, arrays, or other valid JSON types. The provided JSON structure is valid and follows the correct syntax. The key 'hostname' holds a string, 'device' holds a JSON object, and 'interfaces' is an array of JSON objects.

  • A. Correct.

    Correct. The value of 'hostname' is clearly a string, as it is enclosed in double quotes.

  • B. Incorrect.

    Incorrect. The 'interfaces' key holds an array, not a JSON object. Arrays in JSON are enclosed in square brackets.

  • C. Incorrect.

    Incorrect. The JSON structure is valid. Arrays are a standard data type in JSON and are properly used in this example.

  • D. Correct.

    Correct. The 'device' key holds another JSON object, as indicated by the curly braces enclosing its value.

  • E. Correct.

    Correct. Each item in the 'interfaces' array is a JSON object, as evidenced by the curly braces around the key-value pairs within the 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