Based on the JSON snippet below, which statement is correct?
{
"device": {
"hostname": "R1",
"interfaces": [
{"name": "Gig0/0", "status": "up"},
{"name": "Gig0/1", "status": "down"}
]
}
}{
"device": {
"hostname": "R1",
"interfaces": [
{"name": "Gig0/0", "status": "up"},
{"name": "Gig0/1", "status": "down"}
]
}
}Based on the JSON snippet below, which statement is correct?
{
"device": {
"hostname": "R1",
"interfaces": [
{"name": "Gig0/0", "status": "up"},
{"name": "Gig0/1", "status": "down"}
]
}
}Answer choices
Good practice is not just finding the correct option. The wrong answers often show the exact trap the exam wants you to fall into.
device is a JSON array.
device is enclosed in braces, so it is an object.
interfaces is a JSON array containing two objects.
Square brackets indicate an array, and each entry inside is an object.
status is a JSON array with two strings.
Each status value is a simple string inside an object.
hostname is a nested array under interfaces.
hostname is a string field inside the device object.
Common exam trap
A frequent exam trap is misidentifying the JSON structure by assuming that "interfaces" is an object rather than an array. Since "interfaces" contains multiple entries, it must be an array, indicated by square brackets. Another pitfall is thinking "device" is an array because it contains multiple keys, but it is actually an object enclosed in curly braces. Misreading "status" as an array of strings instead of a string value inside each interface object can also cause confusion. These mistakes stem from not carefully noting the JSON syntax, which is critical for understanding device data representation in Cisco automation and APIs.
Technical deep dive
JSON (JavaScript Object Notation) is a lightweight data-interchange format widely used in network device configurations and APIs, including Cisco devices. It represents data as key-value pairs within objects (curly braces) and arrays (square brackets). In this snippet, the "device" is a JSON object containing a "hostname" string and an "interfaces" array. Each element in the "interfaces" array is itself an object describing an interface's name and status, reflecting how network devices often represent interface states programmatically. Understanding the structure of JSON is crucial for interpreting device configurations and automation scripts in Cisco networking. The "interfaces" key holds an array because it lists multiple interface objects, each with properties like "name" and "status." This array format allows Cisco automation tools and APIs to process multiple interfaces efficiently. The "device" key is an object because it groups related properties, such as hostname and interfaces, under a single entity, mirroring how Cisco IOS groups device-level settings. A common exam trap is confusing arrays with objects or misinterpreting nested structures. For example, mistaking "interfaces" as an object instead of an array leads to misunderstanding how multiple interfaces are represented. Practically, Cisco network engineers use JSON arrays to handle multiple interfaces or ACL entries, making it essential to recognize arrays by square brackets and objects by curly braces. This distinction impacts how configurations are parsed and applied in automation and scripting contexts.
Related practice questions
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Practise IPv4 subnetting, CIDR, masks, host ranges and subnet selection.
Practise OSPF neighbours, router IDs, metrics, areas and routing-table interpretation.
Practise VLANs, access ports, trunks, allowed VLANs and switching scenarios.
Practise spanning tree, root bridge election, port roles and STP troubleshooting.
Practise LACP, PAgP, port-channel behaviour and bundle requirements.
Practise standard and extended ACLs, permit/deny logic and traffic filtering.
Practise static NAT, dynamic NAT, PAT and inside/outside address translation.
Practise DHCP scopes, relay, leases and troubleshooting.
Practise routing-table output, longest-prefix match, AD and route selection.
Practise trunk verification and VLAN forwarding across switches.
Practise WLAN security, authentication and wireless architecture concepts.
Practise IPv6 addressing, routes, neighbour discovery and common IPv6 exam traps.
Keep practising from the same exam bank, or move into a focused topic page if this question exposed a weak area.
Question 1
Question 2
Question 3
Question 4
Question 5
Question 6
FAQ
A JSON object uses curly braces to group related key-value pairs representing a single entity or configuration block.
The correct answer is: interfaces is a JSON array containing two objects. — The value associated with interfaces is an array because it is enclosed in square brackets and contains multiple objects. The device element itself is an object, and each interface entry inside the array is also an object.
Then try more questions from the same exam bank and focus on understanding why the wrong options are tempting.
Sign in to join the discussion.