Python Network Remediation, DNS
Configuration, System Recovery &
Validation EXAM PRACTICE 250 QUESTIONS
|ORIGINAL QUESTIONS & ANSWERS
|DETAILED RATIONALES |HINTED COMPLETE
EXAM PREP GRADED A+*INSTANT
DOWNLOAD PDF
1. Which Python library is commonly used to create TCP network
connections?
A. os
B. socket
C. json
D. hashlib
Answer: B. socket
The socket module provides Python interfaces for network
communication, including TCP and UDP connections.
2. Which socket type is normally used for TCP communication?
A. SOCK_RAW
B. SOCK_DGRAM
C. SOCK_STREAM
D. SOCK_PACKET
Answer: C. SOCK_STREAM
,TCP uses a reliable byte-stream service represented by
SOCK_STREAM.
3. Which socket type is associated with UDP?
A. SOCK_STREAM
B. SOCK_DGRAM
C. SOCK_TCP
D. SOCK_RELIABLE
Answer: B. SOCK_DGRAM
UDP uses datagrams, represented in Python by SOCK_DGRAM.
4. Which Python statement imports the socket module?
A. include socket
B. using socket
C. import socket
D. require(socket)
Answer: C. import socket
Python uses the import statement to load modules.
5. Which method connects a client socket to a remote host?
A. listen()
B. bind()
C. accept()
D. connect()
Answer: D. connect()
The client uses connect() to establish a connection to a specified
remote address and port.
,6. What does bind() typically do on a server socket?
A. Encrypts traffic
B. Associates the socket with a local address and port
C. Accepts an incoming connection
D. Resolves a hostname
Answer: B. Associates the socket with a local address and port
Servers bind sockets to a local IP address and port before listening for
connections.
7. Which socket method places a TCP server into listening mode?
A. listen()
B. wait()
C. receive()
D. connect()
Answer: A. listen()
After binding, a TCP server calls listen() to accept incoming
connection requests.
8. Which method accepts an incoming TCP connection?
A. open()
B. accept()
C. receive()
D. attach()
Answer: B. accept()
accept() returns a new socket representing the client connection and
the client's address.
, 9. Which Python method receives data from a TCP socket?
A. recv()
B. readnet()
C. getdata()
D. pull()
Answer: A. recv()
recv() reads bytes received from a connected socket.
10. Why is exception handling important in a network-remediation
script?
A. It guarantees Internet connectivity
B. It prevents all attacks
C. It allows the script to handle failures without terminating
unexpectedly
D. It automatically repairs every network problem
Answer: C. It allows the script to handle failures without
terminating unexpectedly
Network operations can fail for many reasons, so controlled
exception handling improves reliability.
11. Which Python construct is used for exception handling?
A. try/except
B. check/fail
C. error/catch
D. test/recover
Answer: A. try/except