CCNA AI and Network Operations Practice Question
Given the JSON snippet below, what is the value of hostname?
{
"device": {
"hostname": "R1",
"mgmt_ip": "192.0.2.10"
}
}⚠ Common exam trap
Be careful not to confuse keys with their values in JSON objects. Ensure you are extracting the correct value by identifying the correct key.
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
✓
R1
The key hostname inside the device object has the value R1.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
device
Why it's wrong here
In the JSON hierarchy, "device" is the top-level object (a dictionary) that contains the hostname and management IP keys. It is not a scalar value; therefore, asking for the value of hostname would refer to a property within this object, not the object identifier itself. The string "device" appears only as a key in the object.
When this WOULD be correct
If the question asked for the top-level key in the JSON snippet, such as 'What is the main object in the JSON structure?', then 'device' would be the correct answer as it represents the primary object containing the hostname.
- ✗
hostname
Why it's wrong here
"hostname" is the key (property name) in the JSON object, not the value. In a key-value pair, the key is on the left side of the colon, and the value is on the right. The question asks for the value, so the answer must be the data associated with that key.
When this WOULD be correct
In a different question that asks for the name of the key in the JSON structure rather than its value, 'hostname' would be the correct answer. For example, if the question were to identify the key associated with the value 'R1', then option B would be appropriate.
- ✓
R1
Why this is correct
In JSON, the hostname key maps to the string value "R1", so when the snippet is parsed, the expression device.hostname returns R1. This is the actual configured hostname of the network device, as opposed to the key name or other attributes.
- ✗
192.0.2.10
Why it's wrong here
This IP address is the value of a separate property, likely "management_ip" or "mgmt_ip", inside the same object. It is not the hostname value. In JSON, the hostname and management IP are distinct attributes; if the snippet uses the format shown, only the string associated with the hostname key is the correct answer.
When this WOULD be correct
If the question were to ask for the value of 'mgmt_ip' instead of 'hostname', then '192.0.2.10' would be the correct answer. In that case, the focus would shift to the management IP address of the device.
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.
✓R1Correct answer▾
Why this is correct
In JSON, the hostname key maps to the string value "R1", so when the snippet is parsed, the expression device.hostname returns R1. This is the actual configured hostname of the network device, as opposed to the key name or other attributes.
✗deviceWrong answer — click to see why▾
Why this is wrong here
The option 'device' is incorrect because it refers to the key in the JSON structure, not the value associated with the 'hostname' key. The question specifically asks for the value of 'hostname'.
★ When this WOULD be the correct answer
If the question asked for the top-level key in the JSON snippet, such as 'What is the main object in the JSON structure?', then 'device' would be the correct answer as it represents the primary object containing the hostname.
Why candidates choose this
Candidates may be tempted to choose 'device' because it is a prominent part of the JSON structure and could be misinterpreted as the answer when focusing on the overall organization of the data.
✗hostnameWrong answer — click to see why▾
Why this is wrong here
Option B is incorrect because it simply repeats the key 'hostname' from the JSON structure without providing the actual value associated with it, which is what the question asks for.
★ When this WOULD be the correct answer
In a different question that asks for the name of the key in the JSON structure rather than its value, 'hostname' would be the correct answer. For example, if the question were to identify the key associated with the value 'R1', then option B would be appropriate.
Why candidates choose this
Candidates might choose this option because they misinterpret the question as asking for the name of the field rather than the value it holds, leading to confusion between keys and values in JSON.
✗192.0.2.10Wrong answer — click to see why▾
Why this is wrong here
This option is wrong because the question specifically asks for the value of 'hostname', which is defined as 'R1' in the JSON snippet. '192.0.2.10' is the value of 'mgmt_ip', not 'hostname'.
★ When this WOULD be the correct answer
If the question were to ask for the value of 'mgmt_ip' instead of 'hostname', then '192.0.2.10' would be the correct answer. In that case, the focus would shift to the management IP address of the device.
Why candidates choose this
Candidates may be tempted to choose this option because they might confuse the structure of the JSON and mistakenly associate 'mgmt_ip' with 'hostname', thinking both are equally relevant.
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?”
Go deeper
Related to this question
About these practice questions
One of 1,389 original 200-301 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.