SNP Quiz
SNP Quiz
SNP Quiz
a. server; client
b. client; server
c. server; server
d. None of the choices are correct
2. ________ server can process only one request at a time.
a. An iterative
b. A concurrent
c. A concurrent or an iterative
d. None of the choices are correct
3. ________ server can process multiple requests at a time.
a. An iterative
b. A concurrent
c. A concurrent or an iterative
d. None of the choices are correct
4. Information in a computer is stored in __________ byte order.
a. Host
b. Network
c. Server
d. None of the choices are correct
5. Network programming needs information to be in __________ byte order.
a. Host
b. Network
c. Server
d. None of the choices are correct
6. In __________ representation, the most significant byte is stored in the starting address.
a. Little endian
b. Big endian
c. Middle endian
d. None of the above
7. Communication using TCP is usually____________.
a. connectionless, iterative
b. connectionless, concurrent
c. connection-oriented, iterative
d. connection-oriented, concurrent
8. SOCK_STREAM sockets are used by ______ processes.
a. UDP
b. TCP
c. SCTP
d. ARP
9. SOCK_DGRAM sockets are used by ______ processes.
a. UDP
b. TCP
c. SCTP
d. ARP
10. SOCK_RAW sockets are used by ______ processes.
a. UDP
b. TCP
c. SCTP
d. ARP
11. Which combination of family and type of socket is used to create a datagram socket
a. AF_ROUTE, SOCK_DGRAM
b. AF_INET, SOCK_DGRAM
c. AF_LOCAL, SOCK_STREAM
d. AF_KEY, SOCK_DGRAM
12. Socket functions that pass a socket address structure from process to kernel are
a. accept, getpeername, getsockname
b. bind, connect, select, recvfrom
c. accept, recvfrom, sendmsg, recvmsg
d. bind, connect, sendto, close
13. Which one of following is the correct sequence of the function(s) to be called for an
elementary server
a. Socket(),connect(),write(),read(),close()
b. Socket(),bind(),listen(),accept(),read(),write(),close()
c. Socket(),bind(),listen(),accept(),write(),read(),close()
d. Socket(),listen(),accept(),read(),write(),close()
14. The value-result argument is used when passing a socket address structure from
a. Kernel to Process
b. None of these
c. Process to Kernel
d. Kernel to Kernel
15. Internet protocols use which byte ordering for the multi-byte integers
a. None of these
b. both big-endian and little-endian byte
c. big-endian byte
d. little-endian byte
16. From the following combinations of family and type of socket, which one is an incorrect
combination?
a. SOCK_DGRAM, AF_INET6
b. SOCK_STREAM, AF_KEY
c. SOCK_STREAM, AF_INET
d. SOCK_RAW, AF_INET6
17. Which one is the protocol family for TCP/IP
a. AF_ROUTE
b. AF_UNIX
c. AF_INET
d. AF_LOCAL
18. Listening sockets which have an incomplete connection queue entry at server, will be in
which of the following state
a. SYN State
b. ESTABLISHED State
c. SYN_SENT State
d. SYN_RCVD State
19. Which one can causes to send a FIN on TCP connection regardless of the descriptor’s
reference count
a. both close() and shutdown()
b. close()
c. shutdown()
d. None of these
20. What may happens in a fork()’ed based concurrent server if the parent does not close
each connected socket returned by accept()
a. Connections will remain open
b. Parent will run out of descriptors
c. None of the client connections will be terminated
d. All of these
21. IP address and port number should not be hard-coded in the program because
a. It affects scalability
b. It may affects functionality
c. It affects portability of code
d. It may reduces availability of machine
22. How many times hello world will be printed
main()
{
fork(); fork(); fork();
printf("Hello World!");
}
a. 3
b. 6
c. 8
d. 12
23. How many reading and writing ends will be there in total
main()
{
int fd1[2],fd2[2];
pipe(fd1);
pipe(fd2);
fork();
fork();
}
a. 2
b. 4
c. 8
d. 12
24. Port numbers are of
a. 1 byte
b. 2 bytes
c. 4 bytes
d. 16 bytes
25. What is port number of daytime server?
a. 88
b. 13
c. 31
d. 80
26. Socket returns ________ descriptor and accept returns _________ descriptor
a. Connection,listening
b. Listening , connection
c. Socket, connection
d. Connection, socket
27. Which one is true for TCP:
a. Reliable delivery of data or reliable notification of failure.
b. TCP guarantees that the data will be received by the other endpoint
c. TCP is 100% reliable protocol
d. All of the above
28. Which one is true?
a. TCP and UDP both provide flow control
b. TCP and UDP both do not provide flow control
c. TCP Provides flow control
d. UDP provides flow control
29. TCP three way handshake will take place when
a. client executes socket
b. server executes accept
c. client executes connect
d. none of the above
30. Which variable stores IP address in socket address structure?
a. s_addr
b. sin_addr
c. in_addr
d. none of above