JNCIA-DevOps Free Sample Questions

12 free sample questions120 in the full practice test

Try simulator

JN0-222 Sample Questions

  1. Question 1

    Beginner

    Data Serialization · YAML vs JSON vs XML

    A network reliability engineer is designing a new automation workflow. They need to choose a data serialization format that is primarily designed to be human-readable, supports comments natively, and does not require closing tags. Which format meets these specific requirements?

    Answer and explanation

    Correct answer: A

    YAML (YAML Ain't Markup Language) is designed to be human-readable, uses indentation for structure (no closing tags), and supports comments (starting with #). JSON does not support comments natively, and XML uses closing tags and is more verbose.

  2. Question 2

    Intermediate

    Python · PyEZ Exception Handling

    While troubleshooting a Python script using the Juniper PyEZ library, you encounter a ConnectError. The script attempts to connect to a device using NETCONF over SSH. You verify that the device is reachable via ping. What is the most likely cause of this specific error?

    Answer and explanation

    Correct answer: B

    A ConnectError in PyEZ typically indicates that the transport layer connection failed. Since ICMP (ping) works, the network path is valid. However, PyEZ relies on NETCONF over SSH (default port 830). If set system services netconf ssh is missing, the port is closed, causing the connection refusal.

  3. Question 3

    Beginner

    DevOps Concepts · Idempotency

    You are reviewing an Ansible playbook intended to configure Juniper devices. The playbook uses the juniper_junos_config module. You want to ensure that the task only pushes changes if the current configuration differs from the desired state, and that it can be run multiple times without causing unintended side effects. What DevOps concept does this describe?

    Answer and explanation

    Correct answer: C

    Idempotency is the property where an operation can be applied multiple times without changing the result beyond the initial application. In Ansible, this means if the configuration already matches the desired state, no changes are made.

  4. Question 4

    Intermediate

    DevOps Concepts · CI/CD Pipelines

    A DevOps engineer is designing a CI/CD pipeline for network configuration management. The pipeline must support a 'Shift Left' approach to testing. Which activity belongs in the earliest stage of this pipeline?

    flowchart LR A[Developer Commit] --> B[Stage 1] B --> C[Stage 2] C --> D[Stage 3] D --> E[Production Deploy]
    Answer and explanation

    Correct answer: B

    Shift Left means moving testing as early in the development lifecycle as possible. Syntax checking, linting (e.g., YAML validation), and static code analysis are the very first steps (Stage 1) that can be done immediately after a commit, before any deployment to a lab or production environment.

  5. Question 5

    Intermediate

    Python · PyEZ Tables and Views

    You are writing a Python script using the Juniper PyEZ library to gather hardware information. You need to access the operational state of the device, specifically the chassis inventory. Which PyEZ component provides a structured, Pythonic way to retrieve this specific operational data without parsing raw XML manually?

    Answer and explanation

    Correct answer: D

    PyEZ Tables and Views allow you to map XML output from operational commands (like get-chassis-inventory) into structured Python objects (dictionaries/lists). This abstracts away the complexity of parsing XML directly.

  6. Question 6

    Beginner

    Data Serialization · JSON Syntax

    Which of the following JSON objects correctly represents a list of two interfaces, where the list is the value for the key 'interfaces'?

    Answer and explanation

    Correct answer: B

    In JSON, square brackets [] denote a list (array), and curly braces {} denote an object (dictionary). The key "interfaces" must be a string in double quotes, followed by a colon, and then the list of values.

Register free for 6 more questions

Or unlock all 120 JN0-222 questions with explanations, timed mode and flashcards.