Wednesday, November 12, 2014

Gate Questions Set-4

GATE-2002

Which of the following scheduling algorithms is non-preemptive?
(a) Round Robin (b) First-In First-Out
(c) Multilevel Queue Scheduling
(d) Multilevel Queue Scheduling with Feedback

Ans:-Option-B

The optimal page replacement algorithm will select the page that

(a) Has not been used for the longest time in the past.
(b) Will not be used for the longest time in the future.
(c) Has been used least number of times.
(d) Has been used most number of times.

Ans:- Option-B

GATE-2003

A uni-processor computer system only has two processes, both of which alternate 10 ms CPU bursts with 90 ms I/O bursts. Both the processes were created at nearly the same time. The I/O of both processes can proceed in parallel. Which of the following scheduling strategies will result in the least CPU utilization (over a long period of time) for this system?

(a) First come first served scheduling
(b) Shortest remaining time first scheduling
(c) Static priority scheduling with different priorities for the two processes
(d) Round robin scheduling with a time quantum of 5 ms

Ans:-Option-A


Consider the following set of processes, with the arrival times and the CPU-burst
times given in milliseconds.



What is the average turnaround time for these processes with the preemptive
shortest remaining processing time first (SRPT) algorithm?
(a) 5.50 (b) 5.75 (c) 6.00 (d) 6.25

Read This Post

Tuesday, November 11, 2014

Gate Questions Set-3



GATE-1998

Which of the following devices should get higher priority in assigning interrupts?

(a) Hard disk (b) Printer
(c) Keyboard (d) Floppy disk

Ans:- Option-C

GATE-1999

1. System calls are usually invoked by using

      (a)a software interrupt (b) polling 
      (c) an indirect jump      (d) a privileged instruction

Ans:- Option-A


GATE-1999

2.  A multi-user, multi-processing operating system cannot be implemented on      hardware that does not support

    (a)  Address-translation 
    (b)  DMA for disk transfer
    (c)  At least two modes of CPU execution (privileged and non-privileged)
    (d)  Demand paging

Ans: Option A,B,C

GATE-1999

3. Which of the following actions is/are typically not performed by the         operating system when switching context from process A to process B? 

(a) Saving current register values and restoring saved register values for process B.    
(b) Changing address translation tables. 
(c) Swapping out the memory image of process A to the disk.    
(d) Invalidating the translation look-aside buffer. 

Ans: Option C,D

Explanation:

When the context switch occur processor save the currently running data into register and then load new data of other process.
Swapping out the memory image of process to the disk occurs only when the process is suspended.

GATE-2000

1.  Which of the following need not necessarily be saved on a context switch
between processes?
(a) General purpose registers (b) Translation look-aside buffer
(c) Program counter (d) All of the above

Answer: Option-B

Explanation:

When a context switch occur, running process data stored in PCB, so that, when the scheduler gets back to the execution of the same process again, it can restore this state and continue.

A TLB (Translation look-aside buffer) is a cache memory for CPU it stores the process data which is frequently used by CPU.

GATE-2000

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

(a) 1.9999 milliseconds (b) 1 millisecond
(c) 9.999 microseconds (d) 1.9999 microseconds

Ans:- Option-D

Average memory access time=[(% of page miss)*(time to service a page fault) + (% of page hit)*(memory access time)]/100

So, average memory access time in microseconds is.
(99.99*1 + 0.01*10*1000)/100 = (99.99+100)/1000 = 199.99/1000 =1.9999 µs

GATE-2001

1.  Which of the following statements is false?

(a) Virtual memory implements the translation of a program’s address space into physical memory address space
(b) Virtual memory allows each program to exceed the size of the primary memory
(c) Virtual memory increases the degree of multiprogramming
(d) Virtual memory reduces the context switching overhead.

Answer: Option-A

GATE-2001

2.  Consider a set of n tasks with known run times r1, r2, ….rn to be run on a
uniprocessor machine. Which of the following processor scheduling algorithms will result in the maximum throughput?
(a) Round-Robin (b) Shortest-Job-First
(c) Highest-Response-Ratio-Next (d) First-Come-First-Served

Ans:- Option-B

Explanation:-

Throughput:-

Total number of tasks executed per unit time. 
Shortest Job First has maximum throughput because in this scheduling technique shortest jobs are executed first hence maximum number of tasks are completed.

GATE-2001

3.  Where does the swap space reside?

(a) RAM (b) Disk
(c) ROM (d) On-chip cache

Answer: Option-B

Explanation:
Swap space is an area on disk that temporarily holds a process memory image. When physical memory demand is sufficiently low, process memory images are brought back into physical memory from the swap area. Having sufficient swap space enables the system to keep some physical memory free at all times.


Read This Post

Thursday, June 12, 2014

Gate Questions Set-2




GATE-1995

1. Which scheduling policy is most suitable for a time-shared operating systems?

(a) Shortest Job First                        (b) Round Robin
(c) First Come First Server               (d) Elevator

Ans: option-B

Explanation:-
                    The round robin scheduling gives each process a fair time for processing.

GATE-1995

Which of the following page replacement algorithms suffers from Belady’s
anamoly?
(a) Optimal replacement (b) LRU (c) FIFO (d) Both (a) and (c)

Ans:-Option-C

Explanation:-

Belady’s anamoly:-
                            It is a phenomenon in which when increasing number of page frame number increasing page faults. In the FIFO manner when we increase the page frame the page fault also increase.

GATE-1995 

The principle of locality justifies the use of

(a) interrupts (b) DMA
(c) Polling (d) Cache Memory

Ans:- Option-D

Explanation:-

Principle of Locality

Locality means we can predict with some reason that which instructions or data a process will use in near future based on the accesses in the past.

GATE-1995

 In a paged segmented scheme of memory management, the segment table itself must have a page table because

(a) the segment table is often too large to fit in one page
(b) each segment is spread over a number of pages
(c) segment tables point to page table and not to the physical
(d) the processor’s description base register points to a page table

Ans:-Option-B



GATE-1996

1. A critical section is a program segment 

(a) which should run in a certain specified amount of time  
(b) which avoids deadlocks  
(c) where shared resources are accessed  
(d) which must be enclosed by a pair of semaphore operations, P and V 

Ans: option-C


GATE-1996

2. A solution to the Dining Philosophers Problem which avoids deadlock is 

(a) ensure that all philosophers pick up the left fork before the right fork  
(b) ensure that all philosophers pick up the right fork before the left fork 
(c) ensure that one particular philosopher picks up the left fork before the right fork, and that all other philosophers pick up the right fork before the left fork 
(d) None of the above  

Ans: option-C

Explanation:-

GATE-1998

1. A counting semaphore was initialized to 10. Then 6 P (wait) operations and 4V (signal) operations were completed on this semaphore. The resulting value of the semaphore is

(a) 0  (b) 8   (c) 10   (d) 12

Ans: option-B

Explanation:-

The wait operation (P) decrements the semaphore value.
The Signal operation (v) increments the semaphore value.

6P => decrements the semaphore 6 times. So the value becomes 4.
4V => increments the semaphore 4 times. So the value becomes 8.


GATE-1998

1. Which of the following is true?

(a) Unless enabled, a CPU will not be able to process interrupts.     
(b) Loop instructions cannot be interrupted till they complete.
(c) A processor checks for interrupts before executing a new instruction. 
(d) Only level triggered interrupts are possible on microprocessors

Ans: option-A

Explanation:

Interrupt:-
                 An interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. An interrupt alerts the processor to a high-priority condition requiring the interruption of the current code the processor is executing (the current thread). The processor responds by suspending its current activities, saving its state, and executing a small program called an interrupt handler (or interrupt service routine, ISR) to deal with the event.
Interrupts are unexpected events in a sequence of execution of instructions causing an interruption of the normal program flow. 
Read more

Option(b) is false.

Option (c) depends upon the architecture of the processor.
Option (d) is false because we have level-triggered interrupts and edge-triggered interrupts.
Read This Post

Thursday, March 27, 2014

Gate Questions Set-1



GATE-1992

1. At a particular time of computation the value of a counting semaphore is 7.
    Then 20 P operations and 15 V operations were completed on this
    semaphore. The resulting value of the semaphore is:

(a) 42 (b) 2 (c) 7 (d) 12

Ans:- Option - B

Explanation:- 

The wait operation (P) decrements the semaphore value.
The Signal operation(v) increments the semaphore value.

The 20 P operation will decrements the semaphore value 20 times.
The 15 V operation will increments the semaphore value 15 times.


GATE-1992

2. A computer system has 6 tape drives, with n process completing for them.
Each process may need 3 tape drives. The maximum value of n for which the
system is guaranteed to be deadlock free is:

(a) 2 (b) 3 (c) 4 (d) 1

Ans:-Option-A

Explanation:- 

Deadlock:- 
                   Deadlock is a situation in which two or more competing actions are each waiting for the other to finish, and thus neither ever does. Read more

Lets check with maximum value that is option c

suppose process 1==> 2 tape drives
            process 2==>  2 tape drives
            process 3==>  1 tape drive
            process 4==>  1 tape drive

in this situation process 1 waiting for other processes to be free. and same way process 2 waiting for process 2 waiting for other processes to be free. so deadlock will occur.

Lets check option B

Process 1==> 2 tape drives.
Process 2==> 2 tape drives.
Process 3==> 2 tape drives.

Here also one process waiting for other process to release resources. so deadlock will occur.

now check Option A

Process 1==> 3 tape drives.
Process 2==> 3 tape drives.


GATE-1992

3. Which of the following is an example of a spooled device?

(a) The terminal used to the input data for a program being executed.
(b) The secondary memory device in a virtual memory system
(c) A line printer used to print the output of a number of jobs.
(d) None of the above

Ans:- Option-C

Explanation:-

Spool means simultaneous peripheral operations on-line.

The common spooling application is print spooling:
Generally Printers typically can print only a single document at a time and require seconds or minutes to do so. With spooling application, multiple processes can write documents to a print queue without waiting. As soon as a process has written its document to the spool device, the process can perform other tasks, while a separate printing process operates the printer.


GATE-1993

1. Consider a system having m resources of the same type. These resources are shared by 3 processes A, B and C, which have peak demands of 3, 4 and 6 respectively. For what value of m deadlock will not occur?

       (a)7 (b) 9 (c) 10 (d) 13 (e) 15

Ans:- Option-D


Explanation:-

Lets start with option-A

Process A ==> 2 resources 
Process B ==> 3 resources 
Process C ==> 2 resources

In this situation one process will wait for other processes to be free. so deadlock occur.

Option- B

Process A ==> 2 resources 
Process B ==> 3 resources 
Process C ==> 4 resources      
Deadlock.

Option-C

Process A ==> 2 resources 
Process B ==> 3 resources 
Process C ==> 5 resources

Option D

Process A ==> 3 resources 
Process B ==> 4 resources 
Process C ==> 6 resources
So it will be deadlock free.

Note: Also option E is also possible.


GATE-1993

2. Assume that the following jobs are to be executed on a single processor system

Job_id
Burst time
P
4
Q
1
R
8
S
1
T
2

The jobs are assumed to have arrived at time 0 and in the order p, q, r, s, t.
Calculate the departure time (completion time) for job p if scheduling is 
round robin with time slice 1   

(a)  4  (b) 10 (c) 11 (d) 12 (e) None of the above

Ans:- option-C

Explanation:-






Read This Post

About Us

Like Us

Total Pageviews

Designed By gategeeks