Chapter 28: Quiz – Foundational Network Programmability Concepts (Answers) CCNPv8 ENCOR

1. Which two statements describe characteristics of the command line interface (CLI)? (Choose two.)

  • Commands can be scripted.
  • The interface protects against misconigurations.
  • Commands cannot be encrypted.
  • Commands are well known and documented.
  • The command-line interface supports a small number of commands.

Explanation: The command-line interface (CLI), while commonly used, has pros and cons. The pros include commands being well known and documented, a commonly used method, the syntax help available on each command, scripting functionality, and the connection to CLI being encrypted (using SSH). The cons include difficulty of scaling, the very large number of commands, the need to know IOS command syntax, lack of intuitiveness, and that only one command at a time can be executed

2. What is a characteristic of a RESTful API?

  • It is a southbound API.
  • It uses HTTP methods to gather and manipulate data.
  • It facilitates the coniguration changes from a network controller to end devices.
  • It supports a secure data transmission between a remote user and an enterprise network.

Explanation: RESTful APIs use HTTP methods to gather and manipulate data. They are northbound APIs. Because there is a defined structure for how HTTP works, it offers a consistent way to interact with RESTful APIs from multiple vendors.

3. Which characters are used to enclose a JSON key?

  • quotation marks
  • commas
  • square brackets
  • colons

Explanation: JSON keys are on the left side of the colon. They need to be wrapped in double quotation marks, as in “key”, and can be any valid string.

4. Which data format does the Cisco DNA Center controller expect from the REST API for incoming data?

  • XML
  • JSON
  • HTML
  • YAML

Explanation: The Cisco DNA Center controller expects all incoming data from the REST API to be in the JSON format.

5. Which menu across the top of the Cisco DevNet main page provides learning tracks that guide users through various technologies and associated API labs?

  • Events
  • Support
  • Discover
  • Technologies

Explanation: Across the top of the main page are a few menu options, Discover, Technologies, Community, Support, and Events. The Discover page is where users can navigate the different offerings that DevNet has available. Under this tab are subsections for guided learning tracks, which guide users through various technologies and the associated API labs.

6. Which type of API is used to communicate from a network controller to its management software in network automation applications?

  • lower layer
  • upper layer
  • northbound
  • southbound

Explanation: In network automation applications, northbound APIs are often used to communicate from a network controller to its management software.

7. Which character is used to separate JSON key/value pairs?

  • (comma) ,
  • (semi colon) ;
  • (dash) –
  • (forward slash) /

Explanation: Each key/value pair in a series of key/value pairs is separated by a comma, so the middle of a JSON looks like this “key”: “value”, “key”: “value”.

8. What is a difference between the XML and HTML data formats?

  • XML formats data in hexadecimal whereas HTML formats data in binary.
  • XML uses a self-descriptive data structure but HTML uses a standard document structure.
  • XML requires indentation for each key/value pair whereas HTML does not require indentation.
  • XML encloses data within a pair of tags whereas HTML uses a pair of quotation marks to enclose data.

Explanation: XML is a human readable data structure used to store, transfer, and read data by applications. Like HTML, XML uses a related set of tags to enclose data. However, unlike HTML, XML does not use predefined tags or a standard document structure, but rather it uses self-descriptive tags and structure.

9. What is a characteristic of the Yet Another Next Generation (YANG) data model?

  • It uses a list structure.
  • It uses a MIBs structure.
  • It uses a tree structure.
  • It uses the JSON data format.

Explanation: YANG models use a tree structure. Within that structure, the models are similar in format to XML and are constructed in modules. These modules are hierarchical in nature and contain all the different data and types that make up a YANG device model.

10. Which RESTFul operation corresponds to the HTTP GET method?

  • read
  • update
  • patch
  • post

Explanation: RESTful operations correspond to the following HTTP methods (shown to the left with the RESTful operation on the right):

  • POST > Create
  • GET > Read
  • PUT/PATCH > Update
  • DELETE > Delete

11. Which HTTP response status code indicates that the request to update the database is completed?

  • 200
  • 201
  • 400
  • 401
  • 403
  • 404

Explanation: The most common HTTP status codes include the following:

  • 200 – OK (using GET or POST to exchange data with an API successfully)
  • 201 – Created (creating resources by using a REST API call successfully)
  • 400 – Bad Request (The request from the client is failed due to client-side issue.)
  • 401 – Unauthorized (The client is not authenticated to access site or API call.)
  • 403 – Forbidden (The access request is not granted based on the supplied credentials.)
  • 404 – Not Found (The page requested at HTTP URL location does not exist or is hidden.)

12. Which two data formats can RESTCON use when requesting data or responding with data? (Choose two.)

  • XML
  • HTML
  • YAML
  • JSON
  • YANG

Explanation: RESTCONF can be used to access data. The RESTCONF requests and responses can use either JSON or XML structured data formats.

13. What character is used to add comments to Python code?

  • $
  • #
  • %
  • @
  • !

Explanation: The # character is used to enter a comment when coding in Python.

14. A student is learning Python. What is the output of the print function?

user_string1 = \”Good\”
user_string2 = \”Morning! \”
print (user_string2 * 3)

  • Good Morning!
  • Good Morning! Good Morning! Good Morning!
  • Morning! Morning! Morning!
  • Good Morning! Morning! Morning!

Explanation: The print() function with the *3 multiplier would create one large string of Morning! Morning! Morning!


Inline Feedbacks
View all comments
Would love your thoughts, please comment.x