63 Practice Questions & Answers
Which of the following best describes the purpose of a REST API?
-
A
To replace all database queries with HTTP requests
-
B
To eliminate the need for authentication in web services
-
C
To provide a standardized way for applications to communicate over HTTP using resources identified by URIs
✓ Correct
-
D
To encrypt all data transmitted between client and server
Explanation
REST (Representational State Transfer) is an architectural style that uses HTTP methods and URIs to provide a standardized interface for application communication. The other options describe different concerns that are not the core purpose of REST.
What is the primary difference between synchronous and asynchronous API calls?
-
A
Synchronous calls block execution until a response is received, while asynchronous calls allow the program to continue executing without waiting for a response
✓ Correct
-
B
Asynchronous calls are only used for database operations
-
C
Asynchronous calls require more bandwidth than synchronous calls
-
D
Synchronous calls are always faster than asynchronous calls in network latency
Explanation
The key distinction is that synchronous calls are blocking (the caller waits for completion), while asynchronous calls are non-blocking (the caller continues execution and handles the response later via callbacks or promises).
Which HTTP status code indicates that a resource was created successfully?
-
A
200 OK
-
B
201 Created
✓ Correct
-
C
202 Accepted
-
D
204 No Content
Explanation
The 201 status code specifically indicates that a request was successful and a new resource was created as a result. While 200 indicates success, 201 is more semantically correct for creation operations.
In Python, what is the purpose of the 'requests' library when working with APIs?
-
A
It converts Python objects directly into binary format for network transmission
-
B
It encrypts all network traffic automatically without additional configuration
-
C
It provides a framework for building web servers and handling HTTP requests
-
D
It simplifies making HTTP requests to APIs and handling responses
✓ Correct
Explanation
The requests library is a popular Python library that abstracts away the complexity of making HTTP requests, allowing developers to easily send GET, POST, PUT, DELETE and other HTTP methods to APIs and handle the responses.
Which of the following YAML snippets correctly represents a list of network interfaces?
-
A
interfaces:
- eth0
- eth1
- eth2
✓ Correct
-
B
interfaces: {eth0, eth1, eth2}
-
C
interfaces: [eth0, eth1, eth2]
-
D
interfaces = [eth0, eth1, eth2]
Explanation
YAML uses the dash (-) syntax to represent list items with proper indentation. Option A uses flow style which is valid YAML, but option B shows the more common block style. Options C and D use incorrect YAML syntax (curly braces and Python assignment notation).
What is the primary purpose of JSON Schema in API development?
-
A
To convert JSON into XML for legacy system compatibility
-
B
To define and validate the structure of JSON documents
✓ Correct
-
C
To encrypt sensitive fields within JSON payloads
-
D
To compress JSON data for faster transmission over networks
Explanation
JSON Schema is a vocabulary that allows you to annotate and validate JSON documents. It defines what properties are required, their data types, constraints, and other structural requirements for JSON data.
In a CI/CD pipeline, what does the 'Continuous Integration' phase primarily focus on?
-
A
Frequently merging code changes and running automated tests to detect integration issues early
✓ Correct
-
B
Creating manual test cases and documenting code changes for review
-
C
Automatically deploying code to production servers immediately after commit
-
D
Monitoring application performance in production and rolling back failed deployments
Explanation
Continuous Integration emphasizes frequent code merges (often multiple times per day) with automated testing to catch integration problems early. This is distinct from the Continuous Deployment phase which handles production releases.
Which authentication method is considered most secure for API access?
-
A
Basic authentication with username and password in the request header
-
B
Hardcoding credentials directly in the application source code
-
C
OAuth 2.0 with token-based authentication and scope limitations
✓ Correct
-
D
API key sent as a query parameter in the URL
Explanation
OAuth 2.0 provides token-based authentication with granular permission scopes, token expiration, and the ability to revoke access without sharing passwords. It is widely considered the most secure method for modern API authentication.
What is the primary function of a webhook in API integrations?
-
A
To allow an API to push data to your application when specific events occur, rather than polling for updates
✓ Correct
-
B
To encrypt all API communications using SSL/TLS protocols
-
C
To cache frequently requested API responses for improved performance
-
D
To provide a backup mechanism for failed API requests
Explanation
Webhooks enable event-driven architecture by allowing an API to send data to a specified URL (callback) when certain events happen, eliminating the need for constant polling and improving efficiency.
In the context of network programmability, what is the primary advantage of using an SDN (Software-Defined Network) controller?
-
A
It eliminates the need for physical network hardware entirely
-
B
It increases network security by blocking all unknown protocols at the router level
-
C
It enables centralized control and programmability of network devices through standardized APIs
✓ Correct
-
D
It automatically optimizes network bandwidth without any configuration needed
Explanation
An SDN controller provides a centralized management plane that controls network behavior through APIs, allowing dynamic network configuration and programmability rather than manual device-by-device management.
Which of the following best describes the relationship between Ansible, Puppet, and Chef?
-
A
They are specialized tools for managing cloud resources in AWS, Azure, and Google Cloud exclusively
-
B
Ansible is a replacement for both Puppet and Chef, making them obsolete
-
C
They are competing products with no overlap in functionality or use cases
-
D
They are all Infrastructure as Code (IaC) tools used for configuration management and automation, though with different approaches and architectures
✓ Correct
Explanation
While Ansible, Puppet, and Chef are indeed IaC tools for configuration management, they differ in agent requirements, language, and philosophy. Ansible is agentless, while Puppet and Chef typically use agents.
What is the primary purpose of a requirements.txt file in Python development?
-
A
To store API credentials and sensitive configuration data securely
-
B
To list the Python package dependencies needed for a project to run correctly
✓ Correct
-
C
To document the Python version number and operating system requirements
-
D
To configure logging levels and debug output settings for the application
Explanation
The requirements.txt file lists all Python packages (dependencies) that a project needs, along with specific versions, allowing easy installation via 'pip install -r requirements.txt'. This ensures environment consistency.
In Git version control, what is the purpose of a 'pull request' or 'merge request'?
-
A
To create a backup copy of the repository on a remote server
-
B
To revert all changes made to a repository to a previous commit
-
C
To download the entire repository to your local machine
-
D
To propose changes from one branch to another branch, enabling code review before merging
✓ Correct
Explanation
A pull/merge request is a mechanism for proposing code changes and facilitating code review. It allows team members to review, discuss, and approve changes before they are merged into the main branch.
Which of the following statements about microservices architecture is most accurate?
-
A
Microservices are small monolithic applications that run on a single server to reduce complexity
-
B
Microservices require all services to be written in the same programming language for compatibility
-
C
Microservices architecture divides an application into loosely coupled, independently deployable services that communicate via APIs
✓ Correct
-
D
Microservices eliminate the need for databases entirely by storing all data in memory
Explanation
Microservices architecture breaks applications into independent services that can be developed, deployed, and scaled separately. They communicate through well-defined APIs and can be built with different technologies.
What is the primary security concern when handling API credentials in automation scripts?
-
A
API credentials should always be transmitted in plain text for maximum compatibility
-
B
Storing credentials in a database eliminates all security risks automatically
-
C
Using environment variables makes credentials completely unrecoverable if you forget them
-
D
Hardcoding credentials directly in scripts or configuration files exposes them to unauthorized access if the files are compromised
✓ Correct
Explanation
Hardcoding credentials is a critical security vulnerability. Credentials should be stored securely using environment variables, secrets management systems, or encrypted configuration files to prevent exposure if code is leaked.
In Cisco DNA Center, what is the primary function of the Intent-Based Networking (IBN) approach?
-
A
To eliminate the need for network monitoring and analytics
-
B
To capture business intent and translate it into network policies and configurations automatically through APIs and automation
✓ Correct
-
C
To replace all network protocols with proprietary Cisco-only standards
-
D
To manually configure each network device through the CLI
Explanation
DNA Center's IBN approach uses APIs and automation to convert high-level business requirements into network configurations, enabling faster policy deployment and reducing manual configuration errors.
Which HTTP method is most appropriate for retrieving data from an API without making any changes to the resource?
-
A
PUT
-
B
POST
-
C
DELETE
-
D
GET
✓ Correct
Explanation
The GET method is idempotent and safe, meaning it retrieves data without modifying the resource state. POST, PUT, and DELETE are used for creating, updating, and deleting resources respectively.
What does the term 'idempotency' mean in the context of API design?
-
A
An API operation that returns the same result regardless of how many times it is called with the same parameters
✓ Correct
-
B
An API that requires authentication using multiple different credential types
-
C
An API endpoint that supports both HTTP and HTTPS protocols simultaneously
-
D
An API that automatically compresses responses to reduce bandwidth consumption
Explanation
An idempotent operation produces the same result when called multiple times with identical inputs. This is important for reliability—if a request is retried, the outcome remains consistent, preventing duplicate operations.
In Python, what is the primary difference between using 'import requests' and 'from requests import get'?
-
A
The 'from' syntax only works with the requests library, not with other Python packages
-
B
Using 'import requests' loads the entire module while 'from requests import get' imports only the specific function, improving code clarity
✓ Correct
-
C
They are identical and can be used interchangeably with no functional difference
-
D
Using 'import requests' is slower because it requires additional module initialization
Explanation
Both approaches work, but 'from requests import get' is more explicit and efficient when you only need specific functions. Using 'import requests' imports the entire module namespace, requiring 'requests.get()' in your code.
Which of the following best describes the purpose of Docker containers in application development?
-
A
To package an application with its dependencies and runtime environment in a lightweight, portable container that can run consistently across different systems
✓ Correct
-
B
To replace virtual machines entirely and eliminate the need for hypervisors
-
C
To encrypt application data at rest and in transit automatically
-
D
To optimize database query performance without any code changes
Explanation
Docker containers encapsulate applications and their dependencies into self-contained units that are portable and consistent across development, testing, and production environments, solving the 'works on my machine' problem.
In the context of API rate limiting, what is the primary purpose of implementing throttling?
-
A
To increase server performance by refusing all requests above a certain size limit
-
B
To encrypt API responses automatically without additional configuration
-
C
To eliminate the need for user authentication in API requests
-
D
To control the number of requests a client can make to prevent abuse and ensure fair resource allocation among users
✓ Correct
Explanation
Rate limiting and throttling protect APIs from abuse, denial-of-service attacks, and resource exhaustion by restricting the number of requests a client can make within a specific time window, ensuring service availability for all users.
What is the primary advantage of using a version control system like Git in team development?
-
A
It automatically compiles and deploys code to production without human intervention
-
B
It enables multiple developers to work on the same project simultaneously while tracking changes, managing conflicts, and maintaining a complete history of code modifications
✓ Correct
-
C
It eliminates the need for code testing and quality assurance processes
-
D
It provides automatic encryption of all source code files for security
Explanation
Git enables collaborative development by providing branching, merging, and commit history features that allow teams to work simultaneously, track changes, resolve conflicts, and maintain code integrity.
Which of the following HTTP status codes indicates that the server encountered an unexpected condition and cannot fulfill the request?
-
A
500 Internal Server Error
✓ Correct
-
B
400 Bad Request
-
C
403 Forbidden
-
D
404 Not Found
Explanation
The 500 status code indicates a server-side error where the server encountered an unexpected condition. The other options (400, 403, 404) represent client-side errors such as invalid requests, permission issues, or missing resources.
In API documentation, what is the primary purpose of including example request and response payloads?
-
A
To encrypt sensitive data before transmission over the network
-
B
To reduce the file size of API documentation by eliminating textual descriptions
-
C
To automatically generate test cases for the API without manual effort
-
D
To demonstrate the correct format and structure that developers should use when calling the API and what to expect in responses
✓ Correct
Explanation
Example payloads are crucial for API documentation as they show developers the exact format of requests and responses, field names, data types, and structure, enabling faster and more accurate integration.
What does 'Infrastructure as Code' (IaC) refer to in the context of DevOps?
-
A
Encrypting infrastructure configuration files to prevent unauthorized access
-
B
Writing application code that only runs on physical hardware infrastructure
-
C
The practice of manually documenting all network and server configurations in spreadsheets
-
D
Managing and provisioning infrastructure using code and automation tools rather than manual configuration, enabling version control and reproducibility
✓ Correct
Explanation
IaC treats infrastructure configuration (servers, networks, storage) as code, allowing it to be version-controlled, tested, and automatically deployed, improving consistency, speed, and repeatability in infrastructure management.
When working with APIs, what does CORS (Cross-Origin Resource Sharing) control?
-
A
The ability for web applications to make requests to APIs hosted on different domains, and which origins are permitted to access resources
✓ Correct
-
B
The number of concurrent connections a server can handle from multiple clients
-
C
The encryption algorithm used for securing API communication between client and server
-
D
The priority order in which API requests are processed by the server
Explanation
CORS is a security mechanism that controls which origins (domain, protocol, port combinations) are allowed to access resources from a web server, preventing unauthorized cross-domain requests while enabling legitimate sharing when configured properly.
In Cisco Meraki, what is the primary role of the cloud-based dashboard?
-
A
To provide centralized management, monitoring, and configuration of Meraki devices across multiple locations through web-based and API interfaces
✓ Correct
-
B
To replace local network storage with cloud-only data repositories
-
C
To eliminate the need for physical network switches and access points
-
D
To encrypt all network traffic at the application layer before transmission
Explanation
The Meraki cloud dashboard enables centralized management of Meraki devices (switches, APs, firewalls) across distributed locations, providing visibility, configuration, and monitoring capabilities through both web and REST APIs.
Which of the following best describes the purpose of REST APIs in network automation?
-
A
REST APIs are only used for monitoring and cannot make configuration changes.
-
B
REST APIs enable programmatic access to network devices and services using standard HTTP methods.
✓ Correct
-
C
REST APIs replace CLI entirely and eliminate the need for SSH connections.
-
D
REST APIs provide encryption for all data transmission automatically.
Explanation
REST APIs allow developers to interact with network devices and services programmatically using standard HTTP verbs (GET, POST, PUT, DELETE), enabling automation and integration with other systems.
In Python, what does the requests library's response.status_code attribute return when a successful HTTP request is made?
-
A
An integer between 200-299 for successful responses
✓ Correct
-
B
A dictionary containing all response headers and their values
-
C
A boolean value indicating success or failure
-
D
A string representation of the HTTP status message
Explanation
The status_code attribute returns an integer HTTP status code; successful requests return codes in the 2xx range (typically 200 for OK, 201 for Created).
Which HTTP method should be used to create a new resource on a RESTful API?
-
A
DELETE
-
B
POST
✓ Correct
-
C
GET
-
D
PATCH
Explanation
POST is the standard HTTP method for creating new resources on RESTful APIs, while GET retrieves, PATCH modifies partially, and DELETE removes resources.
What is the primary purpose of JSON Schema in API development?
-
A
To define the structure and validate data formats exchanged between APIs and clients.
✓ Correct
-
B
To replace XML entirely as the standard data format for all APIs.
-
C
To encrypt all JSON payloads before transmission over the network.
-
D
To automatically generate API documentation from code comments.
Explanation
JSON Schema provides a declarative way to define the expected structure, data types, and constraints of JSON data, enabling validation and documentation of API contracts.
In YAML, how is a dictionary or object structure represented?
-
A
Using angle brackets to denote hierarchical structures like <key>value</key>
-
B
Using curly braces with quotes around all keys and values like {"key": "value"}
-
C
Using square brackets with key-value pairs separated by commas like [key: value, key2: value2]
-
D
Using colons to denote key-value pairs with proper indentation
✓ Correct
Explanation
YAML uses colons to separate keys from values and relies on indentation to represent nested structures, making it more human-readable than JSON or XML.
Which of the following is a characteristic of a well-designed RESTful API?
-
A
API endpoints should perform multiple unrelated operations to minimize the number of requests required.
-
B
Resources should be identified by URIs and manipulated using standard HTTP methods.
✓ Correct
-
C
All API responses must be cached indefinitely to improve performance.
-
D
Authentication tokens should be included as query parameters in every URL.
Explanation
RESTful APIs follow the principle of identifying resources with URIs and using standard HTTP methods (GET, POST, PUT, DELETE) for operations, which promotes consistency and scalability.
What does the Python requests library's json() method do when called on a response object?
-
A
It converts the response body from JSON format to a Python dictionary or list.
✓ Correct
-
B
It validates that the response content is valid JSON before returning it.
-
C
It serializes the response object into JSON format for storage or transmission.
-
D
It automatically caches the JSON response in memory for future requests.
Explanation
The json() method parses the response body (assuming it contains valid JSON) and returns it as a Python data structure (typically a dictionary or list).
In the context of network automation, what is the primary advantage of using configuration management tools like Ansible?
-
A
Ansible provides real-time packet capture and analysis without additional tools.
-
B
Ansible eliminates the need for network protocols like SSH and Telnet.
-
C
Ansible allows declarative, idempotent configuration management across multiple devices simultaneously.
✓ Correct
-
D
Ansible automatically optimizes network bandwidth by compressing all traffic.
Explanation
Ansible enables infrastructure-as-code through playbooks, allowing operators to define desired configurations once and apply them idempotently across many devices, ensuring consistency and repeatability.
What does idempotency mean in the context of configuration management?
-
A
The process of automatically rolling back failed configuration changes.
-
B
The requirement that all configuration changes must be made through graphical user interfaces.
-
C
The encryption of configuration files to prevent unauthorized access.
-
D
The ability to apply the same configuration multiple times and achieve the same result without unintended side effects.
✓ Correct
Explanation
Idempotency means that running a configuration multiple times produces the same outcome—if the desired state is already met, no changes occur, preventing accidental overwrites or duplication.
Which of the following best describes the relationship between a NETCONF client and server?
-
A
The server continuously pushes configuration updates to all connected clients.
-
B
The NETCONF client sends configuration and retrieval requests over SSH to a NETCONF server running on the device.
✓ Correct
-
C
The client sends unencrypted configuration commands to the server over HTTP.
-
D
The client and server communicate exclusively through SNMP traps and inform messages.
Explanation
NETCONF is a network management protocol that operates over SSH, allowing clients to securely send configuration and operational requests to NETCONF servers on network devices.
What is a key difference between YANG and NETCONF?
-
A
YANG is a data modeling language that defines the structure of configuration and operational data, while NETCONF is a protocol for retrieving and editing that data.
✓ Correct
-
B
NETCONF is a data modeling language and YANG is the protocol used to transport data.
-
C
Both are identical specifications, and YANG is simply an older name for NETCONF.
-
D
YANG requires SSL/TLS encryption while NETCONF can operate over unencrypted connections.
Explanation
YANG provides a schema for defining network configuration and operational data in a standardized format, while NETCONF is the protocol mechanism for retrieving and modifying that data on devices.
In Python, what is the purpose of list comprehensions?
-
A
To compare two lists and identify differences between them programmatically.
-
B
To ensure that all elements in a list conform to a specific data type.
-
C
To create a new list by applying a transformation to each element of an existing iterable in a concise manner.
✓ Correct
-
D
To compress list data for more efficient storage and transmission over networks.
Explanation
List comprehensions provide a concise and readable way to create new lists by iterating over an iterable and optionally applying a transformation or filter to each element.
Which of the following is an advantage of using version control systems like Git in network automation projects?
-
A
Version control prevents unauthorized access to network infrastructure without requiring additional authentication.
-
B
Version control enables tracking changes, collaboration, and the ability to roll back to previous configurations if issues occur.
✓ Correct
-
C
Version control systems automatically apply network configurations without requiring manual deployment.
-
D
Version control eliminates the need for backup systems or disaster recovery procedures.
Explanation
Git provides change tracking, rollback capabilities, and enables team collaboration through branching and merging, making it essential for maintaining configuration history and enabling safe deployments.
What does the term 'Infrastructure as Code' (IaC) mean?
-
A
Using encryption and coding techniques to secure infrastructure against cyber attacks.
-
B
The process of encoding network topology information into binary format.
-
C
Writing code that generates programming languages for infrastructure management.
-
D
Managing and provisioning computing infrastructure through machine-readable definition files rather than manual configuration.
✓ Correct
Explanation
Infrastructure as Code treats infrastructure configuration (networks, servers, etc.) as versioned code, enabling reproducible, scalable, and testable infrastructure deployments.
In Python, what is the primary purpose of the 'if __name__ == "__main__":' construct?
-
A
It allows a Python script to run code only when executed directly, not when imported as a module.
✓ Correct
-
B
It specifies the Python interpreter version required to execute the script.
-
C
It creates a security checkpoint to verify the user's credentials before running the script.
-
D
It defines the main function that must be called first when the program starts.
Explanation
This idiom allows a Python file to contain code that runs only when the script is executed directly (not imported), making it useful for testing and allowing the same file to be used as both a module and standalone script.
Which of the following best describes how Cisco DNA Center enables network automation?
-
A
DNA Center is purely a visualization tool with no automation capabilities or functions.
-
B
DNA Center provides a centralized platform for intent-based networking, allowing operators to define business policies that are automatically translated and applied to network devices.
✓ Correct
-
C
DNA Center replaces all networking protocols with a proprietary Cisco protocol.
-
D
DNA Center eliminates the need for DHCP and DNS services on the network.
Explanation
DNA Center is Cisco's intent-based networking platform that abstracts network complexity through a centralized console, translating high-level business policies into device-level configurations across the network.
What is the primary role of webhooks in application integration?
-
A
Webhooks allow applications to send real-time notifications to other applications or systems based on specific events.
✓ Correct
-
B
Webhooks encrypt all web traffic between servers and clients automatically.
-
C
Webhooks are firewalls that prevent unauthorized web requests from reaching applications.
-
D
Webhooks provide load balancing capabilities for distributing requests across multiple servers.
Explanation
Webhooks enable event-driven integration by allowing one application to send HTTP callbacks to another when specific events occur, enabling real-time data synchronization and automated workflows.
In the context of APIs, what does the term 'rate limiting' refer to?
-
A
A restriction on the number of API requests a client can make within a specific time period.
✓ Correct
-
B
A security feature that monitors and restricts the geographic locations from which APIs are accessed.
-
C
The maximum bandwidth allocated to API servers by network administrators.
-
D
The process of measuring the speed at which data travels through the network.
Explanation
Rate limiting controls API usage by restricting the number of requests a client can make in a given timeframe (e.g., 100 requests per minute), protecting servers from overload and preventing abuse.
Which Python library is commonly used to parse and manipulate HTML and XML documents?
-
A
The datetime library for handling time-based data extraction.
-
B
The json library for converting HTML to JSON format.
-
C
BeautifulSoup for parsing and extracting data from HTML and XML documents.
✓ Correct
-
D
The re library for compiling and executing regular expressions on text.
Explanation
BeautifulSoup is a popular Python library designed for parsing HTML and XML documents, making it easy to navigate and extract specific data from structured web content.
What is the primary advantage of using APIs instead of CLI automation for network management?
-
A
APIs require no authentication or security mechanisms compared to CLI access.
-
B
APIs provide structured, machine-readable responses that are easier to parse and integrate into automated workflows.
✓ Correct
-
C
APIs eliminate the need for network connectivity to devices requiring management.
-
D
APIs work exclusively with cloud-based infrastructure and cannot manage on-premises devices.
Explanation
APIs return structured data (JSON/XML) that can be easily parsed by programs, enabling reliable automation, integration, and reduced reliance on text parsing unlike CLI which requires screen scraping.
In Python, what does the 'try-except' block accomplish?
-
A
It forces Python to re-attempt failed operations a fixed number of times automatically.
-
B
It allows a program to handle exceptions gracefully by attempting an operation and executing alternative code if an error occurs.
✓ Correct
-
C
It compiles Python code into machine language for faster execution.
-
D
It prevents all error messages from being displayed to users.
Explanation
Try-except blocks enable error handling by attempting code in the 'try' block and executing alternative code in the 'except' block if specified exceptions occur, preventing program crashes.
Which of the following best describes the use of Postman in API development and testing?
-
A
Postman is a Python library for parsing postal address formats from network logs.
-
B
Postman is a mail delivery service for sending configuration files to network devices.
-
C
Postman is a desktop and web application that allows developers to create, test, and document API requests and responses.
✓ Correct
-
D
Postman is a network protocol for delivering messages between routers.
Explanation
Postman is a popular development tool that provides a user-friendly interface for building, testing, and documenting API requests, enabling developers to verify API functionality before integration.
What is the primary purpose of authentication tokens in API security?
-
A
Tokens automatically encrypt all data transmitted between clients and servers.
-
B
Tokens eliminate the need for HTTPS/TLS connections when accessing APIs.
-
C
Tokens replace the need for usernames and passwords entirely.
-
D
Tokens serve as proof of identity and authorization, allowing API servers to verify that a requesting client has permission to access resources.
✓ Correct
Explanation
Authentication tokens (like JWT or OAuth tokens) are credentials that clients present to servers to prove their identity and authorization level, replacing the need to send passwords with every request.
In network automation, what is the primary advantage of using a configuration template over manual configuration?
-
A
Templates reduce human error, improve consistency, and enable rapid deployment of configurations across multiple devices.
✓ Correct
-
B
Templates require more time to create than manually writing configurations.
-
C
Templates eliminate all network protocols, simplifying network architecture significantly.
-
D
Templates are only useful for single-device deployments and don't scale to larger environments.
Explanation
Configuration templates standardize deployments, reduce manual errors, and enable consistent application of best practices across many devices through variables and conditional logic.
Which of the following is a key characteristic of microservices architecture?
-
A
Applications are built as monolithic units with all functionality in a single codebase and process.
-
B
Microservices eliminate the need for any inter-service communication mechanisms.
-
C
Applications are divided into small, independent services that communicate through well-defined APIs and can be deployed and scaled independently.
✓ Correct
-
D
Microservices require all services to be tightly coupled and share a common database.
Explanation
Microservices break applications into independently deployable services that communicate through APIs, enabling flexible scaling, updates, and resilience compared to monolithic architectures.
What does the HTTP status code 401 indicate?
-
A
The request was successful and the resource was created.
-
B
The client has made too many requests and is being rate limited.
-
C
The request lacks valid authentication credentials, meaning the client must authenticate to access the resource.
✓ Correct
-
D
The server cannot find the requested resource.
Explanation
HTTP 401 Unauthorized indicates that the request requires authentication or that the provided credentials are invalid, requiring the client to provide proper authentication.
Which HTTP status code indicates that a request was successful and a new resource was created as a result?
-
A
204 No Content
-
B
200 OK
-
C
201 Created
✓ Correct
-
D
202 Accepted
Explanation
HTTP 201 Created is the correct status code returned when a POST request successfully creates a new resource on the server.
What is the primary purpose of using environment variables in Python scripts for network automation?
-
A
To store sensitive credentials and configuration data without hardcoding them in the source code
✓ Correct
-
B
To increase the execution speed of the script by caching values in memory
-
C
To create persistent logging across multiple Python interpreter sessions
-
D
To automatically configure network devices without user intervention
Explanation
Environment variables are commonly used to securely store sensitive information like API keys and passwords, preventing them from being exposed in version control systems.
In the context of YANG data models, what does the 'container' statement represent?
-
A
A grouping of related nodes that can contain other containers, leaf nodes, or leaf-lists
✓ Correct
-
B
A reference to another YANG module or submodule
-
C
An operational state attribute of a network device
-
D
A leaf node that holds a single scalar value
Explanation
In YANG, a container is a data node that can hold other data nodes (containers, leaves, or leaf-lists), similar to a directory structure in a file system.
Which of the following best describes the difference between NETCONF and RESTCONF protocols?
-
A
NETCONF only supports read operations while RESTCONF supports both read and write operations
-
B
RESTCONF requires specialized network devices that do not support NETCONF protocol operations
-
C
NETCONF uses XML over SSH while RESTCONF uses HTTP/HTTPS with XML or JSON payloads and is more REST-like in its design
✓ Correct
-
D
NETCONF uses JSON for data serialization while RESTCONF exclusively uses XML
Explanation
NETCONF uses SSH as transport and XML for encoding, while RESTCONF is built on HTTP/HTTPS and supports both XML and JSON, providing a more REST-aligned interface.
When parsing JSON data in Python, which built-in module is most commonly used?
-
A
configparser
-
B
xml.etree.ElementTree
-
C
urllib.parse
-
D
json
✓ Correct
Explanation
The json module in Python's standard library provides methods like json.loads() and json.dumps() for parsing and serializing JSON data.
What is the primary advantage of using Git branches in collaborative network automation development?
-
A
Branches eliminate the need for version control by creating automatic snapshots of all changes
-
B
Branches provide encryption for sensitive network configuration data stored in the repository
-
C
Branches automatically compress code files to save storage space on the repository server
-
D
Branches allow multiple developers to work on different features in isolation without affecting the main codebase, enabling parallel development and easier code review processes
✓ Correct
Explanation
Git branches enable isolated development environments where team members can work independently, test features, and merge changes through pull requests with code reviews.
In Python, what does the term 'idempotency' mean in the context of network automation?
-
A
The ability of a script to connect to multiple network devices simultaneously using parallel processing
-
B
The property that applying the same operation multiple times produces the same result as applying it once, ensuring consistent state regardless of how many times it is executed
✓ Correct
-
C
The requirement that all variables must be explicitly defined before they are used in a function
-
D
The process of automatically rolling back configuration changes when an error is detected during execution
Explanation
Idempotency in automation means that running a script or operation multiple times achieves the same end state without causing unintended side effects or duplicating changes.
Which of the following is a correct way to define a function in Python that accepts both positional and keyword arguments?
-
A
def configure_interface(name, *args, **kwargs): pass
✓ Correct
-
B
def configure_interface(*args, **kwargs): pass
-
C
def configure_interface(name, vlan=100, mtu=1500): *args, **kwargs pass
-
D
def configure_interface(name, vlan=100, mtu=1500, shutdown=True): pass
Explanation
This function definition accepts a required positional argument (name), optional keyword arguments with defaults (vlan, mtu, shutdown), and can handle additional arguments through args and *kwargs.
When using the Requests library in Python to make an API call, what does the .json() method do?
-
A
Validates that the response contains valid JSON and raises an exception if it does not
-
B
Converts the response body from JSON format into a Python dictionary or list object for easier manipulation
✓ Correct
-
C
Automatically retries the request if the server returns a JSON error message
-
D
Sends the request with the appropriate Content-Type header set to application/json
Explanation
The .json() method on a Requests response object parses the JSON response body and returns it as native Python objects (typically a dict or list).
In a CI/CD pipeline for network automation, what is the primary purpose of the 'test' stage?
-
A
To verify that code changes do not break existing functionality, validate against coding standards, and ensure the automation logic produces expected outcomes before deployment to production
✓ Correct
-
B
To automatically deploy all changes directly to network devices in the production environment without manual review
-
C
To create encrypted backups of all network device configurations in a centralized repository
-
D
To monitor real-time network traffic and generate performance reports for bandwidth utilization
Explanation
The test stage in a CI/CD pipeline runs automated tests, linting, and validation checks to ensure code quality and correctness before changes proceed to production deployment.