JN0-224 practice question 7 of 15

YAML uses which two data structures? (Choose two.)

Full set: 66 questions
Answer options
A: arrays
B: mappings Correct answer
C: sequences Correct answer
D: objects
Correct Answer:
B. mappings; C. sequences
Explanation

YAML (YAML Ain't Markup Language) is a human-readable data serialization standard that structures data using two primary constructs. The first is a mapping, which represents key-value pairs, analogous to dictionaries or hashes in programming languages. The second is a sequence, which represents an ordered list of items, analogous to arrays. These two structures can be combined and nested to create complex, hierarchical data models, which is fundamental for automation tasks like defining configurations or variables in a Juniper environment.

Why Incorrect

A. arrays: While conceptually identical to a sequence, "array" is a term from programming languages like JavaScript, not the official term used in the YAML specification.
D. objects: While conceptually identical to a mapping, "object" is a term from programming languages like JavaScript, not the official term used in the YAML specification.

References

1. YAML Ain't Markup Language (YAML™) Version 1.2 (3rd Edition, 2009-10-01), Section 1.2, "Introduction". The specification states, "YAML’s core data structures are mappings (key/value pairs), sequences (lists/arrays), and scalars (strings/numbers)." This document is the primary standard for YAML.

2. Juniper Networks TechLibrary, Automation, "Data Serialization and Deserialization". In the section describing YAML, the documentation explicitly states: "YAML represents data using two main types of structures: Mappings (key-value pairs)... Sequences (lists)." This confirms the terminology used within the official Juniper context.

3. Juniper Networks, Junos OS Automation Scripting User Guide, Chapter: "Understanding the Structure of a Salt State File". In its description of SLS files (which use YAML), it explains the use of "mappings (dictionaries)" and "sequences (lists)", reinforcing the correct terminology for the JN0-224 domain.

Scroll to Top