Which statement best contrasts YAML with JSON?
Answer choices
Why each option matters
Good practice is not just finding the correct option. The wrong answers often show the exact trap the exam wants you to fall into.
Best answer
YAML is commonly more human-readable, while JSON is widely used in APIs
Correct. This is the most accurate contrast among the choices.
Distractor review
YAML can represent only arrays, while JSON can represent only strings
Both formats can represent far more than arrays or strings only.
Distractor review
JSON requires indentation but YAML requires curly braces
The description reverses the typical syntax characteristics.
Distractor review
YAML is a routing protocol and JSON is an access method
Neither YAML nor JSON is a routing protocol or an access method.
Common exam trap
Common exam trap: answer the scenario, not the keyword
A frequent exam trap is the misconception that JSON requires indentation and YAML requires curly braces, which reverses their actual syntax characteristics. This confusion arises because YAML uses indentation to define structure without braces, making it more human-readable, while JSON relies on braces and brackets to denote objects and arrays. Misunderstanding this can lead to errors when writing or reading automation scripts, causing failures in network programmability tasks. Candidates must avoid mixing these syntax rules and remember that YAML's design prioritizes readability, whereas JSON prioritizes machine parsing and API compatibility.
Technical deep dive
How to think about this question
YAML (YAML Ain't Markup Language) and JSON (JavaScript Object Notation) are both data serialization formats widely used in network automation and programmability, key topics in the CCNA 200-301 exam. YAML is designed to be highly human-readable and writable, using indentation and minimal syntax to represent complex data structures such as mappings, sequences, and scalars. JSON, on the other hand, uses a more rigid syntax with braces, brackets, and quotes, making it less visually intuitive but highly compatible with programming languages and APIs. The decision to use YAML or JSON in Cisco network automation often depends on the context. YAML's readability makes it ideal for configuration files and templates where network engineers manually edit data, such as Ansible playbooks or Cisco DNA Center templates. JSON is preferred for API payloads and programmatic data exchange because it is lightweight, easy to parse, and supported natively by many programming environments. Understanding this distinction helps in selecting the right format for automation tasks and interpreting data during network programmability. A common exam trap is confusing the syntax and use cases of YAML and JSON, such as assuming JSON requires indentation or that YAML uses braces. This misunderstanding can lead to errors in automation scripts or misinterpretation of configuration files. Practically, network engineers must recognize that YAML's indentation-based structure enhances human readability, while JSON's strict syntax ensures consistent machine parsing, both critical for effective network automation and programmability workflows.
KKey Concepts to Remember
- YAML uses indentation to represent data structures, making it more human-readable and easier for network engineers to edit manually.
- JSON uses braces and brackets to define objects and arrays, which makes it ideal for machine parsing and API data exchange.
- Network automation tools like Ansible often use YAML for playbooks because of its clarity and simplicity in representing configurations.
- APIs commonly use JSON as the data format because it is lightweight and supported natively by many programming languages.
- Understanding the syntax differences between YAML and JSON prevents errors in network programmability and automation scripts.
- YAML supports complex data types including mappings and sequences without requiring explicit delimiters like braces.
- JSON's strict syntax rules ensure consistent parsing but can be less readable for manual editing compared to YAML.
- Choosing between YAML and JSON depends on whether human readability or programmatic compatibility is the priority in network automation.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Related practice questions
Related 200-301 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
CCNA subnetting practice questions
Practise IPv4 subnetting, CIDR, masks, host ranges and subnet selection.
CCNA OSPF practice questions
Practise OSPF neighbours, router IDs, metrics, areas and routing-table interpretation.
CCNA VLAN practice questions
Practise VLANs, access ports, trunks, allowed VLANs and switching scenarios.
CCNA STP practice questions
Practise spanning tree, root bridge election, port roles and STP troubleshooting.
CCNA EtherChannel practice questions
Practise LACP, PAgP, port-channel behaviour and bundle requirements.
CCNA ACL practice questions
Practise standard and extended ACLs, permit/deny logic and traffic filtering.
CCNA NAT practice questions
Practise static NAT, dynamic NAT, PAT and inside/outside address translation.
CCNA DHCP practice questions
Practise DHCP scopes, relay, leases and troubleshooting.
CCNA show ip route practice questions
Practise routing-table output, longest-prefix match, AD and route selection.
CCNA show interfaces trunk practice questions
Practise trunk verification and VLAN forwarding across switches.
CCNA wireless security practice questions
Practise WLAN security, authentication and wireless architecture concepts.
CCNA IPv6 practice questions
Practise IPv6 addressing, routes, neighbour discovery and common IPv6 exam traps.
More questions from this exam
Keep practising from the same exam bank, or move into a focused topic page if this question exposed a weak area.
Question 1
A router learns the same prefix from both OSPF and EIGRP. Which route is installed by default?
Question 2
A router shows this output: R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 10.1.1.2 1 FULL/DR 00:00:34 192.168.12.2 GigabitEthernet0/0 10.1.1.3 1 2WAY/DROTHER 00:00:39 192.168.12.3 GigabitEthernet0/0 Which statement is correct?
Question 3
What is the OSPF metric called?
Question 4
A non-root switch has two uplinks toward the root bridge. One path has a lower total STP cost than the other. What role will the lower-cost uplink have?
Question 5
A router interface applies this ACL inbound: 10 deny tcp any any eq 80 20 permit ip any any A user reports that web browsing to a server by IP address fails, but ping works. Which statement best explains the behavior?
Question 6
A router learns route 198.51.100.0/24 from OSPF with AD 110 and also has a static route to the same prefix configured with AD 150. Which route is installed?
FAQ
Questions learners often ask
What does this 200-301 question test?
YAML uses indentation to represent data structures, making it more human-readable and easier for network engineers to edit manually.
What is the correct answer to this question?
The correct answer is: YAML is commonly more human-readable, while JSON is widely used in APIs — YAML is often chosen because it is relatively easy for humans to read and edit. JSON is also readable but is especially common in API payloads and programmatic data exchange.
What should I do if I get this 200-301 question wrong?
Then try more questions from the same exam bank and focus on understanding why the wrong options are tempting.
Discussion
Sign in to join the discussion.