MS Master of Computer Science 4 — Questions and Answers
Question 1: Which network protocol resolves IP addresses to MAC addresses on a local area network?
- DNS
- DHCP
- ARP (Correct answer)
- ICMP
Correct answer: ARP
ARP (Address Resolution Protocol) broadcasts a request on the local network to discover which MAC address corresponds to a given IP address.
Question 2: What is a race condition in concurrent programming?
- A CPU scheduling algorithm that favors faster processes
- A bug where program outcome depends on unpredictable timing of thread execution (Correct answer)
- An optimization that reorders instructions for speed
- A deadlock between exactly two threads
Correct answer: A bug where program outcome depends on unpredictable timing of thread execution
A race condition occurs when two or more threads access shared data concurrently and the result depends on which thread executes first.
Question 3: In relational databases, what is the purpose of an index?
- To enforce referential integrity between tables
- To speed up data retrieval at the cost of additional storage and write overhead (Correct answer)
- To normalize data into third normal form
- To encrypt sensitive columns
Correct answer: To speed up data retrieval at the cost of additional storage and write overhead
A database index is a data structure (often a B-tree) that allows the engine to find rows matching a condition without a full table scan.
Question 4: Which sorting algorithm achieves O(n log n) time in all cases and uses O(1) extra space?
- Merge sort
- Heap sort (Correct answer)
- Quick sort
- Tim sort
Correct answer: Heap sort
Heap sort guarantees O(n log n) worst-case time by building a max-heap and repeatedly extracting the maximum, using only constant extra space.
Question 5: What is the primary purpose of Docker containers in software development?
- Virtual machine replacement with full OS isolation
- Packaging an application with its dependencies into a portable, reproducible unit (Correct answer)
- Managing relational database schemas
- Encrypting network traffic between microservices
Correct answer: Packaging an application with its dependencies into a portable, reproducible unit
Docker containers bundle application code and all dependencies so the software runs consistently across development, testing, and production environments.
Question 6: In the context of neural networks, what does backpropagation compute?
- Forward pass activations layer by layer
- Gradient of the loss function with respect to each weight using the chain rule (Correct answer)
- The optimal learning rate via line search
- Batch normalization statistics
Correct answer: Gradient of the loss function with respect to each weight using the chain rule
Backpropagation applies the chain rule of calculus in reverse through the network to compute how much each weight contributed to the loss.
Question 7: What distinguishes a process from a thread in an operating system?
- Threads have their own virtual address space; processes share one
- Processes have isolated address spaces; threads share the process's address space (Correct answer)
- Threads cannot be scheduled independently by the OS
- Processes are always lighter-weight than threads
Correct answer: Processes have isolated address spaces; threads share the process's address space
Each process has its own virtual address space and resources, while threads within a process share the same memory and file descriptors.
Which network protocol resolves IP addresses to MAC addresses on a local area network?