This is meant for GATE aspirants in India from Electronics Engineering Department. This paper is conducted by Institute ...
Institute Of Engineering Studies (IES Bangalore)
CSE MOCK TEST-I
Questions 1 to 25 carry one mark each
1. If If A = (a) -2
then det (
(b) – 1
2. The function (a) maximum at minimum
)=
(c) 1
(d) 2
has
(b) minimum at
(c) no maximum
(d) no
3. The order of truncation error in Runge-Kutta fourth order method is (a) O ( ) (b) O ( ) (c) O ( ) (d) O ( )
4. If the events S and T have equal probabilities and are independent with P (S ∩ T) = P > 0 then P(S) =
(a)
(b)
(c)
(d) P
5. Which of the following state is not true ? (a) DFA is equivalent in power to regular expression (b) The PDA is equivalent in power to CFL (c) The DFA and NFA are equivalent in power (d) The DPPA and NPDA are equivalent in power power 6. Which of the following is true ? (a) Though there are no RR conflicts in LR(1) but may be there in LALR (1). (b) Though there are no SR conflicts in LR(1) but may be there in LALR (1). (c) Though there are no SR conflicts in LALR(1) but may be there in SLR (1). (d) none. 7. Consider the grammar : S →x Ay | xB y| x Az A → qS |q B→q In the goto graph of LR(0) items items , we find (a) SR conflicts (b) RR conflicts
(c) both
(d) none
8. The stack „S‟ is stored in an array indexed as [ 1 … N] and TOP pointer is initially at zero position . Peep( ) is a (non standard standard ) stack routine routine which is used used to desire i th element with respect to TOP pointer. Identify the correct statement to return the element : (a) S[TOP-1 -1] (b) S[TOP -1] (c) S[TOP -1 +1] (d) S[TOP +1 -1] 9. A binary search tree has been traversed to search for 88 . Identify which of the statements are correct : S1 : 58, 90, 60, 75, 78, 80, 85, 88 S2 : 58, 90, 95, 42, 75, 36, 85, 88 S3 : 12, 35, 54, 58, 90, 60, 89, 88
1
No.1 Training center for GATE/IES/JTO/PSUs in Bangalore @ Malleshwaram & Jayanagar, Bangalore: Ph: 0 99003 99699/ 0 97419 00225 / 080-32552008 Email :
[email protected] Site: www.onlineIES.com Google+: http://bit.ly/gplus_iesgate FB: www.facebook.com/onlineies
Institute Of Engineering Studies (IES Bangalore)
S4 : 12, 35, 78, 58, 31, 42, 36, 88 (a) S1 only (b) S2, S4 10. (a)
+ +w
y + wx
= …………. (b) + x
(c) S1, S4
(c)
+w+
CSE MOCK TEST-I
(d) S1, S3
(d) x + w
y
11. Which of the following 2‟s complement signed number is divisible by -3 & -5 ? (a) 1111 1111 1011 (b) 1111 1110 0010 (c) 1111 1111 0111 (d) 1111 1110 0001
12. The following assembly language program is stored in byte addressable memory mem ory from decimal address 800 onwards . MOV , (100) 4 MOV , (100) 4 ADD , 2 MOV (100) , 4 If each word consume 64 bits what will be the decimal address saved on to stack on the occurrence of interrupt during ADD instruction (a) 850 (b) 880 (c) 911 (d) 912
13. The disk drive drive of 20 GB contains n plotters and 640 cylinders . There are 512 sectors sectors per tracks and 1024 bytes per sectors . What will be the number of recording surfaces and the size of physical address (in bits) (a) 8, 35 (b) 16, 24 (c) 32, 24 (d) 32, 35 14. Which of the following page page replacement method guarantees the minimum minimum number of page faults ? (a) Replace the page whose next reference will be the farthest in future . (b) Replace the page whose next reference will be the nearest in future . (c) Replace the page whose most reference was the nearest in past . (d) Replace the page whose most recent reference was the farthest in past. 15. Which of the following is / are true with respect to paging ? I. It divides physical memory into equal size units . II. It allows implementation of virtual memory III. It suffers from external fragmentation . (a) I & III (b) I only (c) II only (d) I & II 16. The language that support ………… Data type binding is ………. Efficient than those that support …… … Data type binding . (a) Static , less, Dynamic (b) Dynamic , less, static (c) Static , max, Dynamic (d) Dynamic , more , static
17. Let A & B be languages corresponding to two decision problems & respectively . Let A be NP – complete problem. B is not known to be in NP. Which of the following is false ? (a) A is NP – Hard (b) B may be NP – Hard Hard (c) If A B then B is NP-complete (d) A is in NP
18. Which of the following list of elements in the array satisfies max-heap property ?
2
No.1 Training center for GATE/IES/JTO/PSUs in Bangalore @ Malleshwaram & Jayanagar, Bangalore: Ph: 0 99003 99699/ 0 97419 00225 / 080-32552008 Email :
[email protected] Site: www.onlineIES.com Google+: http://bit.ly/gplus_iesgate FB: www.facebook.com/onlineies
Institute Of Engineering Studies (IES Bangalore) (a) 16, 10, 12, 8, 3, 5 (c) 16, 16, 12, 8, 3, 5, 10
CSE MOCK TEST-I
(b) 16, 8, 5, 10, 12, 3 (d) 10, 16, 12, 8, 5, 3
19. Given that the block size is 512 bytes, search field is 9 bytes, record pointer is 7 bytes and a block pointer is 6 bytes long, long, what are the orders of internal and least nodes nodes of - tree respectively ? (a) 31, 34 (b) 34, 31 (c)32, 33 (d) 34, 32 20. Consider the following schedule S using transactions
,
and
:
(A) ; (A);
r (A);
r (A);
(B);
(B);
(B);
(A) ; (B) ;
(A);
(B); (B);
Which of the following must be TRUE ? (a) S is conflict serializable as → → → → (b) S is conflict serializable as (c) S is conflict serializable as → → (d) S is conflict serializable as → →
. . . .
21. Consider source and destination in a 10 Mbps network with senders window 5 packets. Transmission delay for a packet is 10 μ sec, propagation delay from source to destination is 250 μ sec. How long sender is ideal once a window is transmitted before being starting second window ? Assume ACK transmission time is negligible . (a) 250 μ sec (b) 400 μ sec (c) 450 μ sec (d) 150 μ sec 22. Subnet number 172. 156. 170.0 172.156.168.0
3
Subnet mask 255.255.254.0 255.255.254.0
Interface IF0 IF1
No.1 Training center for GATE/IES/JTO/PSUs in Bangalore @ Malleshwaram & Jayanagar, Bangalore: Ph: 0 99003 99699/ 0 97419 00225 / 080-32552008 Email :
[email protected] Site: www.onlineIES.com Google+: http://bit.ly/gplus_iesgate FB: www.facebook.com/onlineies
Institute Of Engineering Studies (IES Bangalore) 172.156.166.0 172.156.164.0 0.0.0.0
255.255.254.0 255.255.252.0 0.0.0.0
CSE MOCK TEST-I
R1 IF2 R2
Suppose a router has built up the routing table above. Router can deliver packets directly over interfaces 0 and 1 or it can forward packets to router R2. Assume router does the longest prefix match. What the router does with a packet addressed to 172.156.167.92 ? (a) IF 1 (b) IF 2 (c) R1 (d) R2 23. Which one of the following HTTP methods is not necessarily idempotent ? (a) POST (b) GET (c) HEAD (d) TRACE 24. An individual module has a reliability re liability of 0.999 & 225 such modules are put pu t in series . The reliability of the whole software is (a) 0.896 (b) 0.798 (c) 0.692 (d) 0.999 25. In ASP.NET , form contents will remain filled filled even if the page is refreshed , it is done using _viewstate . _viewstate is possible possible using (a) URL Rewriting (b) Cookies (c) Hidden Fields (d) None Questions 26 to 55 carry two marks each
∀ ∃ ⟺ ∀ ∧∃ ∧ ⇒∃ ∧ ⊆⊆ ⊆⊆
26. Consider the following statement formulae : : If x does not occur free in C then x[A(x)→C] [ x A(x) →C] : { x [C(x) → P(x)] x [C(x) L(x)]} x[P(x) L(x)] Which of the following is true ? (a) is true and is false (b) is false and is true (c) both and are true (d) both and are false 27. Let A = {0, 1, 2} ; P(A) is set of all subsets of „A‟ and P(A) with respect to of the following is false ? (a) [P(A) ; ] is a totally ordered set (b) [P(A) ; ] is a bounded lattice (c) [P(A) ; ] is a distributive distributive lattice (d) [P(A) ; ] is a complemented lattice.
⊆
is a poset, then which
28. There are 100 people in a room. In this group 60 are men, 30 are young and 10 are young men, then the number of old women is (a) 10 (b) 20 (c) 30 (d) 40
29. If L is any language and in its complement then which of the following is true (a) Both L and are recursive enumerable (b) Both L and can be non-recursively enumerable (c) Both L and can be CSL (d) None of the above
30. Which of the following is a regular languages ? (a) { / n ≥ 0} (b) { / m ≥ 3, n ≥4} (c) { /n>0} (d) { / n > 0}
4
No.1 Training center for GATE/IES/JTO/PSUs in Bangalore @ Malleshwaram & Jayanagar, Bangalore: Ph: 0 99003 99699/ 0 97419 00225 / 080-32552008 Email :
[email protected] Site: www.onlineIES.com Google+: http://bit.ly/gplus_iesgate FB: www.facebook.com/onlineies
Institute Of Engineering Studies (IES Bangalore) 31. Consider the following for loop : for (int i = 0 ; i < n ; i += 2) { A[i] = B[i] + C[i] ; } Suppose we generated the following unoptimized 3AC (three-address code) for the loop : i :=0 ; loop : if (i >=n) >=n) goto after ; t1 := i * 4 ; t2 := b[t1] ; t3 := i * 4 ; t4 := c[t3] ; t5 := t2 + t4 ; t6 := i * 4 ; a[t6] := t5 ; i := i + 2 ; goto loop; after : Which optimizations can be applied on this code ? (a) Code motion (b) Loop unrolling (d) Common Subexpression elimination
CSE MOCK TEST-I
(c) Loop jamming
32. Find the FIRST and FOLLOW sets for each of the non-terminals in the following grammar (note that some productions below have epsilon as the right-hand side) : A→BC m | C B →D B | ε C→k|ε D → p | r Find follow follow of (D) . (a) {p, r, $} (b) {p, r, m}
(c) {p, m}
(d) {p, r, k, m}
33. Consider the following algorithm on an array : Algorithm Do(A, n) Input : An integer array A and an integer n Output: find out if (n = = 1) then return A[0] else return Do(A, n-1) + A[n-1] end. What does the algorithm return for the input array A = {4, 3, 6, 2, 5} and the invocation is Do(A,5) (a) sum of array elements (b) maximum of array elements (c) minimum of array elements (d) reversing the array elements 34. Consider the following following state table the state variables variables P, Q input B x output B, Y. Initial Initial values P =0, Q = 1. What is the smallest input sequence taken the machine to state 11 and output 1
5
No.1 Training center for GATE/IES/JTO/PSUs in Bangalore @ Malleshwaram & Jayanagar, Bangalore: Ph: 0 99003 99699/ 0 97419 00225 / 080-32552008 Email :
[email protected] Site: www.onlineIES.com Google+: http://bit.ly/gplus_iesgate FB: www.facebook.com/onlineies
Institute Of Engineering Studies (IES Bangalore)
P Q X 0 0 0 0 1 1 1 1
(a) 0 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
(b) 1 0 1
0 1 0 1 1 0 0 1
1 , 1, 0, 1 , 1, 1 , 1, 0,
CSE MOCK TEST-I
,Z 0 0 0 0 1 0 0 1
(c) 1 1 0
(d) 0 0 1 0
35. Consider the following specifications : Hit ratio for read = 0.8 Hit ratio for write = 0.9 Block size = 2 words Cache of 10ns is 10 times faster than main memory On any miss entire block is to be moved from main memory to cache memory. 20% references are for write operations. operations. What is the average access a ccess time with write through and write allocate ? (a) 50 ns (b) 55 ns (c) 64 ns (d) 80 ns 36. A computer has 32-bit virtual address space and 1024 Byte page. Page table entries are 4 Bytes. A multi-Level page table is used inorder to ensure that each level page table is storable in one page. How many levels of paging are required ? (a) 1 level (b) 2 levels (c) 3 levels (d) 4 levels 37. Consider the following snapshot of a system
Allocation
Max
Available
ABCD
ABCD
ABCD
0012
0012
1520
1000
1750
1354
2356
0632
0652
0014
0656
Which of the given claims is/are correct ? I. The system is safe and the safe sequence is <
6
,
,
,
,
>
No.1 Training center for GATE/IES/JTO/PSUs in Bangalore @ Malleshwaram & Jayanagar, Bangalore: Ph: 0 99003 99699/ 0 97419 00225 / 080-32552008 Email :
[email protected] Site: www.onlineIES.com Google+: http://bit.ly/gplus_iesgate FB: www.facebook.com/onlineies
Institute Of Engineering Studies (IES Bangalore) II. The system is unsafe . III. The request issued by process IV. The system is Deadlocked. V. The system is Deadlock free . (a) I, II & III (b) I & II
CSE MOCK TEST-I
< 0, 4, 2, 0 > can be granted
(c) III, IV & V
(d) I, III & V
38. Consider the program given below : void main ( ) { int a = 4; int *p = &a; int *q = &a; int = ++(*p) int * r = p; r = - - * (p) +4; + + * r; Printf(“%d %d %d” , a, b, *r) } What are the final values of m , n, r ? (a) 8, 8, 8 (b) 8, 5, 7 (b) 5, 5, 5
(d) 8, 5, 8
39. Consider the pseudo-code given below : x : integer ; procedure set-x(n : integer) x = n; procedure print-x write-integer (x); procedure Test (s, p : function ; n : integer) x : integer; if (n in {1, 3}) set-x (n); else s(n); if (n in {1, 2}) print-x else p; set-x(n+2), print-x; What will be the output of the program for the call ? set-x (0); Test (set-x, print-x, 4); Print-x; (a) 4, 6 (b) 6, 4 (c) 4, 4 (d) 0, 4 40. Consider the following claims :
7
No.1 Training center for GATE/IES/JTO/PSUs in Bangalore @ Malleshwaram & Jayanagar, Bangalore: Ph: 0 99003 99699/ 0 97419 00225 / 080-32552008 Email :
[email protected] Site: www.onlineIES.com Google+: http://bit.ly/gplus_iesgate FB: www.facebook.com/onlineies
Institute Of Engineering Studies (IES Bangalore)
CSE MOCK TEST-I
I. n is O( ) x > 0; y > 0 II. 4 is O ( ) III. 4. is Ω ( ) IV. 10n logn is O(nlogn) Which of the above are true ? (a) I & II (b) I, II & III
(c) I, II & IV
(d) I, II, III & IV
41. Let S = {a, b, c, d, e, f, g} be a collection of objects with benefit-weight values values as : {a: (12,4), b: (10,6), c: (8,5), d: (11,7), e: (14,3), f: (7,1), g: (9,6)} What is an optimal solution to the fractional Knapsack problem for S assuming the Knapsa ck can hold objects with total weight of 18? (a) 49.4 (b) 50.2 (c) 51 (d) none 42. Which of the following inequality best characterizes the number n of keys that ca n exist in a B-tree B -tree of order k with height h? (Assume that a B-tree of height 1 is a B-tree having only one node) (a) { 2 * - 1}