WorksheetsOperating Systems Quiz - Basic 03 to Basic 04
Total questions: 40
Worksheet time: 20mins
What does the `exec()` system call do in Unix/Linux?
Spawns a new process
Duplicates the process
Replaces the current process with a new program
Exits the current process
Which of the following scheduling algorithms may lead to starvation?
FCFS
Round Robin
Shortest Job First
Priority Scheduling
Which algorithm is used in demand paging to decide which page to replace?
FIFO
LRU
Optimal
All of the above
In UNIX, what happens if a child process is orphaned?
It’s terminated immediately
It’s taken over by the kernel
It’s adopted by the init process
It halts the system
In a multi-core system, CPU affinity helps by:
Restricting a process to run on a specific core
Allowing only one process at a time
Preventing I/O operations
Speeding up memory fetch
Which structure maintains the status of all active memory pages in a system?
Page Map Table
Translation Lookaside Buffer
Page Table
Frame Map
Which of the following is an example of a real-time OS?
MS-DOS
VxWorks
Windows 10
Ubuntu
The difference between a zombie and an orphan process is:
Zombies use more CPU
Orphans are adopted by init; zombies are dead but not reaped
Orphans become zombies
Orphans block I/O
Which Linux utility is best used to trace system calls?
lsof
gdb
strace
netstat
How does Copy-on-Write improve performance during fork()?
Copies entire memory block
Uses memory swapping
Shares memory pages until a write is performed
Skips loading libraries
What does `mmap()` do in Linux systems?
Mounts a device
Allocates memory from heap
Maps a file to memory
Prints memory map
A thread differs from a process in that:
Threads have separate address spaces
Processes are lighter
Threads share code and data segments
Threads are slower to switch
Which OS concept helps in memory protection?
Multitasking
Virtual memory
Paging
Segmentation with paging
Which UNIX signal is used to terminate a process?
SIGSTOP
SIGINT
SIGKILL
SIGCONT
Which system call is used for creating threads in Linux at low level?
clone()
pthread_create()
fork()
spawn()
What is the role of the Translation Lookaside Buffer (TLB)?
Tracks files
Improves disk access
Caches page table entries
Stores network configs
Which of these can cause a segmentation fault?
Reading from a closed file
Accessing a restricted memory location
Network timeouts
Missing kernel module
In Linux, what does the OOM killer do?
Clears swap
Deletes unused files
Kills memory-intensive processes when RAM is full
Resets kernel modules
Which file in Linux logs kernel-level messages?
/var/log/syslog
/etc/logs/kernel.log
/proc/kmsg
/var/log/kern.log
Which command provides a snapshot of process information in real-time in Linux?
kill
ps
top
uptime
In a multi-threaded process, which part is not shared across threads?
Code section
Heap memory
Open file descriptors
Stack
Which mechanism is used to avoid race conditions without busy waiting?
Spinlock
Semaphore
Mutex
Monitor
What does the term 'priority inversion' refer to?
High-priority thread preempting low-priority one
Low-priority task blocking a high-priority task
CPU switches to lower frequency
File permissions being flipped
Which system call in Linux is used for memory mapping of files?
malloc()
mmap()
fork()
fopen()
What is the main purpose of lazy swapping?
Swap pages ahead of time
Swap only when necessary
Increase CPU load
Prevent segmentation faults
In the Linux kernel, which mechanism avoids deadlocks by detecting circular waits?
Banker’s Algorithm
Wait-for Graph
Starvation checker
Lock validator
Which Linux command allows you to control scheduling policies for a process?
taskset
chrt
schedctl
psched
What happens during a context switch?
OS restarts
Registers, PC, and state info are saved and restored
A thread dies
Cache is cleared
How does NUMA affect OS-level memory management?
All memory is pooled globally
Memory is uniformly accessed
Memory is split across multiple nodes and access times vary
Virtual memory is disabled
Which flag in the `clone()` system call helps create threads rather than separate processes?
CLONE_THREAD
CLONE_PARENT
CLONE_FILES
CLONE_NEWNS
Which of the following ensures fair CPU scheduling in modern Linux kernels?
Real-time clock
Fair Queue
Completely Fair Scheduler (CFS)
Priority Queue
Which of the following is an implementation of microkernel architecture?
Windows NT
Linux
Mach
Solaris
What does `ulimit` command control in Linux?
User memory access
File size and process limits
CPU frequency
Root access
Which kernel data structure maps virtual to physical memory in Linux?
inode table
pagemap
vmap
meminfo
Which of the following causes a page fault?
Illegal opcode
Disk read error
Access to page not in main memory
CPU overheating
Which command provides detailed memory usage statistics including shared memory?
free
vmstat
top
smem
Which of these Linux kernel features supports live patching?
LiveCD
Kexec
Ksplice
Initramfs
Which of the following manages memory page swapping in Linux?
init
swapon
swapd
kswapd
Which subsystem in Linux is responsible for cgroups and namespaces?
Systemd
Kernel
LSM
Init
What is the main function of the O(1) scheduler in older Linux kernels?
Deterministic time for scheduling decision
Assigning tasks in round-robin
Prioritizing foreground apps only
Running only real-time tasks
