Sample Questions, Previous Year Solved Papers, Study Materials For Competitive Examinations Like UGC NET, SET And GATE Computer Science.

Friday, 27 April 2018

61.       An operating system using banker’s algorithm for deadlock avoidance has ten dedicated devices (of same type) and has three processes P1, P2 and P3 with maximum resource requirements of 4, 5 and 8 respectively. There are two states of allocation of devices as follows:
State 1   Processes                 P1       P2       P3
Devices allocated    2          3          4
State 2   Processes                 P1       P2       P3
Devices allocated    0          2          4
Which of the following is correct?
(A) State 1 is unsafe and state 2 is safe.
(B) State 1 is safe and state 2 is unsafe.
(C) Both, state 1 and state 2 are safe.
(D) Both, state 1 and state 2 are unsafe.
62.       Let the time taken to switch between user mode and kernel mode of execution be T1 while time taken to switch between two user processes be T2. Which of the following is correct?
(A) T1 < T2
(B) T1 > T2
(C) T1 = T2
(D) Nothing can be said about the relation between T1 and T2.
63.       Working set model is used in memory management to implement the concept of
(A) Swapping
(B) Principal of Locality
(C) Segmentation
(D) Thrashing
64.       A UNIX file system has 1 KB block size and 4-byte disk addresses. What is the maximum file size if the inode contains ten direct block entries, one single indirect block entry, one double indirect block entry and one triple indirect block entry?
(A) 30 GB
(B) 64 GB
(C) 16 GB
(D) 1 GB
Explanation:
Max File size = direct block + single indirect + double indirect + triple indirect block
We have 4 bytes per block pointer, so 1 KB/4 = 256 blocks
Ten direct block: 10 * 1KB = 10 KB
Single indirect block: 256 * 1 KB = 256 KB
Double indirect block: 256 * 256 * 1 KB = 64 MB
Triple Indirect block: 256 * 256 * 256 * 1 KB = 16 GB
So, Maximum file size approximately equal to 16 GB
65.       A thread is usually defined as a light weight process because an Operating System (OS) maintains smaller data structure for a thread than for a process. In relation to this, which of the following statement is correct?
(A) OS maintains only scheduling and accounting information for each thread.
(B) OS maintains only CPU registers for each thread.
(C) OS does not maintain a separate stack for each thread.
(D) OS does not maintain virtual memory state for each thread.
66.       The versions of windows operating system like windows XP and window Vista uses following file system:
(A) FAT-16
(B) FAT-32
(C) NTFS (NT File System)
(D) All of the above
67.       Which one of the following is a correct implementation of the metapredicate “not” in PROLOG (Here G represents a goal)?
(A) not(G):– !, call(G), fail.
not(G).
(B) not(G):– call(G), !, fail.
not(G).
(C) not(G):– call(G), fail, !.
not(G).
(D) not(G):– call(G), fail.
not(G):– !.
68.       Which one of the following is not an informed search technique?
(A) Hill climbing search
(B) Best first search
(C) A* search
(D) Depth first search
69.       If we convert
u v x y (P(f(u),v, x, y) → Q(u,v,y)) to
v x (P(f(a),v, x, g(v,x)) → Q(a,v,g(v,x)))
This process is known as
(A) Simplification
(B) Unification
(C) Skolemization
(D) Resolution
70.    Given two jugs of capacities 5 litres and 3 litres with no measuring markers on them. Assume that there is endless supply of water. Then the minimum number of states to measure 4 litres water will be
(A) 3
(B) 4
(C) 5
(D) 7
Explanation:
1. (0,0)
2. (5,0)
3. (2,3)
4. (0,3) Now 2 ltr
5. (5,0)
6. (2,3)
7. (0,3) Now 2 ltr (So total 4 Ltr)