# Recent questions and answers in Operating System

1 vote
1
A computer whose processes have 1024 pages in their address spaces keeps its page tables in memory. The overhead required for reading a word from the page table is 500 nsec. To reduce this overhead, the computer has an associative memory which holds 32 (virtual page, physical page frame) pairs and can do look up in 100 nsec. What hit rate is needed to reduce the mean overhead to 200 nsec?
1 vote
2
Which of the following scheduling algorithms could result in starvation? Priority Round Robin FCFS None of the above
3
4
The above synchronisation procedure satisfies 1. Mutual exclusion is guranteed 2.Progress is not guranteed 3.Bounded wait is not guranteed 4Deadlock may occur I am getting all of the above. Is it correct?
5
In a two-level virtual memory, the memory access time for main memory, $t_{M}=10^{-8}$ sec, and the memory access time for the secondary memory, $t_D=10^{-3}$ sec. What must be the hit ratio, $H$ such that the access efficiency is within $80$ percent of its maximum value?
6
Consider program for P1 and P2: Here, m and n are binary semaphore variables whose values are initially initialized to 1. x and y are shared resources whose values are initialized to 0. Which of the following holds by above processes? A :- Deadlock and no mutual exclusion B :-Deadlock and race condition C :-No deadlocks and no race condition D:- Race condition and no deadlock
7
02. Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: (xi) A computer system has $6$ tape devices, with n processes competing 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: $2$ $3$ $4$ $1$
8
How many times the word "PROCESS" will be printed when executing the following program ? main(){ printf("PROCESS"); fflush(); fork(); fork(); } $8$ $4$ $6$ $7$
9
Consider $n$ jobs $J_1, J_2 \dots J_n$ such that job $J_i$ has execution time $t_i$ and a non-negative integer weight $w_i$. The weighted mean completion time of the jobs is defined to be $\frac{\sum_{i=1}^{n}w_iT_i}{\sum_{i=1}^{n}w_i}$ ... time of the jobs? Non-decreasing order of $t_i$ Non-increasing order of $w_i$ Non-increasing order of $w_it_i$ Non-increasing order of $w_i/t_i$
1 vote
10
A system has 10 identical resources and N processes competing for them. Each process can request at most 3 resources but by grouping of first 3 processes needs only 6 resources. Then, the maximum value of ‘N is ______?
11
Which of the following is an example of spooled device? A line printer used to print the output of a number of jobs A terminal used to enter input data to a running program A secondary storage device in a virtual memory system A graphic display device
12
Is it possible that a resource deadlock involves multiple units of one type and a single unit of another? If so, give an example.
13
Each Process $P_i$, i = $1....9$ is coded as follows repeat P(mutex) {Critical section} V(mutex) forever The code for $P_{10}$ is identical except it uses V(mutex) in place of P(mutex). What is the largest number of processes that can be inside the critical section at any moment? $1$ $2$ $3$ None
14
A processor uses $36$ bit physical address and $32$ bit virtual addresses, with a page frame size of $4$ Kbytes. Each page table entry is of size $4$ ... level page tables are respectively $\text{20,20,20}$ $\text{24,24,24}$ $\text{24,24,20}$ $\text{25,25,24}$
15
Is it possible to have concurrency but not parallelism ? Explain.
16
What are two differences between user-level threads and kernel-level threads ? Under what circumstances is one type better than the other ?
17
Consider the following page reference string. $1\ 2\ 3\ 4\ 2\ 1\ 5\ 6\ 2\ 1\ 2\ 3\ 7\ 6\ 3\ 2\ 1\ 2\ 3\ 6\$ What are the minimum number of frames required to get a single page fault for the above sequence assuming LRU replacement strategy? $7$ $4$ $6$ $5$
18
Reading a random location in a big file is faster in i-node based file systems than in FAT file systems. True or False?
19
Consider two processes P1 and P2, each needed 3 resources 1, 2 and 3 in a database. If each processes ask them in any order, then the number of ways possible in which system is guaranteed to be deadlock free ________. Given answer is 6. I am getting 12.
20
Consider two processes, P and Q, each need three records, R1, R2. and R3, in a database. If P asks for them in any order R1, R2, R3, and Q asks for them in any order, What fraction of all the combinations are guaranteed to be deadlock free? $\frac{1}{3}$ $\frac{2}{3}$ $\frac{1}{6}$
1 vote
21
In real-time operating systems, which of the following is the most suitable scheduling scheme? round-robin first-come-first-served preemptive random scheduling
22
A program of size 64 MB is stored on disk which supports an average seek time of 32ms and rotation time of 20ms . Page size is 4MB and track size is 32MB . If the page of the program are countiguously placed on DIsk then the toatal time required to load the program from Disk in msec is ______
23
In _____ allocation method for disk block allocation in a file system, insertion and deletion of blocks in a file is easy Index Linked Contiguous Bit Map
24
The enter_CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows: void enter_CS(X) { while(test-and-set(X)); } void leave_CS(X) { X = 0; } In the above solution, $X$ is a memory location associated with the $CS$ ... $CS$ at the same time Which of the above statements are TRUE? (I) only (I) and (II) (II) and (III) (IV) only
25
Consider a system having $’m’$ resources of the same type. These resources are shared by $3$ processes $A,B,C;$ which have peak time demands of $3,4,6$ respectively. The minimum value of $’m’$ that ensures that deadlock will never occur is $11$ $12$ $13$ $14$
26
Is RAID structure in syllabus in operating system ???
1 vote
27
Consider the organisation of a UNIX file as represented by the inode. Assume that there are 12 block pointers and a singly,doubly and triply indirect pointer in each inode. Further assume that the system block size and the disk sector are both 8 KB. The disk pointer is 32 bits and ... how many disk accesses are required to access the byte position 13423826 of the file? (A) 1 (B) 2 (C) 4 (D) 8
28
How many times ‘4’ will be printed ? int main() { if (fork() && (!fork())) { if (fork() || fork()) { fork(); } } printf("4 "); return 0; } How to approach these kind of questions using Tree structure ??
1 vote
29
A file system uses continuous allocation to store data. What is the number of disk block accesses required to fetch n blocks of data ? Is it 1 or n?
30
Consider a machine with $64$ MB physical memory and a $32$-bit virtual address space. If the page size s $4$ KB, what is the approximate size of the page table? $\text{16 MB}$ $\text{8 MB}$ $\text{2 MB}$ $\text{24 MB}$
1 vote
31
A system contains three programs and each requires three tape units for its operation. The minimum number of tape units which the system must have such that deadlocks never arise is _________. $6$ $7$ $8$ $9$
32
Consider the processes P1, P2, P3 arrived in the sequence P2, P3, P1 and the burst time of the processes are 3, 3, 24 respectively. What is the average TAT??
33
I got the state to be unsafe since Available is (1,1) which can't satisfy the need of any process so why is not deadlock ?
1 vote
34
35
A processor uses $\text{2-level}$ page tables for virtual to physical address translation. Page tables for both levels are stored in the main memory. Virtual and physical addresses are both $32$ bits wide. The memory is byte addressable. For virtual to physical address translation, the $10$ most ... the page tables of this process is $\text{8 KB}$ $\text{12 KB}$ $\text{16 KB}$ $\text{20 KB}$
36
A computer provides each process with $65,536$ bytes of address space divided into pages of $4096$ bytes each. A particular program has a text size of $32,768$ bytes, a data size of $16,386$ bytes, and a stack size of $15,870$ bytes. Will this program fit in the ... were $512$ bytes, would it then fit? Each page must contain either text, data, or stack, not a mixture of two or three of them.
37
A computer has twenty physical page frames which contain pages numbered $101$ through $120$. Now a program accesses the pages numbered $\text{1, 2, ..., 100}$ in that order, and repeats the access sequence THRICE. Which one of the following page ... faults as the optimal page replacement policy for this program? Least-recently-used First-in-first-out Last-in-first-out Most-recently-used
A certain processor provides a 'test and set' instruction that is used as follows: TSET register, flag This instruction atomically copies flag to register and sets flag to $1$. Give pseudo-code for implementing the entry and exit code to a critical region using this instruction.