Question examples Flashcards
(16 cards)
What information defines a UDP socket?
a. Source IP address
b. Source port number
c. Destination IP address
d. Destination port number
d. Destination port number (UDP is connectionless; only the destination port matters)
What do processes exchange when communicating in different end systems?
a. Memory
b. Files
c. Messages
d. Protocols
c. Messages (Processes communicate via messages, e.g. HTTP requests/responses)
Which of the following is(are) TCP/IP layer(s)?
a. Network
b. Session
c. Application
d. Transport
a,c,d
Which command deletes a directory and all its contents?
a. mkdir
b. rm -r
c. cp -r
d. rmdir
b. rm -r (Recursive delete; rmdir only remove empty directories)
‘What is the server’s response to the HTTP GET request?
a. 200 OK
b. 404 Not Found
c. 401 Unauthorised
d. 403 Forbidden
a. 200 OK (Default success response for valid GET requests)
What is it called when processes wait indefinitely for an event caused by another waiting process?
a. Starvation
b. Priority inversion
c. Deadlock
d. Blocking
c. Deadlock (Circular dependency; no progress possible)
Which of the following are program threats?
a. Viruses
b. Worms
c. Port scanning
d. Trojan horse
a,b,d
Which protocol provides connection-oriented communication?
a. UDP
b. TCP
c. ICMP
d. HTTP
b. TCP (TCP is reliable/connection-oriented; UDP is connectionless)
What ensures only one process executes its critical section at a time?
a. Deadlock
b. Semaphore
c. Starvation
d. Fragmentation
b. Semaphore (Sync tool to enforce mutual exclusion)
Which is a key difference between IPv4 and IPv6?
a. IPv6 uses shorter addresses
b. IPv6 eliminates fragmentation
c. IPv4 supports more devices
d. IPv6 removes checksums
b. IPv6 eliminates fragmentation (handled by endpoints, not routers)
Which is NOT a Java thread state?
a. NEW
b. RUNNABLE
c. SLEEPABLE
d. TERMINATED
c. SLEEPING
Which uses the same key for encryption and decryption?
a. RSA
b. AES
c. Diffie-Hellman
d. PGP
b. AES (Symmetric encryption; others are asymmetric)
What sync mechanism solves the producer-consumer problem?
a. Mutex
b. Monitor
c. Both a and b
d. Neither
c. Both a and b (Mutex locks, Monitors can enforce buffer access rules)
Discuss how two processes communicate over a network. Include sockets, ports, IP address and transport services
- Sockets: Endpoints for communication (IP + port)
- Ports: Identify processes (e.g. HTTP = port 80)
- IP Addresses: Locate hosts (e.g. 192.168.1.1)
- Transport Services: TCP (reliable), UDP (unreliable)
- E.g. Web browser (client) uses TCP to connect to a server’s socket (IP: port)
What are system programs? Differentiate from applications and discuss 5 categories.
- Definition: Software managing hardware/resources (e.g., OS utilities)
- vs. Application: System programs- OS level (e.g. disk formatter), Applications- User level (e.g. web browser)
- Categories: File management (ls, cp), Process control (kill, ps), System monitoring (top), Programming tools (compilers), Communication (SSH, pipes)
Discuss 3 types of program threats with examples
- Virus: Attaches to files (e.g., macro virus in Word docs).
- Worm: Self-replicating (e.g., Morris Worm, 1988).
- Trojan Horse: Disguised malware (e.g., fake game installer).