Courseiva

JNCIA-DevOps · topic practice

Data Serialization practice questions

This domain covers data serialization formats used in Junos automation: JSON, XML, and YAML. It tests how these formats are parsed and produced by Python scripts interacting with Junos devices via NETCONF, REST, or telemetry, focusing on syntax rules, data type mapping, and structural conversion pitfalls.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Editorial oversight:Johnson Ajibi· MSc IT Security, IEEE Senior Member
20 questionsDomain: Data Serialization

What the exam tests

What to know about Data Serialization

Candidates must parse and generate JSON, XML, and YAML in Python for Junos automation, ensuring correct data type mapping and structure preservation. The most important thing is to handle format-specific rules, such as JSON's strict syntax and XML-to-JSON conversion challenges, without data loss.

Parsing Junos telemetry JSON with json.loads() and mapping JSON types to Python types

Converting Junos XML operational state from NETCONF into JSON without losing sibling elements

Identifying valid JSON syntax and data types in automation workflows

Handling JSON parsing errors such as trailing commas in configuration files

Watch out for

Common Data Serialization exam traps

  • ▸Assuming JSON keys can be integers; JSON object keys are always strings, but Python json.loads() may convert numeric-looking keys to integers.
  • ▸Forgetting that XML sibling elements with the same tag become duplicate keys in a naive JSON conversion, causing data loss.
  • ▸Believing trailing commas are allowed in JSON; they cause json.load() to raise a JSONDecodeError.

Practice set

Data Serialization questions

20 questions · select your answer, then reveal the explanation

An automation script reads a multi-document YAML file containing configuration templates for various Junos router models. To process each document individually in Python using PyYAML, which function should the engineer invoke?

An automation engineer is writing a Python script to parse a Juniper Junos NETCONF reply received in XML format and needs to convert it into a native Python dictionary for internal processing. Which built-in library should the engineer use to convert the structured XML tree?

A Python script receives a JSON payload from a Junos device containing 64-bit interface counter integers. When loaded using the standard 'json' module, the script experiences precision loss on counter values exceeding standard integer limits. Which alternative JSON parser package for Python should be used to handle high-precision integers without data degradation?

What is the primary delimiter used to separate key-value pairs in a JSON object?

Which symbol represents the beginning of a single YAML document stream?

When parsing a Junos configuration snippet in YAML, an engineer notices a string value starting with a zero (e.g., '01234') that is unquoted. How do YAML parsers typically interpret this value?

Question 7mediummultiple choice
Study the full Python automation breakdown →

An automation engineer is writing a Python script to push configurations to a Junos device. The script loads a YAML data file containing interface descriptions. One description contains a colon without a following space (e.g., 'Interface:Primary'). What error will PyYAML raise when attempting to parse this file?

When working with PyYAML in Python for Junos automation scripts, which THREE of the following practices enhance script security and robustness? (Choose three)

Which TWO Python exceptions might be raised when attempting to parse a malformed JSON string using the standard 'json' module? (Choose two)

Question 10hardmultiple choice
Read the full Ansible explanation →

An automation script needs to convert a JSON string containing Juniper interface statistics into a YAML format to maintain consistency with existing Ansible variable files. When performing this conversion, which structural capability does YAML support that standard JSON does not?

You are writing a Python script to convert a complex Juniper device inventory from YAML format into JSON format using PyYAML and the built-in json module. Which THREE considerations must you keep in mind regarding differences between YAML and JSON during this conversion? (Choose three)

An automation engineer is converting a Junos device's REST API response into a YAML configuration file. The JSON response includes a field "interface_name": null, which indicates that no physical interface is currently assigned. The engineer wants to preserve this information in the YAML file so that the automation script can distinguish between a missing key and an explicitly empty value. Which YAML representation should the engineer use for this field?

Question 13mediummultiple choice
Study the full Python automation breakdown →

A network automation engineer is writing a Python script that uses the json module to parse a Junos REST API response. The response contains a JSON object with a key "interface-speed" set to the string "10G". The engineer needs to access this value and convert it to an integer representing megabits per second (10000). Which Python code snippet correctly retrieves and converts the value?

Question 14mediummultiple choice
Study the full Python automation breakdown →

A developer is writing a Python script that reads a Junos device inventory file. The team wants to use a data format that is a strict subset of JavaScript object notation, supports comments, and allows trailing commas. Which data format best fits these requirements?

An automation engineer runs a Python script that calls the Junos REST API on an SRX Series device and receives an interface description as the JSON value "100". The script then passes that value to a Junos CLI command built with PyEZ. Which JSON data type is "100" when the response is decoded by the script?

Question 16mediummultiple choice
Read the full Data Serialization explanation →

An automation engineer stores Junos device facts in a YAML file used by a PyEZ script. The file currently contains:

interfaces:

- ge-0/0/0 - ge-0/0/1

management_ip: 192.0.2.10

The script needs to add a second management address, 192.0.2.11, as a list while keeping the file valid YAML. Which YAML snippet correctly represents management_ip as a two-element sequence?

A network automation engineer exports the running configuration of a Junos device to a file named `backup.conf` and wants to parse it with a Python script using a data serialization library so that interface names, descriptions, and IP addresses can be accessed programmatically. Which data serialization format is the most appropriate for this task?

An automation engineer is comparing JSON and YAML for serializing Junos device inventory data that will be consumed by multiple tools. Which TWO statements correctly describe intrinsic characteristics of these formats? (Choose two.)

Question 19easymultiple choice
Read the full Ansible explanation →

An engineer needs to represent an ordered list of IP addresses in a YAML configuration file for a Junos automation playbook. Which valid YAML syntax correctly defines a sequence of items?

Question 20mediummultiple choice
Study the full Python automation breakdown →

A Python script retrieves interface statistics from a Junos device in JSON format, modifies a threshold value, and needs to output it back into a formatted JSON string with an indentation level of 4 spaces for readability. Which Python snippet achieves this?

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Data Serialization sessions

Start a Data Serialization only practice session

Every question in these sessions is drawn from the Data Serialization domain — nothing else.

Related practice questions

Related JNCIA-DevOps topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the JNCIA-DevOps exam test about Data Serialization?
Candidates must parse and generate JSON, XML, and YAML in Python for Junos automation, ensuring correct data type mapping and structure preservation. The most important thing is to handle format-specific rules, such as JSON's strict syntax and XML-to-JSON conversion challenges, without data loss.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Data Serialization questions in a focused session?
Yes — the session launcher on this page draws every question from the Data Serialization domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other JNCIA-DevOps topics?
Use the topic links above to move to related areas, or go back to the JNCIA-DevOps question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the JNCIA-DevOps exam covers. They are not copied from any real exam or dump site.
Juniper Networks Automation and DevOps, Associate…