Essential OS and Computer Networking Lab Exam Q&A
Operating System (OS) Lab Questions
Basic OS Concepts
What is an Operating System (OS)?
→ It is system software that acts as an interface between the user and the hardware.
What are the main functions of an OS?
→ Process management, memory management, file management, I/O management, and security.
What is a process?
→ A program in execution.
Difference between process and program?
→ A program is passive (stored on disk); a process is active (in execution).
What is a thread?
→ A lightweight process; multiple threads can run within a single process.
CPU Scheduling
What is CPU Scheduling?
→ The process of selecting which process gets CPU time.
Name some CPU scheduling algorithms.
→ FCFS, SJF, SRTF, Round Robin, and Priority Scheduling.
What is context switching?
→ Saving and loading process states when the CPU switches from one process to another.
Define turnaround time, waiting time, and response time.
- Turnaround time = Completion Time – Arrival Time
- Waiting time = Turnaround Time – Burst Time
- Response time = First Response Time – Arrival Time
Which algorithm gives minimum average waiting time?
→ Shortest Job First (SJF).
Memory Management
What is paging?
→ Dividing memory into fixed-size blocks (pages) to manage memory efficiently.
What is segmentation?
→ Memory is divided based on logical divisions like code, data, stack, etc.
What is virtual memory?
→ A technique to use part of the disk as an extension of main memory.
What is thrashing?
→ When the system spends more time swapping pages than executing processes.
Deadlock
What is deadlock?
→ When two or more processes wait indefinitely for resources held by each other.
What are the four necessary conditions for deadlock?
- Mutual exclusion
- Hold and wait
- No preemption
- Circular wait
How can you prevent deadlocks?
→ By breaking one of the four necessary conditions (e.g., by using resource ordering).
What is a safe state?
→ A state in which the system can allocate resources without entering a deadlock.
File Systems
What is a file?
→ A collection of related information stored on secondary storage.
What are file access methods?
→ Sequential, direct, and indexed access.
Synchronization
What is process synchronization?
→ Coordination of processes to ensure the correct sequence of execution.
What is a semaphore?
→ A variable used to control access to shared resources.
Difference between binary and counting semaphore?
→ Binary: Allows values 0 or 1 (acts like a lock); Counting: Allows multiple accesses (integer values).
Computer Networking Lab Questions
Networking Basics
What is a computer network?
→ A collection of interconnected devices for communication and resource sharing.
What are the types of networks?
→ LAN (Local Area Network), MAN (Metropolitan Area Network), WAN (Wide Area Network), and PAN (Personal Area Network).
Define bandwidth and latency.
→ Bandwidth: The data transfer rate; Latency: The time delay.
OSI & TCP/IP Models
What is the OSI model?
→ A 7-layer conceptual model for communication:
- Physical
- Data Link
- Network
- Transport
- Session
- Presentation
- Application
Difference between OSI and TCP/IP model?
→ OSI has 7 layers, while TCP/IP has 4 layers (Application, Transport, Internet, Network Access).
What is the function of each OSI layer?
→ Be ready to briefly explain the role of each layer (e.g., Transport layer handles segmentation and reassembly).
IP & Protocols
What is an IP address?
→ A unique numerical identifier for a device on a network.
Difference between IPv4 and IPv6?
→ IPv4 uses 32-bit addresses; IPv6 uses 128-bit addresses.
What is subnetting?
→ Dividing a large network into smaller, manageable sub-networks.
What is DNS?
→ Domain Name System – converts human-readable domain names to IP addresses.
What is ARP?
→ Address Resolution Protocol – maps an IP address to a physical MAC address.
What is the difference between TCP and UDP?
→ TCP is connection-oriented and reliable; UDP is connectionless, faster, but not reliable.
Networking Commands
Common Linux commands used in networking labs:
ping- → Checks connectivity to a host.
ifconfig/ip addr- → Displays IP configuration information.
netstat- → Shows active network connections and statistics.
traceroute- → Shows the path packets take to reach a destination.
nslookup- → Finds the IP address of a domain name.
arp -a- → Displays the ARP table (IP-to-MAC mappings).
Protocols and Devices
What is a router?
→ A device that connects multiple networks and forwards packets based on IP addresses.
What is a switch?
→ Connects devices within a LAN and forwards frames based on MAC addresses.
What is a hub?
→ Broadcasts data to all connected ports; operates without filtering.
What is CSMA/CD?
→ Carrier Sense Multiple Access with Collision Detection – a protocol used primarily in Ethernet networks.
