Operating System MCQ

Operating System MCQ for NTA UGC NET/GATE/ISRO/DRDO/NIELIT/KVS/NVS

Q1➡ |
If the time quantum is very large, a RR (Round-Robin) scheduling is the same as.
i ➥ FCFS
ii ➥ SJF
iii ➥ Multi-level queue
iv ➥ SRTF
Answer – I
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q2➡ |
Which of the following is not a CPU scheduling criterion?
i ➥ Burst time
ii ➥ CPU utilization
iii ➥ Response time
iv ➥ Throughput
Answer – I
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q3➡ |
Which among the following is a preemptive only scheduling algorithm?
i ➥ FCFS
ii ➥ SJF
iii ➥ RR
iv ➥ None of the above
Answer – III
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q4➡ |
CPU burst distribution is generally characterized as.
i ➥ Polynomial
ii ➥ Exponential or hyper-exponential
iii ➥ Linear
iv ➥ Constant
Answer – II
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q5➡ |
The primary difference between user-level threads and kernel threads is______.
i ➥ User level threads require memory management where kernel threads do not.
ii ➥ User level threads are independent of each other, whereas kernel threads can write into each other’s memory space.
iii ➥ User level threads do not use OS services via system calls, whereas kernel threads require system calls.
iv ➥ None of above.
Answer – III
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q6➡ |
TRUE/FALSE
(a) Can two processes be concurrently executing the same program executable?
(b) Can two running processes share the complete process image in physical memory (not just parts of it)?
Answer –

(a) TRUE, two processes can run the same program.
(b) FALSE, in general. (Only time this is possible is with copy-on-write during fork, and before anywrites have been made.)
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q7➡ |
Consider a parent process P that has forked a child process C. Now, P terminates while C is still running. Answer yes/no, and provide a brief explanation.
(a) Will C immediately become a zombie?
(b) Will P immediately become a zombie, until reaped by its parent?
i ➥ (a) True
ii ➥ (a) False
iii ➥ (b)True
iv ➥ ii,iii
Answer – IV
(a) No, it will be adopted by init.
(b) Yes.
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q8➡ |
Which of the following C library functions do NOT directly correspond to (similarly named) system calls? That is, the implementations of which of these C library functions are NOT straightforward invocations of the underlying system call?
(a) system, which executes a bash shell command.
(b) fork, which creates a new child process.
(c) exit, which terminates the current process.
(d) strlen, which returns the length of a string.
i ➥ only a
ii ➥ only b
iii ➥ only b and c
iv ➥ only a and d
Answer – IV
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q9➡ |
Which of the following actions by a running process will always result in a context switch of the running process, even in a non-preemptive kernel design?
(a) Servicing a disk interrupt, that results in another blocked process being marked as ready/runnable.
(b) A blocking system call.
(c) The system call exit, to terminate the current process.
(d) Servicing a timer interrupt.
i ➥ a,b
ii ➥ b,c
iii ➥ b,a
iv ➥ a,d
Answer – II
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q10➡ |
Consider a process P that needs to save its CPU execution context (values of some CPU registers) on some stack when it makes a function call or system call.
Which of the following statements is/are true?
(a) During a system call, when transitioning from user mode to kernel mode, the context of the process is saved on its kernel stack.
(b) During a function call in user mode, the context of the process is saved on its user stack.
(c) During a function call in kernel mode, the context of the process is saved on its user stack.
(d) During a function call in kernel mode, the context of the process is saved on its kernel stack.
i ➥ only a
ii ➥ only b,c
iii ➥ only a,b,d
iv ➥ only d
Answer – III
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q11➡ |
Which of the following statements is/are true about a context switch?
(a) A context switch from one process to another will happen every time a process moves from user mode to kernel mode
(b) For preemptive schedulers, a trap of any kind always leads to a context switch
(c) A context switch will always occur when a process has made a blocking system call, irrespective of whether the scheduler is preemptive or not
(d) For non-preemptive schedulers, a process that is ready/willing to run will not be context switched out
i ➥ only c,d
ii ➥ only a,b
iii ➥ only d
iv ➥ only d,b
Answer – I
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q12➡ |
In an operating system a utility which lets the users issue and execute commands from the keyboard is called __.
i ➥ Command Interpreter
ii ➥ Kernel
iii ➥ Terminal Handler
iv ➥ None of the above
Answer – I
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q13➡ |
The scheduler that brings processes into memory and swaps them out on disk as needed is referred to as:
i ➥ Medium-term scheduler
ii ➥ Long-term scheduler
iii ➥ Short-term scheduler
iv ➥ None of the above
Answer – I
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q14➡ |
Which one of the following is an advantage of multiprocessor systems?
i ➥ Increased security
ii ➥ Increased modularity
iii ➥ Increased reliability
iv ➥ None of above
Answer – III
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q15➡ |
System calls to allocate and free memory belongs to which of the operating system service category below:
i ➥ Information maintenance
ii ➥ Device manipulation
iii ➥ Process control
iv ➥ File manipulation
Answer – III
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q16➡ |
Which one of the following is FALSE?
(a) User level threads are not scheduled by the kernel
(b) When a user level thread is blocked, all other threads of its process are blocked
(c) Context switching between user level threads is faster than context switching between kernel level threads.
(d) Kernel level threads cannot share the code segment
i ➥ Only a
ii ➥ Only a,c
iii ➥ Only b
iv ➥ Only d
Answer – IV
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q17➡ |
The definition “an instance of a program in execution” best applies to which of the following?
i ➥ a user-level resource
ii ➥ a system-level resource
iii ➥ a thread
iv ➥ a process
Answer – IV
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q18➡ |
Which of the following is NOT an advantage of system-level threads over user-level threads?
i ➥ Switching between threads is faster
ii ➥ Blocking threads don’t stop the entire process
iii ➥ Each thread can be scheduled separately
iv ➥ Threads from the same process can run simultaneously on different cores/processors
Answer – I
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q19➡ |
What is meant by a “context switch”?
i ➥ Saving the state of one process and restoring the state of another process so that the CPU moves from running one process to running the other.
ii ➥ Any change in state of a process as it executes.
iii ➥ The change which occurs on the stack of a running process as it makes a function call, including the allocation of memory for any parameters and the local variables.
iv ➥ The switch between a process running in user mode to running in kernel mode. This can happen as the result of a system call or an exception.
Answer – I
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q20➡ |
Given three processes A, B, and C with corresponding burst times 20, 5, and 2, what is the average waiting time with a first come first served (FCFS) scheduler? All processes are ready to run at the same time but they arrived in the order A, B, then C.
i ➥ 3
ii ➥ 15
iii ➥ 25
iv ➥ 9
Answer – II
The Gantt chart for the given schedule is;

Average waiting time = (0+20+25)/3 = 15.
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q21➡ |
Which of the following is a disadvantage of user level threads?
i ➥ Thread switching is not expensive than a procedure call.
ii ➥ User-level thread does not require modification to operating systems.
iii ➥ User level threads require non blocking system calls
iv ➥ User-level threads can be implemented on a OS that does not support threads.
Answer – III
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q22➡ |
Which of the following has the fastest access times?
i ➥ Registers
ii ➥ Cache
iii ➥ Flash memory
iv ➥ Main memory
Answer – I
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q23➡ |
Which one is defines mutual exclusion?
i ➥ A set of processes are prevented from simultaneously accessing a shared data structure
ii ➥ A situation when a system tries to perform two or more operations at the same time.
iii ➥ A set of processes are prevented from running because higher priority processes keep getting in ahead of them
iv ➥ A set of processes is waiting for an event that only another process in the set can cause
Answer – I
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q24➡ |
A process control block (PCB) exists only for processes in
i ➥ the ready state.
ii ➥ ready, running, and blocked states
iii ➥ ready and running states.
iv ➥ ready and blocked states
Answer – II
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q25➡ |
A round robin scheduler:
i ➥ gives each process an equal share of the CPU.
ii ➥ dynamically adjusts the priority of processes based on their past CPU usage.
iii ➥ favors processes that are expected to have a short CPU burst.
iv ➥ favors high priority processes.
Answer – I
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q26➡ |
Compared to a non-preemptive scheduler, a preemptive scheduler can move processes from the:
i ➥ ready to the running state.
ii ➥ running to the blocked state.
iii ➥ running to the ready state.
iv ➥ blocked to the ready state.
Answer – III
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q27➡ |
Assume three jobs arrive at approximately the same time, but Job A arrives slightly before Job B, and Job B arrives slightly before job C. Job A requires 2 sec of CPU, Job B is 8 secs, and Job C is 7 secs. Assume a time-slice of 1 sec. Given a FIFO scheduler, what is the turnaround time of job B?
i ➥ 10 seconds
ii ➥ 8 seconds
iii ➥ 2 seconds
iv ➥ 0 seconds
Answer – I
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q28➡ |
The memory map of a multi-threaded process looks similar to that of a single threaded process except that the multi-threaded one has
i ➥ a heap and stack for each thread
ii ➥ a heap for each thread.
iii ➥ a copy of the data segment per thread.
iv ➥ a stack for each thread.
Answer – IV
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q29➡ |
Which of the following C library functions do NOT directly correspond to (similarly named) system calls? That is, the implentations of which of these C library functions are NOT straightforward invocations of the underlying system call?
(a) system
(b) fork
(c) exit
(d) strlen
i ➥ Only (a)
ii ➥ Only (d)
iii ➥ Only (a), (d)
iv ➥ Only (b),(d)
Answer – III

(a) system, which executes a bash shell command.
(b) fork, which creates a new child process.
(c) exit, which terminates the current process.
(d) strlen, which returns the length of a string.
Ans: (a), (d)
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q30➡ |
A semaphore puts a thread to sleep.
i ➥ until the semaphore’s value reaches a specific number.
ii ➥ until another thread issues a notify on the semaphore.
iii ➥ if it increments the semaphore’s value above 0.
iv ➥ if it tries to decrement the semaphore’s value below 0.
Answer – IV
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Leave a Reply

Your email address will not be published.

error: Content is protected !!
Open chat
1
Hi,how Can We Help You ?