Certified Python Network Administrator and Engineer Free Sample Questions

Description

Covers requirements engineering and DevOps models, Python data types and control structures, networking libraries and device management protocols, and network traffic monitoring and PCAP analysis.

20 free sample questions200 in the full practice test

Try simulator

CPNAE-101 Sample Questions

  1. Question 1

    Intermediate

    Requirements and Systems Engineering · Describe requirements engineering based on IEEE 29148-2018

    You are leading a network automation project to migrate legacy switch configurations to a controller-based architecture. According to IEEE 29148-2018, you are currently in the process of ensuring that the set of requirements accurately reflects the stakeholders' needs and that the specified system will solve the right problem. Which process are you performing?

    Answer and explanation

    Correct answer: A

    According to IEEE 29148-2018, Requirements Validation is the process of confirming that the requirements define the right system to meet stakeholder needs (building the right system). Requirements Verification, in contrast, ensures the requirements are written correctly and conform to standards (building the system right).

  2. Question 2

    Intermediate

    Requirements and Systems Engineering · Describe DevOps and systems development models

    A Network Reliability Engineer is designing a CI/CD pipeline for network configuration changes. The pipeline includes a stage where a Python script spins up a virtual topology, applies the proposed configuration, and runs connectivity tests before approving the merge request. Which DevOps testing strategy does this represent?

    Answer and explanation

    Correct answer: A

    Integration Testing involves testing the interaction between modules or systems. In a network CI/CD context, spinning up a virtual topology to test configurations against a simulated network environment is an integration test, as it verifies the configuration functions correctly within the system context.

  3. Question 3

    Beginner

    Requirements and Systems Engineering · Describe DevOps and systems development models

    Which of the following statements correctly describes a key difference between the Waterfall and Agile development models when applied to a network automation project?

    Answer and explanation

    Correct answer: C

    Agile methodologies prioritize iterative development, flexibility, and customer feedback. Waterfall is a linear, sequential approach where requirements are fixed at the start of the project.

  4. Question 4

    Advanced

    Python Programming Fundamentals · Plan and implement the use of custom functions

    You are writing a Python script to parse a large CSV inventory file containing 50,000 devices. You need to process these devices one by one without loading the entire file into memory to avoid resource exhaustion. Which Python generator pattern should you implement?

    Answer and explanation

    Correct answer: A

    Using the yield keyword creates a generator function. Generators allow you to iterate over data lazily, processing one item at a time, which is memory-efficient for large datasets compared to loading a full list.

  5. Question 5

    Beginner

    Python Programming Fundamentals · Plan and implement the use of data types

    Review the following Python dictionary representing a network interface:

    interface = {
    'name': 'GigabitEthernet1',
    'enabled': True,
    'ipv4': {
    'address': '192.168.1.1',
    'mask': '255.255.255.0'
    }
    }
    

    Which command successfully extracts the IP address '192.168.1.1'?

    Answer and explanation

    Correct answer: B

    The dictionary is nested. To access the IP address, you first access the 'ipv4' key, which returns another dictionary, and then access the 'address' key within that inner dictionary.

  6. Question 6

    Intermediate

    Network Device Management · Networking libraries and tools

    You are creating a script using netmiko to push a configuration set to a Cisco IOS device. You want to ensure the script handles potential authentication failures gracefully without crashing. Which exception should you catch?

    Answer and explanation

    Correct answer: C

    Netmiko raises NetmikoAuthenticationException when SSH authentication fails (e.g., wrong username or password). Catching this specific exception allows the script to log the error or retry without crashing.

  7. Question 7

    Intermediate

    Network Monitoring and Analysis · Monitor network traffic using the scapy library

    When using Scapy to monitor network traffic, you want to capture only TCP traffic on port 80. Which BPF filter syntax should you pass to the sniff() function?

    Answer and explanation

    Correct answer: C

    Scapy's sniff() function uses Berkeley Packet Filter (BPF) syntax. 'tcp and port 80' correctly filters for packets that are both TCP and destined for or originating from port 80.

  8. Question 8

    Intermediate

    Requirements and Systems Engineering · Describe systems concepts related to network engineering

    A network architect is defining the system lifecycle for a new SD-WAN deployment. According to general systems engineering principles, which phase immediately follows the 'Concept' stage and precedes 'Production'?

    Answer and explanation

    Correct answer: D

    The standard system lifecycle generally flows from Concept -> Development -> Production -> Utilization/Support -> Retirement. Development involves the detailed design and implementation before the system goes into live Production.

  9. Question 9

    Beginner

    Python Programming Fundamentals · Plan and implement the use of data types

    You need to store a collection of unique VLAN IDs discovered during a network scan. Duplicate IDs should be automatically removed. Which Python data type is most appropriate?

    Answer and explanation

    Correct answer: B

    A Set in Python is an unordered collection of unique elements. Adding a duplicate value to a set has no effect, making it the ideal data structure for storing unique VLAN IDs.

  10. Question 10

    Intermediate

    Network Device Management · Networking libraries and tools

    When using Nornir for network automation, which component is responsible for holding the information about the devices, groups, and defaults?

    Answer and explanation

    Correct answer: D

    In Nornir, the Inventory component manages the hosts, groups, and defaults. It is typically initialized using plugins like SimpleInventory or NetBoxInventory.

Register free for 10 more questions

Or unlock all 200 CPNAE-101 questions with explanations, timed mode and flashcards.