28 Lecture
CS410
Midterm & Final Term Short Notes
Network Programming Part II
"Network Programming Part II: Build on your foundation with advanced concepts. Dive into web APIs, asynchronous programming, security protocols, and distributed applications. Elevate your network programming skills for modern, complex systems."
Important Mcq's
Midterm & Finalterm Prepration
Past papers included
Download PDF
**Question 1:**
Which protocol is commonly used for retrieving email from a mail server?
a) HTTP
b) SMTP
c) POP3
d) UDP
**Solution: c) POP3**
**Question 2:**
What does API stand for in the context of network programming?
a) Application Protocol Interface
b) Application Program Interface
c) Automated Programming Interface
d) Active Protocol Interface
**Solution: b) Application Program Interface**
**Question 3:**
In network programming, what does the term "asynchronous" refer to?
a) Data sent over a network using UDP
b) Data sent over a network using TCP
c) Simultaneous execution of multiple tasks without waiting for each to complete
d) Sequential execution of tasks in a network application
**Solution: c) Simultaneous execution of multiple tasks without waiting for each to complete**
**Question 4:**
Which encryption protocol ensures secure communication over a network?
a) HTTP
b) TCP
c) SSL/TLS
d) FTP
**Solution: c) SSL/TLS**
**Question 5:**
What is a RESTful API?
a) A protocol for sending emails
b) A standardized approach for creating and interacting with web services
c) A method for securing network connections
d) A type of network topology
**Solution: b) A standardized approach for creating and interacting with web services**
**Question 6:**
Which Python library is commonly used for making HTTP requests and interacting with APIs?
a) os
b) requests
c) socket
d) urllib
**Solution: b) requests**
**Question 7:**
What does OAuth stand for in the context of network security?
a) Open Authorization
b) Online Authentication
c) Operating Authority
d) Only Access
**Solution: a) Open Authorization**
**Question 8:**
Which protocol is used for secure file transfer over a network?
a) HTTP
b) FTP
c) SMTP
d) UDP
**Solution: b) FTP**
**Question 9:**
What is a distributed application in network programming?
a) An application that only works on one computer
b) An application that is split into separate components that run on different machines
c) An application that uses UDP exclusively
d) An application that uses only synchronous programming
**Solution: b) An application that is split into separate components that run on different machines**
**Question 10:**
Which protocol is used for real-time communication over the Internet, often used in instant messaging and video conferencing?
a) SMTP
b) HTTP
c) UDP
d) XMPP
**Solution: d) XMPP**
Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included
Download PDF
**Question 1:**
Explain the concept of asynchronous programming in the context of network programming.
**Answer:**
Asynchronous programming allows tasks to execute concurrently without waiting for each other. In network programming, this means that a program can perform multiple tasks simultaneously, such as sending and receiving data, improving overall efficiency.
**Question 2:**
What is a REST API, and how does it differ from other types of APIs?
**Answer:**
A REST (Representational State Transfer) API is a standardized approach for building web services that use HTTP methods to interact with resources. It emphasizes simplicity and statelessness. Other APIs may use different protocols and communication methods.
**Question 3:**
Describe the purpose of SSL/TLS in network communication.
**Answer:**
SSL (Secure Sockets Layer) and its successor TLS (Transport Layer Security) are encryption protocols that ensure secure and encrypted communication over a network, protecting data from unauthorized access or tampering.
**Question 4:**
Explain the OAuth authentication process and its significance in network security.
**Answer:**
OAuth (Open Authorization) is a protocol that allows third-party applications to access user data without exposing user credentials. It enhances network security by providing controlled access to resources while keeping sensitive information secure.
**Question 5:**
What is a distributed application, and how does it differ from a traditional application?
**Answer:**
A distributed application is one that is split into separate components running on different machines, often communicating over a network. This differs from a traditional application that runs on a single machine.
**Question 6:**
How does FTP (File Transfer Protocol) work, and what is its role in network programming?
**Answer:**
FTP is a protocol used for transferring files between computers over a network. It involves a client-server architecture where the client requests files from the server. It is commonly used for secure and efficient file transfer.
**Question 7:**
Discuss the importance of error handling in network programming.
**Answer:**
Error handling is crucial to network programming as it ensures graceful handling of unexpected situations, such as connection failures or data corruption. Proper error handling enhances the reliability and stability of networked applications.
**Question 8:**
Explain the role of WebSockets in real-time communication.
**Answer:**
WebSockets enable bidirectional communication between a client and a server over a single, long-lived connection. They are ideal for real-time applications such as instant messaging, online gaming, and live notifications.
**Question 9:**
Describe how API rate limiting works and its significance in API usage.
**Answer:**
API rate limiting restricts the number of requests a client can make to an API within a specified time frame. It prevents abuse, ensures fair usage, and maintains the API's performance and availability.
**Question 10:**
Discuss the advantages and disadvantages of using synchronous versus asynchronous programming in network applications.
**Answer:**
Synchronous programming simplifies code but can lead to slower performance. Asynchronous programming improves efficiency by allowing concurrent tasks but can be more complex to implement and debug.