Practice PCPP2 Network Programming questions with full explanations on every answer.
Start practicing
Network Programming — choose a session length
Free · No account required
Click any question to see the full explanation and answer options, or start a focused practice session above.
In a Python TCP server, what is the primary purpose of the backlog parameter in the listen(backlog) method?
2You are using socket.socket(socket.AF_INET, socket.SOCK_DGRAM). You attempt to send 10,000 bytes via sendto(). Why might the operation raise an OSError?
3When using socket.setsockopt(), which option is required to immediately reuse a port that is currently in a TIME_WAIT state after a server restart?
4You are designing a cross-platform network application. Why is it recommended to use socket.getaddrinfo() instead of socket.gethostbyname()?
5You are building an application using SSL/TLS. Which module must be used to wrap a standard socket to provide encrypted communication?
6You are configuring a server to handle high-concurrency requests. Why is it preferable to use the select.select() module over a simple blocking recv() loop?
7Which method should a developer use to retrieve the IP address and port of the remote peer connected to a TCP socket?
8Which socket method is used to bind a socket to a specific address and port?
9Which function in the socket module is used to convert a 32-bit integer from host byte order to network byte order?
10When handling TCP streams, why might recv(1024) return fewer than 1024 bytes even if the sender sent more?
11When implementing a custom application protocol over TCP, how should you handle message framing?
12You need to detect if a client has disconnected from your TCP server. What is the standard behavior of recv() when the peer performs a clean shutdown?
13What is the effect of setting a socket to non-blocking mode using socket.setblocking(False)?
14You are writing a UDP server. What is the main disadvantage of using UDP for high-volume data transmission compared to TCP?
15In a multi-threaded Python server, why is it discouraged to share a single socket object across multiple threads without synchronization?
16What is the purpose of the socket.recvfrom() method?
17Why is the socket.socket() constructor typically called with socket.AF_INET and socket.SOCK_STREAM for a standard web server?
18Which of the following is the correct way to close a socket object in Python?
19What is the significance of the SO_BROADCAST option in a UDP socket?
20When using select.select(inputs, outputs, exceptions), what does the 'outputs' list signify?
21Which of the following describes the behavior of TCP_NODELAY?
22You are configuring a socket timeout. What happens if you call socket.settimeout(5.0) and the operation exceeds 5 seconds?
23Which THREE of the following are valid address families or socket types used with the Python socket module?
24Which TWO of the following methods are typically used on a TCP server socket?
25Which TWO of the following are differences between TCP and UDP?
26Which THREE of the following are valid ways to send or receive data?
27Which TWO of the following are true regarding the socket.shutdown() method?
28Which THREE of the following are true regarding the use of the socket module in Python?
29Which THREE of the following options can be used with socket.setsockopt()?
30Which THREE of the following socket attributes or methods are relevant to managing socket timeouts?
31Which TWO of the following are common issues when using select.select()?
32Which TWO of the following are necessary to connect a TCP client to a server?
The Network Programming domain covers the key concepts tested in this area of the PCPP2 exam blueprint published by Python Institute. Courseiva provides free domain-focused practice, mock exams, missed-question review, and readiness tracking across all PCPP2 domains — no account required.
The Courseiva PCPP2 question bank contains 32 questions in the Network Programming domain. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Network Programming domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included