Operating system gate questions and answers

Operating system Previous year gate questions Q1. Synchronization in the classical readers and writers problem can be achieved throug...

Operating system Previous year gate questions

Q1.Synchronization in the classical readers and writers problem can be achieved through use of semaphores. In the following incomplete code for readers-writers problem, two binary semaphores mutex and wrt are used to obtain synchronization. [GATE 2007]

wait (wrt)
writing is performed
signal (wrt)
wait (mutex) 
readcount = readcount + 1
if readcount = 1 then S1
reading is performed
readcount = readcount - 1
if readcount = 0 then S4
signal (mutex)
The values of S1, S2, S3, S4, (in that order) are
1.signal (mutex), wait (wrt), signal (wrt), wait (mutex)
2.signal (wrt), signal (mutex), wait (mutex), wait (wrt)
3.wait (wrt), signal (mutex), wait (mutex), signal (wrt)
4.signal (mutex), wait (mutex), signal (mutex), wait (mutex)

Q2. Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are randomly assigned.
Method Used by P1
while (S1 == S2) ;
Critica1 Section
S1 = S2;
Method Used by P2
while (S1 != S2) ;
Critica1 Section
S2 = not (S1);
Which one of the following statements describes the properties achieved and why? [GATE 2010]
A-Mutual exclusion but not progress
B-Progress but not mutual exclusion
C-Neither mutual exclusion nor progress
D-Both mutual exclusion and progress

Q3. Three concurrent processes X, Y, and Z execute three different code segments that access and update certain shared variables. Process X executes the P operation (i.e., wait) on semaphores a, b and c; process Y executes the P operation on semaphores b, c and d; process Z executes the P operation on semaphores c, d, and a before entering the respective code segments. After completing the execution of its code segment, each process invokes the V operation (i.e., signal) on its three semaphores. All semaphores are binary semaphores initialized to one. Which one of the following represents a deadlock free order of invoking the P operations by the processes? [GATE 2013]
A-X: P(a)P(b)P(c) Y:P(b)P(c)P(d) Z:P(c)P(d)P(a)
B-X: P(b)P(a)P(c) Y:P(b)P(c)P(d) Z:P(a)P(c)P(d)
C-X: P(b)P(a)P(c) Y:P(c)P(b)P(d) Z:P(a)P(c)P(d)
D-X: P(a)P(b)P(c) Y:P(c)P(b)P(d) Z:P(c)P(d)P(a)

Q4.Which one of the following is FALSE and why? [GATE 2014]
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

Q5.Which of the following is NOT a valid deadlock prevention scheme and explain why? [GATE 2000]
a) Release all resources before requesting a new resource
b) Number the resources uniquely and never request a lower numbered resource than the last one requested.
c) Never request a resource after releasing any resource
d) Request and all required resources be allocated before execution.

Q6. An operating system uses shortest remaining time first scheduling algorithm for pre-emptive scheduling of processes. Consider the following set of processes with their arrival times and CPU burst times (in milliseconds):

Process      Arrival Time    Burst Time
  P1                    0                    12
  P2                   2                      4
  P3                   3                     6
  P4                   8                     5
What is the average waiting time (in milliseconds) of the processes? [GATE-2014]

Q7. Consider the following CPU process with arrival time (in milliseconds).[GATE 2017}

Arrival Time
Burst Time

If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then what is  average waiting time across all processes ?

Q8.An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:
Process   Execution time    Arrival time
P1                    20                    0
P2                    25                       15
P3                    10                      30
P4                    15                      45
What is the total waiting time for process P2? [GATE 2007]

Q9.For the processes listed in the following table, which scheduling schemes will give the lowest average turnaround time? [GATE 2015]
Process    Arrival Time    Processing Time
  A                  0                        3
  B                  1                        6
  C                 4                         4
  D                6                          2

Q10. A system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below?
 4, 7, 6, 1, 7, 6, 1, 2, 7, 2 [GATE-2014]

Q11.Consider six memory partitions of size 200 KB, 400 KB, 600 KB, 500 KB, 300 KB, and 250 KB, where KB refers to kilobyte. These partitions need to be allotted to four processes of sizes 357 KB, 210 KB, 468 KB and 491 KB in that order. If the best fit algorithm is used, which partitions are NOT allotted to any process? [GATE 2015].

Q12. Consider a main memory with five page frames and the following sequence of page preferences 3,8,2,3,9,1,6,3,8,9,3,6,2,1,3.  Then find the total number of page fault occurred using FIFO and LRU page replacement algorithm. [GATE 2015]
Q13. Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, what is the effective memory access time (in milliseconds)? [GATE 2014]

Q13.A computer system implements a 40 bit virtual address, page size of 8 kilobytes, and a 128-entry translation look-aside buffer (TLB) organized into 32 sets each having four ways. Assume that the TLB tag does not store any process id. What is the minimum length of the TLB tag in bits? [GATE 2015]

Q14. A Computer system implements 8 kilobyte pages and a 32-bit physical address space. Each page table entry contains a valid bit, a dirty bit three permission bits, and the translation. If the maximum size of the page table of a process is 24 megabytes, what is the length of the virtual address supported by the system in bits? [GATE 2010]

Q15.Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the request for cylinder 90 is serviced after servicing ____________ number of requests. [GATE 2014]

Q16.Consider a disk queue with request for I/O to blocks on cylinder 47,38,121,191,87,11,92,10.The C-LOOK scheduling algorithm is used the head is initially at cylinder number 63, moving towards larger cylinder numbers on it servicing pass. The cylinders are numbered from 0 to 199. Calculate the total head movement incurred while servicing these request.[GATE 2016].

Q17.Which of the following statements is false and why? [GATE 2001]
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

Q18.  Consider a disk system with 100 cylinders. The request to access the cylinders occur in the following
sequence: 4,34,10,7,19,73,2,15,6,20
Assuming that the head is currently at cylinder 50, what is the time taken to satisfy all requests if it takes 1 ms to move from one cylinder to adjacent one and SSTF policy is used? [GATE 2009].

Q19. Consider a disk pack with a seek time of 4ms and rotational speed of 10000 rotation per minute. It has 600 sector per track and each sector can store 512 bytes of data . Consider a file stored in the disk. The file contains 2000 sectors Assume that every sector access necessitates a seek and the average rotational latency for accessing each sector is half of the time for one complete rotation . Then what is the  total time ( in ms) needed to read the entire file is?[GATE 2015]



addressing modes types,1,advance-java,2,advancejava,1,aktu entrance exam,1,aktu exam schedule,1,ASP,1,bare machine,1,base register and limit register,1,C Programming,13,C Plus Plus,1,C Programming,6,C Programming MCQ,2,C Programming Questions,2,C programming study material for gate exam,10,Cache Memory,1,CBNST Program,1,Childcare,1,CJ,2,Cloud Computing,1,COA GATE Questions,1,components of use case diagram,1,Computer Architecture,2,Computer architecture based questions for gate exam,11,Computer Network,4,Computer Network Study Material,2,Computer network study material for gate,2,Computer Networks,6,Computer networks GATE Questions,1,Computer Science Study Material for Gate,19,computer science study material for gate exam,32,content based image retrieval content based image retrieval system,1,contiguous memory allocation,2,Core Java,8,COre Java Interview Questions,1,core java interviews questions,1,cyber crime report,1,Cyber crime status,1,cybercrime and security,1,cybercrime examples,1,Data Mining,1,Data Structure,2,Data Structure Questions,1,Data Transmission Architecture,1,Data Transmission in wsn,1,DBMS,5,dbms question paper,1,DE,1,Digital Electronics,1,DS,4,dynamic linking,1,dynamic linking in memory management,1,Dynamic memory allocation in c,1,Electroencephalogram,1,file management in operating system notes,1,FOC,1,Fundamenatl of Computer,1,Gate 2017,5,Gate 2017 Admit card,1,Gate 2017 Exam Schedule,1,Gate 2017 Syllabus,1,gate 2018,1,gate cse study material,1,gate practice set,10,gate study material for computer science,16,Gate study material for computer science 2017,1,GatePreviousYear,1,General,3,HCL Aptitude Test,1,HR Interview Questions,1,HTML,4,Image Processing,1,Important Date of Gate 2017 Exam,1,Information Security Policy,1,internal and external fragmentation,1,JS,1,lagrange's interpolation formula,1,lagrange's interpolation formula examples,1,MComputing,1,memory fragmentation,1,memory management,1,memory management questions and answer in os,1,Motivational,4,NCER,2,Numerical Techniques Lab,1,OOT,1,Operating System,12,Operating System Gate Questions,1,Operating System Objective Questions,4,Operating System Questions Bank,1,Operating system questions for gate,1,Operating System Study material,2,operating system study material for gate exam,16,Operating system tutorial,2,page swapping,1,paged memory allocation,1,paged memory allocation in operating system,1,paging technique of memory management .paging technique,1,paging technique of memory management program in c,1,Pointer in C,4,Process based question for gate,1,Quiz on non conventional energy resources,1,Regression testing,1,relocation in memory management,1,relocation registe,1,relocation register,1,resident monitor,1,resident monitor in operating system,1,routing table,1,segmentation in memory management,1,segmentation in memory management in operating system,1,Servlet,1,session tracking,1,session tracking in java,1,session tracking in servlet,1,Software Engineering,10,Software Engineering baes study material for gate,1,software engineering interview questions,1,Software Quality Assurance,3,software verification methods,1,SPM,1,Stack,1,Structure in C,1,Study Material for gate Computer Science,9,swapping in memory management,1,swapping in operating system,1,TCS Code Vita,1,TCS Interview Questions,1,Technical Interview,1,Technical Questions from DBMS,1,Thrashing in Operating System,1,Threads concept in operating system,1,Tips to Learn Coding,1,Top 30 Core Java Interview Questions with Answer,2,top down approach,1,top down approach in programming,1,Types of operating system,1,UML,1,use case diagram explanation,1,website uses cookies,1,what is cookies website,1,What is process control block ?,1,what is software testing?,1,Wireless Sensor Network,3,worst fit algorithm for memory allocation,1,XML,2,
Computer Science Junction: Operating system gate questions and answers
Operating system gate questions and answers
Computer Science Junction
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share. STEP 2: Click the link you shared to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy