Courseiva
Question 1,694 of 1,389
AI and Network OperationsmediumMultiple ChoiceObjective-mapped

JSON Array of Objects in Controller API Responses

A controller API returns this data:

{
  "device": {
    "hostname": "Dist-1",
    "interfaces": [
      {"name": "Gig0/0", "status": "up"},
      {"name": "Gig0/1", "status": "down"}
    ]
  }
}

Which statement is correct?

Quick Answer

The answer is that the interfaces field is an array of objects. This is correct because in JSON, square brackets denote an array, and each element inside those brackets—like {"name": "Gig0/0", "status": "up"}—is wrapped in curly braces, making it an object with key-value pairs. On the CCNA 200-301 v2 exam, this type of question tests your ability to interpret JSON array of objects interface data returned by a controller API, a skill essential for automation topics. A common trap is confusing the outer device object with the inner array; remember that the hostname field is a single value, while the interfaces field holds multiple records. A helpful memory tip is to think of square brackets as a shopping list (array) and curly braces as the individual items on that list (objects).

⚠ Common exam trap

Be careful not to confuse JSON arrays with objects or strings. Pay attention to the brackets and braces used.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The interfaces field is an array of objects

The interfaces field is an array of objects. The giveaway is the square brackets around the interface entries. In JSON, square brackets represent an array, and braces represent an object. Each interface entry inside that array has key-value pairs such as name and status, which makes each entry its own object. In plain language, the controller is returning a list of interface records for one device. The hostname field, by contrast, is a single value. This style of question appears in automation topics because the exam wants you to recognize common data structures used in controller APIs without requiring deep programming expertise. Understanding the difference between an object and an array is usually enough.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The response is XML because it contains nested elements

    Why it's wrong here

    XML uses opening and closing tags such as <device> and <hostname>. The exhibit does not use tags at all. Instead it uses braces, brackets, quoted keys, and values, which are the visual clues for JSON rather than XML.

    When this WOULD be correct

    If the question was framed to ask about a data format that includes nested elements and is specifically about XML, then this option could be correct. For example, a question asking about the structure of an XML response with nested tags would make this statement valid.

  • The interfaces field is an array of objects

    Why this is correct

    Correct. This is correct. The interfaces field is enclosed in square brackets, which in JSON means an array. Each item inside the array is an object containing keys such as name and status.

  • The hostname field is a list

    Why it's wrong here

    The hostname field is not a list. It contains one string value, "Dist-1". The only list-like structure shown in the data is the interfaces array.

    When this WOULD be correct

    If the question were to present a JSON object where the hostname field contained multiple values, such as 'hostname': ['Dist-1', 'Dist-2'], then the statement would be correct, as it would indeed be a list of hostnames.

  • The format shown is YAML

    Why it's wrong here

    YAML is another structured data format, but the exact symbols in the exhibit are JSON symbols. YAML would typically look different and would not rely on the same object-and-array punctuation in this form.

    When this WOULD be correct

    If a question asked about a configuration file or data representation that explicitly used YAML syntax, such as a document with key-value pairs and indentation, then this option would be correct.

Option-by-option analysis

Why each answer is right or wrong

Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The 200-301 exam frequently reuses these exact scenarios with slightly different constraints.

The interfaces field is an array of objectsCorrect answer

Why this is correct

Correct. This is correct. The interfaces field is enclosed in square brackets, which in JSON means an array. Each item inside the array is an object containing keys such as name and status.

The response is XML because it contains nested elementsWrong answer — click to see why

Why this is wrong here

This option is wrong because the response is in JSON format, not XML. JSON uses curly braces and key-value pairs, while XML uses tags to define elements.

★ When this WOULD be the correct answer

If the question was framed to ask about a data format that includes nested elements and is specifically about XML, then this option could be correct. For example, a question asking about the structure of an XML response with nested tags would make this statement valid.

Why candidates choose this

Candidates may confuse JSON's nested structure with XML's hierarchical format, leading them to mistakenly identify JSON as XML due to the presence of nested elements.

The hostname field is a listWrong answer — click to see why

Why this is wrong here

The hostname field is a string, not a list, as it contains a single value ('Dist-1') and does not represent multiple items or entries.

★ When this WOULD be the correct answer

If the question were to present a JSON object where the hostname field contained multiple values, such as 'hostname': ['Dist-1', 'Dist-2'], then the statement would be correct, as it would indeed be a list of hostnames.

Why candidates choose this

Candidates might confuse the term 'field' with the concept of a list, mistakenly thinking that any collection of data, even a single string, qualifies as a list.

The format shown is YAMLWrong answer — click to see why

Why this is wrong here

This option is wrong because the format shown in the response is JSON, not YAML. YAML uses indentation and a different syntax for data representation, which is not present here.

★ When this WOULD be the correct answer

If a question asked about a configuration file or data representation that explicitly used YAML syntax, such as a document with key-value pairs and indentation, then this option would be correct.

Why candidates choose this

Candidates may confuse JSON with YAML due to their similar use cases in data serialization, leading them to mistakenly identify the format based on the presence of nested structures.

Analysis generated from the official 200-301blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on 200-301

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A JSON response from a controller contains a list of interfaces, each with its own name and status fields. Which JSON structure is most likely used to represent that list?

hard
  • A.An array of objects
  • B.A single scalar string only
  • C.A wildcard mask
  • D.A route metric table

Why A: The most likely structure is an array containing objects. In practical terms, an array is the natural way to represent a list of similar items, and each item can then be an object with named fields such as name and status. This is a very common pattern in API payloads. The question is testing structure recognition, not programming syntax mastery.

Last reviewed: Apr 12, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This 200-301 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-301 exam.