B.S.W.E. Bachelor of Software Engineering Operating Systems & Systems Programming 1 — Questions and Answers
Question 1: What is a process in the context of an operating system?
- A set of CPU instructions stored on disk
- An instance of a program in execution with its own memory space (Correct answer)
- A background service managed by the kernel
- A hardware interrupt handler
Correct answer: An instance of a program in execution with its own memory space
A process is a running instance of a program, with its own dedicated memory address space, program counter, and system resources.
Question 2: What is the main difference between a process and a thread?
- Processes share memory; threads do not
- Threads share the same memory space within a process; processes have separate memory spaces (Correct answer)
- Threads run on separate CPUs; processes run on a single CPU
- Processes are faster to create than threads
Correct answer: Threads share the same memory space within a process; processes have separate memory spaces
Threads within the same process share the same address space and resources, while separate processes have independent memory spaces.
Question 3: Which CPU scheduling algorithm selects the process with the shortest expected execution time next?
- First-Come, First-Served (FCFS)
- Round Robin
- Shortest Job First (SJF) (Correct answer)
- Priority Scheduling
Correct answer: Shortest Job First (SJF)
Shortest Job First (SJF) schedules the process with the smallest estimated execution time next, minimizing average waiting time.
Question 4: What is a deadlock in operating systems?
- A situation where a process uses 100% CPU
- A condition where two or more processes are blocked forever, each waiting for a resource held by the other (Correct answer)
- A type of memory leak in kernel space
- A scheduling policy that starves low-priority processes
Correct answer: A condition where two or more processes are blocked forever, each waiting for a resource held by the other
Deadlock occurs when a set of processes are permanently blocked because each process holds a resource needed by another process in the set.
Question 5: In operating systems, what does virtual memory allow?
- Running programs faster by bypassing the CPU cache
- Programs to use more memory than physically available by using disk storage as an extension of RAM (Correct answer)
- Encrypting memory contents for security
- Sharing memory between different physical machines
Correct answer: Programs to use more memory than physically available by using disk storage as an extension of RAM
Virtual memory extends physical RAM using disk space (swap), allowing processes to use address spaces larger than available physical memory.
Question 6: Which memory allocation issue occurs when free memory exists but is fragmented into small pieces too small to satisfy a request?
- Memory leak
- Stack overflow
- External fragmentation (Correct answer)
- Internal fragmentation
Correct answer: External fragmentation
External fragmentation occurs when there is enough total free memory but it is split into non-contiguous blocks that cannot satisfy a large allocation request.
What is a process in the context of an operating system?