Essential OS and Computer Networking Lab Exam Q&A

Operating System (OS) Lab Questions

Basic OS Concepts

  1. What is an Operating System (OS)?

    → It is system software that acts as an interface between the user and the hardware.

  2. What are the main functions of an OS?

    Process management, memory management, file management, I/O management, and security.

  3. What is a process?

    → A program in execution.

  4. Difference between process and program?

    → A program is passive (stored on disk); a process is active (in execution).

  5. What is a thread?

    → A lightweight process; multiple threads can run within a single process.

CPU Scheduling

  1. What is CPU Scheduling?

    → The process of selecting which process gets CPU time.

  2. Name some CPU scheduling algorithms.

    → FCFS, SJF, SRTF, Round Robin, and Priority Scheduling.

  3. What is context switching?

    → Saving and loading process states when the CPU switches from one process to another.

  4. 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
  5. Which algorithm gives minimum average waiting time?

    Shortest Job First (SJF).

Memory Management

  1. What is paging?

    → Dividing memory into fixed-size blocks (pages) to manage memory efficiently.

  2. What is segmentation?

    → Memory is divided based on logical divisions like code, data, stack, etc.

  3. What is virtual memory?

    → A technique to use part of the disk as an extension of main memory.

  4. What is thrashing?

    → When the system spends more time swapping pages than executing processes.

Deadlock

  1. What is deadlock?

    → When two or more processes wait indefinitely for resources held by each other.

  2. What are the four necessary conditions for deadlock?

    • Mutual exclusion
    • Hold and wait
    • No preemption
    • Circular wait
  3. How can you prevent deadlocks?

    → By breaking one of the four necessary conditions (e.g., by using resource ordering).

  4. What is a safe state?

    → A state in which the system can allocate resources without entering a deadlock.

File Systems

  1. What is a file?

    → A collection of related information stored on secondary storage.

  2. What are file access methods?

    → Sequential, direct, and indexed access.

Synchronization

  1. What is process synchronization?

    → Coordination of processes to ensure the correct sequence of execution.

  2. What is a semaphore?

    → A variable used to control access to shared resources.

  3. 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

  1. What is a computer network?

    → A collection of interconnected devices for communication and resource sharing.

  2. What are the types of networks?

    → LAN (Local Area Network), MAN (Metropolitan Area Network), WAN (Wide Area Network), and PAN (Personal Area Network).

  3. Define bandwidth and latency.

    Bandwidth: The data transfer rate; Latency: The time delay.

OSI & TCP/IP Models

  1. What is the OSI model?

    → A 7-layer conceptual model for communication:

    1. Physical
    2. Data Link
    3. Network
    4. Transport
    5. Session
    6. Presentation
    7. Application
  2. Difference between OSI and TCP/IP model?

    → OSI has 7 layers, while TCP/IP has 4 layers (Application, Transport, Internet, Network Access).

  3. 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

  1. What is an IP address?

    → A unique numerical identifier for a device on a network.

  2. Difference between IPv4 and IPv6?

    IPv4 uses 32-bit addresses; IPv6 uses 128-bit addresses.

  3. What is subnetting?

    → Dividing a large network into smaller, manageable sub-networks.

  4. What is DNS?

    Domain Name System – converts human-readable domain names to IP addresses.

  5. What is ARP?

    Address Resolution Protocol – maps an IP address to a physical MAC address.

  6. What is the difference between TCP and UDP?

    TCP is connection-oriented and reliable; UDP is connectionless, faster, but not reliable.

Networking Commands

  1. 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

  1. What is a router?

    → A device that connects multiple networks and forwards packets based on IP addresses.

  2. What is a switch?

    → Connects devices within a LAN and forwards frames based on MAC addresses.

  3. What is a hub?

    → Broadcasts data to all connected ports; operates without filtering.

  4. What is CSMA/CD?

    Carrier Sense Multiple Access with Collision Detection – a protocol used primarily in Ethernet networks.