Operating System Most Importrant Questios PDF
Operating System Most Importrant Questios PDF
Answer: d
Explanation: An Operating System acts as an intermediary between user/user
applications/application programs and hardware. It is a program that manages hardware
resources. It provides services to application programs.
Answer: c
Explanation: The main function of a command interpreter is to get and execute the next user-
specified command. Command Interpreter checks for valid command and then runs that
command else it will throw an error.
Answer: d
Explanation: In Operating Systems, CPU scheduling algorithms are:
i) First Come First Served scheduling
ii) Shortest Job First scheduling
iii) Priority scheduling
iv) Round Robin scheduling
v) Multilevel Queue scheduling
vi) Multilevel Feedback Queue scheduling
All of these scheduling algorithms have their own advantages and disadvantages.
4. To access the services of the operating system, the interface is provided by the ___________
a) Library
b) System calls
c) Assembly instructions
d) API
Answer: b
Explanation: To access services of the Operating System an interface is provided by the System
Calls. Generally, these are functions written in C and C++. Open, Close, Read, Write are some of
most prominently used system calls.
Answer: a
Explanation: None.
advertisement
6. Which one of the following is not true?
a) kernel remains in the memory during the entire computer session
b) kernel is made of various modules which can not be loaded in running operating system
c) kernel is the first part of the operating system to load into memory during booting
d) kernel is the program that constitutes the central core of the operating system
Answer: b
Explanation: Kernel is the first program that is loaded in memory when OS is loading as well as it
remains in memory till OS is running. Kernel is the core part of the OS which is responsible for
managing resources, allowing multiple processes to use the resources and provide services to
various processes. Kernel modules can be loaded and unloaded in run-time i.e. in running OS.
7. Which one of the following errors will be handle by the operating system?
a) lack of paper in printer
b) connection failure in the network
c) power failure
d) all of the mentioned
Answer: d
Explanation: All the mentioned errors are handled by OS. The OS is continuously monitoring all of
its resources. Also, the OS is constantly detecting and correcting errors.
Answer: a
Explanation: None.
9. If a process fails, most operating system write the error information to a ______
a) new file
b) another running process
c) log file
d) none of the mentioned
Answer: c
Explanation: If a process fails, most operating systems write the error information to a log file.
Log file is examined by the debugger, to find out what is the actual cause of that particular
problem. Log file is useful for system programmers for correcting errors.
10. Which one of the following is not a real time operating system?
a) RTLinux
b) Palm OS
c) QNX
d) VxWorks
Answer: b
Explanation: VxWorks, QNX & RTLinux are real-time operating systems. Palm OS is a mobile
operating system. Palm OS is developed for Personal Digital Assistants (PDAs).
Answer: d
Explanation: OS X has a hybrid kernel. Hybrid kernel is a combination of two different kernels. OS
X is developed by Apple and originally it is known as Mac OS X.
Answer: d
Explanation: In Operating Systems, each process has its own address space which contains code,
data, stack, and heap segments or sections. Each process also has a list of files that is opened by
the process as well as all pending alarms, signals, and various signal handlers.
13. In a timeshare operating system, when the time slot assigned to a process is completed, the
process switches from the current state to?
a) Suspended state
b) Terminated state
c) Ready state
d) Blocked state
Answer: c
Explanation: In a time-sharing operating system, when the time slot given to a process is
completed, the process goes from the running state to the Ready State. In a time-sharing
operating system, unit time is defined for sharing CPU, it is called a time quantum or time slice. If
a process takes less than 1 time quantum, then the process itself releases the CPU.
14. Cascading termination refers to the termination of all child processes if the parent process
terminates ______
a) Normally or abnormally
b) Abnormally
c) Normally
d) None of the mentioned
Answer: a
Explanation: Cascading termination refers to the termination of all child processes if the parent
process terminates Normally or Abnormally. Some systems don’t allow child processes to exist if
the parent process has terminated. Cascading termination is normally initiated by the operating
system.
15. When a process is in a “Blocked” state waiting for some I/O service. When the service is
completed, it goes to the __________
a) Terminated state
b) Suspended state
c) Running state
d) Ready state
Answer: c
Explanation: None.
17. The portion of the process scheduler in an operating system that dispatches processes is
concerned with ____________
a) assigning ready processes to waiting queue
b) assigning running processes to blocked queue
c) assigning ready processes to CPU
d) all of the mentioned
Answer: c
Explanation: None.
Answer: c
Explanation: In a time sharing system, each user needs to get a share of the CPU at regular
intervals.
Answer: a
Explanation: In an effective operating system, we must verify the deadlock each time a request
for resources is made at fixed time intervals.
20. A deadlock avoidance algorithm dynamically examines the __________ to ensure that a circular
wait condition can never exist.
a) operating system
b) resources
c) system storage state
d) resource allocation state
Answer: d
Explanation: Resource allocation states are used to maintain the availability of the already and
current available resources.
21. Swapping _______ be done when a process has pending I/O, or has to execute I/O operations
only into operating system buffers.
a) must never
b) maybe
c) can
d) must
Answer: a
Explanation: None.
Answer: c
Explanation: None.
Answer: d
Explanation: None.
24. The operating system and the other processes are protected from being modified by an
already running process because ____________
a) every address generated by the CPU is being checked against the relocation and limit registers
b) they have a protection algorithm
c) they are in different memory spaces
d) they are in different logical addresses
Answer: a
Explanation: None.
25. Using transient code, _______ the size of the operating system during program execution.
a) maintains
b) changes
c) increases
d) decreases
Answer: b
Explanation: None.
26. The operating system maintains a ______ table that keeps track of how many frames have
been allocated, how many are there, and how many are available.
a) memory
b) mapping
c) page
d) frame
Answer: d
Explanation: None.
27. To obtain better memory utilization, dynamic loading is used. With dynamic loading, a routine
is not loaded until it is called. For implementing dynamic loading ____________
a) special support from operating system is essential
b) special support from hardware is required
c) user programs can implement dynamic loading without any special support from hardware or
operating system
d) special support from both hardware and operating system is essential
Answer: c
Explanation: None.
28. The _________ presents a uniform device-access interface to the I/O subsystem, much as
system calls provide a standard interface between the application and the operating system.
a) Device drivers
b) I/O systems
c) Devices
d) Buses
Answer: a
Explanation: None.
Answer: d
Explanation: None.
30. Hard real time operating system has ______________ jitter than a soft real time operating
system.
a) equal
b) more
c) less
d) none of the mentioned
Answer: c
Explanation: Jitter is the undesired deviation from the true periodicity.
31. For real time operating systems, interrupt latency should be ____________
a) zero
b) minimal
c) maximum
d) dependent on the scheduling
Answer: b
Explanation: Interrupt latency is the time duration between the generation of interrupt and
execution of its service.
Answer: d
Explanation: None.
33. The priority of a process will ______________ if the scheduler assigns it a static priority.
a) depends on the operating system
b) change
c) remain unchanged
d) none of the mentioned
Answer: c
Explanation: None.
Answer: d
Explanation: None.
Answer: c
Explanation: None.
36. If the sum of the working – set sizes increases, exceeding the total number of available frames
____________
a) the operating system selects a process to suspend
b) the system crashes
c) then the process crashes
d) the memory overflows
Answer: a
Explanation: None.
Answer: b
Explanation: None.
38. The operating system keeps a small table containing information about all open files called
____________
a) file table
b) directory table
c) open-file table
d) system table
Answer: c
Explanation: None.
Answer: a
Explanation: None.
40. The operating system _______ the links when traversing directory trees, to preserve the acyclic
structure of the system.
a) deletes
b) considers
c) ignores
d) none of the mentioned
Answer: c
Explanation: None.
41. To recover from failures in the network operations _____________ information may be
maintained.
a) operating system
b) ip address
c) stateless
d) state
Answer: d
Explanation: None.
42. On systems where there are multiple operating system, the decision to load a particular one is
done by _____________
a) process control block
b) file control block
c) boot loader
d) bootstrap
Answer: c
Explanation: None.
Answer: a
Explanation: None.
44. The two steps the operating system takes to use a disk to hold its files are _______ and ________
a) caching & logical formatting
b) logical formatting & swap space creation
c) swap space creation & caching
d) partitioning & logical formatting
Answer: d
Explanation: None.
45. The _______ program initializes all aspects of the system, from CPU registers to device
controllers and the contents of main memory, and then starts the operating system.
a) bootstrap
b) main
c) bootloader
d) rom
Answer: a
Explanation: None.
46. In SCSI disks used in high end PCs, the controller maintains a list of _________ on the disk. The
disk is initialized during ________ formatting which sets aside spare sectors not visible to the
operating system.
a) destroyed blocks, partitioning
b) bad blocks, low level formatting
c) destroyed blocks, high level formatting
d) bad blocks, partitioning
Answer: b
Explanation: None.
47. Which principle states that programs, users, and even the systems be given just enough
privileges to perform their task?
a) principle of least privilege
b) principle of process scheduling
c) principle of operating system
d) none of the mentioned
Answer: a
Explanation: None.
Answer: b
Explanation: None.
Answer: c
Explanation: None.
Answer: d
Explanation: An Operating System acts as an intermediary between user/user
applications/application programs and hardware. It is a program that manages hardware
resources. It provides services to application programs.
52. To access the services of operating system, the interface is provided by the ___________
a) System calls
b) API
c) Library
d) Assembly instructions
Answer: a
Explanation: To access services of the Operating System an interface is provided by the System
Calls. Generally, these are functions written in C and C++. Open, Close, Read, Write are some of
most prominently used system calls.
Answer: c
Explanation: Kernel is the first program which is loaded in memory when OS is loading as well as
it remains in memory till OS is running. Kernel is the core part of the OS which is responsible for
managing resources, allowing multiple processes to use the resources and provide services to
various processes. Kernel modules can be loaded and unloaded in run-time i.e. in running OS.
54. Which one of the following error will be handle by the operating system?
a) power failure
b) lack of paper in printer
c) connection failure in the network
d) all of the mentioned
Answer: d
Explanation: All the mentioned errors are handled by OS. The OS is continuously monitoring all of
its resources. Also, the OS is constantly detecting and correcting errors.
Answer: a
Explanation: The main function of command interpreter is to get and execute the next user-
specified command. Command Interpreter checks for valid command and then runs that
command else it will throw an error.
56. In Operating Systems, which of the following is/are CPU scheduling algorithms?
a) Round Robin
b) Shortest Job First
c) Priority
d) All of the mentioned
View Answer
Answer: d
Explanation: In Operating Systems, CPU scheduling algorithms are:
i) First Come First Served scheduling
ii) Shortest Job First scheduling
iii) Priority scheduling
iv) Round Robin scheduling
v) Multilevel Queue scheduling
vi) Multilevel Feedback Queue scheduling
All of these scheduling algorithms have their own advantages and disadvantages.
57. If a process fails, most operating system write the error information to a ______
a) log file
b) another running process
c) new file
d) none of the mentioned
Answer: a
Explanation: If a process fails, most operating systems write the error information to a log file.
Log file is examined by the debugger, to find out what is the actual cause of that particular
problem. Log file is useful for system programmers for correcting errors.
58. Which facility dynamically adds probes to a running system, both in user processes and in the
kernel?
a) DTrace
b) DLocate
c) DMap
d) DAdd
Answer: a
Explanation: A facility that dynamically adds probes to a running system, both in user process and
in the kernel is called DTrace. This is very much useful in troubleshooting kernels in real-time.
59. Which one of the following is not a real time operating system?
a) VxWorks
b) QNX
c) RTLinux
d) Palm OS
Answer: d
Explanation: VxWorks, QNX & RTLinux are real-time operating systems. Palm OS is a mobile
operating system. Palm OS is developed for Personal Digital Assistants (PDAs).
Answer: b
Explanation: OS X has a hybrid kernel. Hybrid kernel is a combination of two different kernels. OS
X is developed by Apple and originally it is known as Mac OS X.
61. Which process can be affected by other processes executing in the system?
a) cooperating process
b) child process
c) parent process
d) init process
Answer: a
Explanation: A cooperating process can be affected by other processes executing in the system.
Also it can affect other processes executing in the system. A process shares data with other
processes, such a process is known as a cooperating process.
62. When several processes access the same data concurrently and the outcome of the execution
depends on the particular order in which the access takes place is called ________
a) dynamic condition
b) race condition
c) essential condition
d) critical condition
Answer: b
Explanation: When several processes access the same data concurrently and the outcome of the
execution depends on the particular order in which access takes place is called race condition.
63. If a process is executing in its critical section, then no other processes can be executing in
their critical section. What is this condition called?
a) mutual exclusion
b) critical exclusion
c) synchronous exclusion
d) asynchronous exclusion
Answer: a
Explanation: If a process is executing in its critical section, then no other processes can be
executed in their critical section. This condition is called Mutual Exclusion. Critical section of the
process is shared between multiple processes. If this section is executed by more than one or all
of them concurrently then the outcome of this is not as per desired outcome. For this reason the
critical section of the process should not be executed concurrently.
advertisement
Answer: c
Explanation: Semaphore is a synchronization tool. Semaphore is a mechanism which
synchronizes or controls access of threads on critical resources. There are two types of
semaphores i) Binary Semaphore ii) Counting Semaphore.
Answer: a
Explanation: A semaphore is a shared integer variable that can not drop below zero. In binary
semaphore, if the value of the semaphore variable is zero that means there is a process that uses
a critical resource and no other process can access the same critical resource until it is released.
In Counting semaphore, if the value of the semaphore variable is zero that means there is no
resource available.
Answer: c
Explanation: Mutual exclusion can be provided by both mutex locks and binary semaphore.
Mutex is a short form of Mutual Exclusion. Binary semaphore also provides a mechanism for
mutual exclusion. Binary semaphore behaves similar to mutex locks.
67. When high priority task is indirectly preempted by medium priority task effectively inverting
the relative priority of the two tasks, the scenario is called __________
a) priority inversion
b) priority removal
c) priority exchange
d) priority modification
Answer: a
Explanation: When a high priority task is indirectly preempted by a medium priority task
effectively inverting the relative priority of the two tasks, the scenario is called priority inversion.
Answer: c
Explanation: Process synchronization can be done on both hardware and software level. Critical
section problems can be resolved using hardware synchronisation. But this method is not simple
for implementation so software synchronization is mostly used.
Answer: a
Explanation: To enable a process to wait within the monitor a condition variable must be declared
as condition.
71. To differentiate the many network services a system supports ______ are used.
a) Variables
b) Sockets
c) Ports
d) Service names
Answer: c
Explanation: None.
72. RPC provides a(an) _____ on the client-side, a separate one for each remote procedure.
a) stub
b) identifier
c) name
d) process identifier
Answer: a
Explanation: None.
advertisement
Answer: d
Explanation: None.
74. To resolve the problem of data representation on different systems RPCs define _____________
a) machine dependent representation of data
b) machine representation of data
c) machine-independent representation of data
d) none of the mentioned
Answer: c
Explanation: None.
Answer: d
Explanation: None.
Answer: b
Explanation: None.
77. A process that is based on IPC mechanism which executes on different systems and can
communicate with other processes using message based communication, is called ________
a) Local Procedure Call
b) Inter Process Communication
c) Remote Procedure Call
d) Remote Machine Invocation
Answer: c
Explanation: None
Answer: c
Explanation: None.
79. What is a magneto-optic disk?
a) primary storage
b) secondary storage
c) removable disk
d) none of the mentioned
Answer: c
Explanation: None.
80. The magneto-optic head flies ___________ the disk surface than a magnetic disk head does.
a) much farther from
b) much closer to
c) at the same distance as
d) none of the mentioned
Answer: a
Explanation: None.
Answer: b
Explanation: None.
82. The phase change disk is coated with a material that can freeze into either _______ or ________
state.
a) crystalline, solid
b) ice, amorphous
c) crystalline, liquid
d) crystalline, amorphous
Answer: d
Explanation: None.
Answer: b
Explanation: None.
84. A tape holds _______ data than optical or magnetic disk cartridge.
a) lesser
b) more
c) much lesser
d) none of the mentioned
Answer: b
Explanation: None.
Answer: a
Explanation: None.
Answer: a
Explanation: None.
87. The surface area of tape is ________ the surface area of a disk.
a) much lesser than
b) much larger than
c) equal to
d) none of the mentioned
Answer: b
Explanation: None.
Answer: a
Explanation: None.
Answer: b
Explanation: None.
advertisement
Answer: a
Explanation: None.
Answer: d
Explanation: None.
Answer: d
Explanation: None.
Answer: b
Explanation: None.
Answer: d
Explanation: None.
Answer: b
Explanation: None.
Answer: d
Explanation: None.
Answer: d
Explanation: None.
Answer: c
Explanation: None.
Answer: b
Explanation: None
Answer: b
Explanation: None.
Answer: a
Explanation: None.
Answer: b
Explanation: None.
advertisement
Answer: c
Explanation: None.
105. A process is selected from the ______ queue by the ________ scheduler, to be executed.
a) blocked, short term
b) wait, long term
c) ready, short term
d) ready, long term
Answer: c
Explanation: None.
Answer: b
Explanation: There is no other choice.
107. The switching of the CPU from one process or thread to another is called ____________
a) process switch
b) task switch
c) context switch
d) all of the mentioned
Answer: d
Explanation: None.
Answer: c
Explanation: None.
Answer: a
Explanation: None.
Answer: a
Explanation: None.
Answer: d
Explanation: None.
Answer: b
Explanation: None.
Answer: b
Explanation: None.
Answer: c
Explanation: None.
115. There are 10 different processes running on a workstation. Idle processes are waiting for an
input event in the input queue. Busy processes are scheduled with the Round-Robin time sharing
method. Which out of the following quantum times is the best value for small response times, if
the processes have a short runtime, e.g. less than 10ms?
a) tQ = 15ms
b) tQ = 40ms
c) tQ = 45ms
d) tQ = 50ms
Answer: a
Explanation: None
a) I only
b) I and III only
c) II and III only
d) I, II and III
Answer: d
Explanation: I) Shortest remaining time first scheduling is a preemptive version of shortest job
scheduling. It may cause starvation as shorter processes may keep coming and a long CPU burst
process never gets CPU.
II) Preemption may cause starvation. If priority based scheduling with preemption is used, then a
low priority process may never get CPU.
III) Round Robin Scheduling improves response time as all processes get CPU after a specified
time.
117. Find the size of the memory if its address consists of 22 bits. Assume the memory is 2-
byte addressable.
Solution –
If the given address consists of ‘k’ bits, then 2k locations are possible.
Given that the size of the memory is 2-bytes addressable, which means that the size of one
location is 2 bytes.
118. Calculate the number of address bits, if the memory has a size of 16 GB. Assume the
memory is 4-byte addressable.
Solution –
If the given address consists of ‘k’ bits, then 2k locations are possible.
2k x 4 = 234
2k = 234 / 22 (∵ 22 = 4)
2k = 232
∴ k = 32 bits
119. Consider a machine with 32 bit logical addresses, 4 KB page size and page table entries
of 4 bytes each. Find the size of the page table in bytes. Assume the memory is byte
addressable.
Solution –
Size of page table = Number of entries in page table x Page table entry size
120. Consider a system with page table entries of 8 bytes each. If the size of the page table
is 256 bytes, what is the number of entries in the page table?
Solution –
Size of page table = Number of entries in the page table x page table entry size
Given – Size of page table = 256 bytes, page table entry size = 8 bytes.
121. Find the total number of frames. If a system, size of the main memory is 230 bytes, the
page size is 4 KB and the size of each page table entry is 32-bit.
Solution –
122. A system has 32 bit Virtual adress and 8KB page size.main memory is 128 MB..the size of page
table, when page table ,when pt entry has 1 valid bit 1 modified bit and frame bits is_____(MB)p.s what
is frame bits..is it the frame entry size?
= 232 / 213
= 219
= log2(227 / 213)
= 14 bits
= 220 B
= 1 MB
------
Explanation:
You can easily see a deadlock in a situation where..
P[0] has acquired m[0] and waiting for m[1]
P[1] has acquired m[1] and waiting for m[2]
P[2] has acquired m[2] and waiting for m[3]
P[3] has acquired m[3] and waiting for m[0]
124. A graphics card has on board memory of 1 MB. Which of the following modes can the card
not support? (GATE CS 2000)
(a) 1600 x 400 resolution with 256 colours on a 17 inch monitor
(b) 1600 x 400 resolution with 16 million colours on a 14 inch monitor
(c) 800 x 400 resolution with 16 million colours on a 17 inch monitor
(d) 800 x 800 resolution with 256 colours on a 14 inch monitor
Answer: (b)
Explanation:
Monitor size doesn’t matter here. So, we can easily deduct that answer should be (b) as this
has the highest memory requirements. Let us verify it.
Number of bits required to store a 16M colors pixel = ceil(log2(16*1000000)) = 24
Number of bytes required for 1600 x 400 resolution with 16M colors = (1600 * 400 * 24)/8 which
is 192000000 (greater than 1MB).
125 Consider a virtual memory system with FIFO page replacement policy. For an arbitrary
page access pattern, increasing the number of page frames in main memory will (GATE CS
2001)
a) Always decrease the number of page faults
b) Always increase the number of page faults
c) Some times increase the number of page faults
d) Never affect the number of page faults
Answer: (c)
Explanation:
Incrementing the number of page frames doesn’t always decrease the page faults (Belady’s
Anomaly). For details see http://en.wikipedia.org/wiki/Belady%27s_anomaly
126. Consider a machine with 64 MB physical memory and a 32-bit virtual address space. If the
page size is 4KB, what is the approximate size of the page table? (GATE 2001)
(a) 16 MB
(b) 8 MB
(c) 2 MB
(d) 24 MB
Answer: (c)
Explanation:
A page entry is used to get address of physical memory. Here we assume that single level of Paging is
happening. So the resulting page table will contain entries for all the pages of the Virtual address space.
Using above formula we can say that there will be 2^(32-12) = 2^20 entries in page table.
No. of bits required to address the 64MB Physical memory = 26.
So there will be 2^(26-12) = 2^14 page frames in the physical memory. And page table needs to store
the address of all these 2^14 page frames. Therefore, each page table entry will contain 14 bits address
of the page frame and 1 bit for valid-invalid bit.
Since memory is byte addressable. So we take that each page table entry is 16 bits i.e. 2 bytes long.
127. Consider Peterson’s algorithm for mutual exclusion between two concurrent processes i
and j. The program executed by process is shown below.
repeat
turn = j;
while ( P ) do no-op;
section
flag [ i ] = false;
until false;
128. For the program to guarantee mutual exclusion, the predicate P in the while loop should be
(GATE 2001)
a) flag [j] = true and turn = i
b) flag [j] = true and turn = j
c) flag [i] = true and turn = j
d) flag [i] = true and turn = i
Answer: (b)
128. Suppose the time to service a page fault is on the average 10 milliseconds, while a memory access
takes 1 microsecond. Then a 99.99% hit ratio results in average memory access time of (GATE CS 2000)
(a) 1.9999 milliseconds
(b) 1 millisecond
(c) 9.999 microseconds
(d) 1.9999 microseconds
Answer: (d)
Explanation:
129. In a system with 32 bit virtual addresses and 1 KB page size, use of one-level page tables for virtual
to physical address translation is not practical because of (GATE CS 2003)
a) the large amount of internal fragmentation
b) the large amount of external fragmentation
c) the large memory overhead in maintaining page tables
d) the large computation overhead in the translation process
Answer (c)
Since page size is too small it will make size of page tables huge.
= (2^32)/(2^10)
= 2^22
130) Let the page fault service time be 10ms in a computer with average memory access time being
20ns. If one page fault is generated for every 10^6 memory accesses, what is the effective access time
for the memory?
(A) 21ns
(B) 30ns
(C) 23ns
(D) 35ns
Answer (B)
= ( 1/(10^6) )* 10 * (10^6) ns +
(1 - 1/(10^6)) * 20 ns
= 30 ns (approx)