Courseiva
hardMultiple Select

350-401 Practice Question: Which three statements about using Python for…

Which three statements about using Python for interacting with Cisco IOS-XE devices via NETCONF and RESTCONF are true? (Choose three.)

⚠ Common exam trap

The trap is the claim that NETCONF uses binary encoding or is inherently faster — NETCONF is XML-based, and speed depends on implementation, not encoding format.

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

✓

The ncclient Python library can be used to establish a NETCONF session with a Cisco IOS-XE device and retrieve YANG-modeled data.

Option A is correct because ncclient is a Python library specifically designed to implement the NETCONF protocol, allowing a script to open an SSH-based NETCONF session (typically on port 830) with a Cisco IOS-XE device, send <get> or <get-config> RPCs, and retrieve YANG-modeled configuration and state data. Option B is correct because RESTCONF is a RESTful protocol that maps YANG data to HTTP resources and uses standard HTTP methods — GET to read, POST to create, PUT/PATCH to modify, and DELETE to remove — against URIs such as /restconf/data/ietf-interfaces:interfaces. Option C is correct because YANG is the data modeling language that defines the hierarchical structure, data types, and constraints of the data exposed by both NETCONF and RESTCONF, so any Python interaction with these protocols ultimately manipulates YANG-modeled content. Option D is incorrect because RESTCONF supports XML and JSON encodings (selected via the Content-Type/Accept headers), not YAML. Option E is incorrect because NETCONF uses XML encoding, not binary, and performance depends on factors such as payload size, transport, and implementation rather than a guaranteed speed advantage over RESTCONF.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    The ncclient Python library can be used to establish a NETCONF session with a Cisco IOS-XE device and retrieve YANG-modeled data.

    Why this is correct

    The ncclient library implements the NETCONF protocol over SSH, opening a session on port 830 and exchanging XML-encoded RPCs. It retrieves configuration and state data modelled by YANG, satisfying the stem's requirement for programmatic IOS-XE interaction via NETCONF rather than RESTCONF's HTTP-based interface.

  • ✓

    RESTCONF uses HTTP methods such as GET, POST, PUT, and DELETE to access YANG-defined data on a network device.

    Why this is correct

    RESTCONF maps YANG-modelled data to HTTP verbs: GET retrieves, POST creates, PUT replaces, and DELETE removes resources. This satisfies the RESTCONF statement requirement, distinguishing it from NETCONF, which uses XML RPC over SSH rather than HTTP methods.

  • ✓

    YANG models define the structure and constraints of data that can be accessed via NETCONF or RESTCONF.

    Why this is correct

    YANG supplies the schema that NETCONF and RESTCONF rely on, defining every accessible node, its data type and constraints. Without a model, neither protocol can validate or structure requests, so this statement correctly describes the data-definition layer underpinning both.

  • ✗

    RESTCONF only supports data encoding in YAML format.

    Why it's wrong here

    RESTCONF supports XML and JSON encodings, not YAML, per RFC 8040. It is tempting because YAML is common in configuration tooling, but RESTCONF's media types are application/yang-data+json and +xml only, so YAML is never a valid encoding.

  • ✗

    NETCONF is always faster than RESTCONF for retrieving large amounts of data because it uses a binary encoding.

    Why it's wrong here

    NETCONF primarily uses XML for data encoding, which is text-based, not binary, making the claim it "always" uses binary incorrect and thus negating the stated reason for superior speed. While binary encodings like EXI can be utilised with NETCONF to potentially improve performance for large data volumes, this is not its default or universal characteristic. The option is tempting because binary protocols *can* offer efficiency gains over text-based ones in specific high-throughput scenarios, but this is not a general truth for NETCONF versus RESTCONF.

Go deeper

Related to this question

About these practice questions

Courseiva writes every 350-401 question from scratch — 1,923 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Cisco exam blueprint

This 350-401 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 350-401 exam.