Q1:Which of the following is false about linux device drivers?
a) Can be baked into kernel using static linking
b) Can be dynamically linked as kernel objects
c) Can handle I/O system calls on a device file
d) Can be debugged using GDB
Q2:Which of the following is false about linux device drivers?
a) There is a single interface for all device types
b) Can crash kernel on a malfunction
c) Can be a source of data races
d) Need superuser privileges to insert
Q3:Which protocol guarantees in-order arrival of packets through a connection?
a) IP
b) UDP
c) TCP
d) Ethernet
Q4:Which internet layer is TCP part of?
a) Physical Layer
b) Data Link Layer
c) Internet Layer
d) Transport Layer
Q5:What is the sequence of calls a TCP client would do to send a message?
a) socket, bind, listen, accept, send
b) socket, connect, send
c) socket, bind, sendto
d) none of the above
Q6:Which of the following is not a variable definition?
a) int x;
b) extern int x;
c) static int x;
d) none of the above
Q7:Which of the following is typically not in a .h header file?
a) function declarations
b) #define macro definitions
c) struct type definitions
d) variable definitions
Q8:What is the first executed command on 'make', after modifying rpg.c?
a) gcc -o rpg rpg.o
b) gcc -c rpg.c
c) gcc -o rpg.o -c rpg.c
d) none of the above
Q9:What will this program output?
a) Yes
b) No
c) none of the above
Q10:Which is not a reason to choose threads over processes?
a) Better program reliability
b) Less memory footprint
c) Less performance overhead
d) Ability to easily share data
Q11:Which is an advantage of kernel threading over user threading?
a) Application has more control over scheduling
b) Can achieve parallelism
c) Can achieve concurrency
d) Requires lighter kernel support
Q12:Which of the following is per-thread state?
a) heap
b) data section
c) stack
d) text section
Q13:Which can be a source of a data race?
a) global variables
b) heap
c) stack
d) all of the above
Q14:Which API is not related to thread synchronization?
a) pthread_mutex_lock
b) pthread_join
c) pthread_cond_wait
d) pthread_yield
Q15:What is not a precondition for a deadlock?
a) Mutual exclusion on resource
b) Hold resource while waiting for another
c) Cyclical waiting
d) Ability to preempt resource
Answers:
1) d 2) a 3) c 4) d 5) b 6) b 7) d 8) c 9) c 10) a 11) b 12) c 13) d 14) d 15) d