# GATE Sample Paper for Computer Science With Solution

**GATE Sample Paper-1**** **

**Q.1 – Q.25 carry one mark each**

**The total size of address space in a virtual memory system is limited by**

- Length of MAR
- Available secondary storage
- Available main memory
- None of the above
- All the above

Ans : 2

2. **Let r =1(1+0)* s=11*0 and t=1*0 are regular expressions. Which one of them is false?**

- L(s) subset of L(r) and L(s) subset of L(t)
- L(r) subset of L(s) and L(s) subset of L(t)
- L(s) subset of L(t) and L(s) subset of L(r)
- L(t) subset of L(s) and L(s) subset of L(r)
- None of the above

Ans : 2

3. **The expression s[i] – ‘0’ returns**

- numeric value stored in s[i]
- character value
- subtracted value of the value of ASCII value of 0 and s[i]
- none of the above

Ans : 1

4. **#include<ctype.h> is used in**

- main.c
- getop.c
- stack.c
- getch.c

Ans : 3

5. **#define forever for( ; ; ) is**

- Gives run time error
- Gives compilation error
- Infinite loop
- None of the above

Ans : 3

6. **The recurrence relation that determines the optimal execution of tower of Hanoi with p discs is**

- 2T(p-2) + 2
- 2T(p-1) + p
- 2T(p/2) + 1
- 2T(p-1) + 1

Ans : 4

7. **The operation that is commutative but not associative is**

- AND
- OR
- X-OR
- NOR
- NAND

Ans : 2

8. **Which of the following problems is not NP-hard?**

- Hamilton circuit problem
- 0/1 knapsack problem
- Graph colouring problem
- Finding bi-connected components of a graph

Ans : 2

9. **Consider the SLR(1) AND LALR(1) parsing tables for a context free grammar. Which of the following is/are true?**

- Goto part of both may be different
- Shift entries are identical in both
- Reduce entries may differ
- Error entries may be different.
- All of the above

Ans : 4

10. **Which of the regular expression equated are same?**

- r(*)= r*
- ( r + s )* = r* + s*
- (r* s*) =(r + s)*
- r* s*= r* +s*
- none

Ans : 2

11. **A simple two pass assembler does the following in first pass**

- Allocate space for literals
- Computes total length of the program
- Builds symbol table
- Generates code for all load and store register instructions

Ans : 1

12. **The proposition P^(~p or q) is**

- Tautology
- Logically equivalent to p^ v
- Logically equivalent to p or q
- None

Ans : 1

13. **The maximum number of binary trees that can be formed with three unlabeled nodes is**

- 1
- 5
- 4
- 3

Ans : 3

14. **Which of the following algorithms have the highest worst case complexity?**

- Bubble sort
- Selection sort
- Merge sort
- Quick sort

Ans : 1

15. **Given the basic ER and relational model, which one is incorrect?**

- An attribute of an entity can have more than one value
- An attribute can be composite
- In row, an attribute can have exactly one value or NULL
- In row, an attribute can have more than one value

Ans : 1

16. **The PDU for application stack in the internal stack is**

- Segment
- Datagram
- Message
- Frame

Ans : 3

17. **Linked lists are not suitable data structures of which one of the following problems?**

- Insertion sort
- Binary search
- Radix sort
- Polynomial manipulation

Ans : 4

18. **The principle of locality justifies the use of**

- Interrupts
- DMA
- Polling
- Cache memory

Ans : 4

19. **Which of the following page replacement suffers from Belady’s anamoly?**

- Optimal replacement
- LRU
- FIFO
- Both (a) and (c)

Ans : 3

20. **Which scheduling policy is suitable for a time shared operating system?**

- Shortest job first
- First come first serve
- Elevator
- Round robin

Ans : 4

21. **Who needs to bind ,accept and listen while using sockets?**

- Client
- Server
- None of the above
- Both (a) and (b)

Ans : 2

22. **The SEI approach provides ___ process maturity levels**

- 2
- 3
- 5
- 7

Ans : 3

23. ** ****Which languages necessarily need heap allocation in run-time environment?**

- That support recursion
- That allow dynamic data structures
- That use dynamic scoping
- That use global variables

Ans : 3

24. ** The 8085 microprocessor responds to the present of an interrupt**

- TRAP pin becomes “high”
- Checking TRAP pin for “high” the end of each instruction
- Checking TRAP pin for “high” after the execution of each instruction
- Checking TRAP pin for “high” at regular intervals

Ans : 1

25. ** The 8085 microprocessor responds to the present of an interrupt**

- TRAP pin becomes “high”
- Checking TRAP pin for “high” the end of each instruction
- Checking TRAP pin for “high” after the execution of each instruction
- Checking TRAP pin for “high” at regular intervals

Ans : 1

**Q.26 – Q.50 carry two marks **** **

26. **Consider the following decision problems:**

**(P1) Does a given finite state machine accept a given string.**

**(p2) Does a given context free grammar generate an infinte number of strings**

**Which of the following statements is/are true?**

- Both (P1) and (P2)
- Only (P1)
- Only (P2)
- Neither (P1) nor (P2)

Ans : 3

27. **Consider the following functions**

**F(n)=3n**

**G(n)=2Jlog2**

**H(n)=n!**

**Which of the following is true?**

- H(n) is 0(f(n))
- H(n) is 0(g(n))
- G(n) is not 0(f(n))
- F(n) is 0(g(n))

Ans : 2

28. **Postorder traversal of a given binary search tree, T produces the following sequence of keys**

**10, 9, 23, 15, 60, 29, 40**

**Which one of the following sequences of keys can be the result of an inorder traversal of tree T?**

- 9, 10, 15, 23, 29, 40, 60
- 9, 10, 15, 23, 60, 40, 29
- 29, 15, 9, 10, 23, 40, 60
- 60, 40, 23, 10, 9, 15, 29

Ans : 1

29. **A Priority-Queue is implemented as a max-heap. Initially it has 5 elements. The level-order traversal of the heap is given below:**

**9, 5, 3, 1**

**The new elements ‘2’ and ‘8’ are inserted in the heap in that order. The level-order traversal of the heap after the insertion of the elements is:**

- 9, 8, 5, 3, 2 ,1
- 9, 8, 2, 3, 1, 5
- 9, 8, 1, 2, 3, 5
- 9, 8, 3, 2, 1, 5

Ans : 1

30. **Let P, Q, R be tree atomic prepositional assertions. Let X denote (P v Q) – R and Y denotes (P – R) v (Q – R). Which one of the following is a tautology?**

- XY
- X – Y
- Y – X
- -1Y –X

Ans : 4

31. **An operating system contains 3 user processors each requiring 2 units of resources R. The minimum number of units of r such that no deadlocks will ever arise is**

- 3
- 5
- 4
- 6

Ans : 3

32. **Let R(a, b, c) and S(d, e, f) be two relations in which d is the foreign key of S that refers to the primary key of R. Consider the following operations:**

**(i) Insert into R**

**(ii) Insert into S**

**(iii) Delete from S**

**(iv) Delete from R**

**Which of the following is true about referential integrity?**

- None
- All of the above
- Both (i) and (iv)
- Both (ii) and (iii)

Ans : 1

33. **Which two of the following four regular expressions are equivalent?(E being the empty string)**

**(i) (00)*(E + 0)**

**(ii) (00)***

**(iii) 0***

**(iv) 0(00)***

- (i) and (ii)
- (ii) and (iii)
- (i) and (iv)
- (iii) and (iv)

Ans : 3

34. **The grammar whose productions are**

**->if id then <stmt>**

**->if id then <stmt> else <stmt>**

**->id :=id**

**Is ambiguous because**

- The left most derivation and right most derivations of the sentence if a then if b then c :=d gives rise top different parse trees.
- The sentence if a then if b then c:=d
- The sentence if a then if b then c:=d else c:=f has more than two parse trees
- The sentence if a then if then c:=d else c:=f has two parse trees.

Ans : 3

35. **Quick sort is run on two inputs shown below to sort in ascending order**

**(i) 1, 2, 3……….n**

**(ii) N, n-1, n-2………2, 1**

**Let c1 and c2 be the number of comparisons made for the inputs. Then**

- C1 < c2
- C1 > c2
- C1 = c2
- Cannot be determined

Ans : 1

36. **A solution to dining philosophers problem that avoids deadlock is**

- All philosopher picks up the left fork before right fork
- All philosophers picks up right fork before left fork
- None of the above
- Cannot be determined

Ans : 3

37. **What values of A, B, C, D satisfy the following Boolean equations?**

**A` +AB =0**

**AB = AC**

**AB + (AC)` + CD = (CD)`**

- A=1 B=0 C=0 D=1
- A=1 B=1 C=0 D=0
- A=1 B=0 C=1 D=1
- A=1 B=0 C=0 D=0

Ans : 1

38. **In a virtual memory system the address space specified by the address lines of the cpu must be _____ than the physical memory size and _____ than the secondary storage**

- Smaller, smaller
- Smaller, larger
- Larger, smaller
- Larger, larger

Ans : 3

39. **A memory page containing a heavily used variable that was initialized very early and is in constant use is removed when**

- LRU page replacement algorithm is used
- FIFO page replacement is used
- LFU page replacement is used
- None

Ans : 3

40. **What is the converse of the following assertion?**

**I stay only if you go**

- I stay if you go
- If a stay then you go
- If you do not go then i do not stay
- If i do not stay then you go

Ans : 3

41. **The string 1101 does not belong to the set represented by**

- 110*(0+ 1)
- 1( 0 + 1)*101
- (10)*(01)*(00 + 11)*
- (00 + (11)*0)*

Ans : 3

42. **Type checking is done during**

- Lexical analysis
- Syntax analysis
- Syntax directed translation
- Code optimization

Ans : 1

43. **There are five records in a database**

Name | Age | Occupation | category |

Rama | 27 | con | A |

Abdul | 22 | engg | A |

Jeniffer | 28 | doctor | B |

Maya | 32 | ser | D |

Dev | 24 | Mus | C |

**There is an index file associated with this and it contains the values 1, 3, 2, 5, 4. Which one of the fields is the index built from?**

- Age
- Name
- Occupation
- Category

Ans : 1

44. **Consider the following statements:**

**S1 : there exits infinite sets A, B, C such that A^(B U C) is finite**

**S2 : there exists two irrational numbers x and y such that (x +y) is rational.**

**Which of the following is true?**

- Only s1
- Only s2
- Both s1 and s2
- None

Ans : 4

45. **Which of the following disk scheduling strategies is likely to give the best throughput?**

- Farthest cylinder next
- Nearest cylinder next
- FCFS
- Elevator algorithm

Ans : 3

46. **A sorting technique is called stable if**

- It takes O(nlog n) time
- It maintains the relative order of occurrence of non-distinct elements
- It uses divide and conquer paradigm
- It takes O(n) space

Ans : 2

47. **Consider two well formed formulas in prepositional logic**

**F1 : P=> ~P**

**F2 : (P=> ~P) v (~P =>P)**

**Which of the following is correct?**

- F1 is satisfiable , F2 is valid
- F1 unsatisfiable, F2 is satisfiable
- F1 is unsatisfiable, F2 is valid
- F1 and F2 are both satisfiable

Ans : 1

48. **The following C declarations**

**struct node{**

**int i:**

**float j;**

**};**

**struct node *s[10];**

**define s to be**

- An array, each element of which is a pointer to a structure of type node
- A structure of 2 fields, each field being a pointer to an array of 10 elements
- A structure of 3 fields: an integer, a float, and an array of 10 elements
- An array, each element of which is a structure of type node

Ans : 1

49. **Given the following expression grammar:**

**E ->E * F | F + E | F**

**F ->F – | id**

**Which of the following is true?**

- * has higher precedence than +
- – has has higher precedence than *
- + and – have same precedence
- + has higher precedence than *

Ans : 1

50. **Where does the swap space reside?**

**RAM****DISK****ROM****On-chip cache**

Ans : 2

51. **Which of the following scheduling algorithms in non-preemptive?**

- Round robin
- First in first out
- Multilevel queue scheduling
- Multilevel queue scheduling with feedback

Ans : 2

**Q.52 – Q.55 is common data questions ( 1 mark each)**

**A computer has 256 KB , 4-way set associative, write back data cache with block size 64 bytes. The processor snds 64 bit addresses to the cache controller. Each cache tag directory contains, in addition to addresses tag, 2 valid bits , 1 modified bit and 1 replacement bit.**

52. **The size of the cache tag directory is**

- 136 kbites
- 64 kbits
- 324Kbits
- None

Ans : 3

53. **The number of bits in the tag field of an address is**

- 11
- 16
- 10
- 12

Ans : 4

**Suppose the letters a, b, c, d have probabilities ½, ¼, 1/8, 1/16 respectively.**

54. **Which of the following is the Huffman code for the letters a, b, c, d, e, f?**

- 0,10,110,1110
- 11, 10, 011, 010
- 11, 10, 01, 001
- 110, 100, 010, 000

Ans : 4

55. **What is the average length of the correct answer of Q.76?**

- 3
- 2.25
- 1.9
- None

Ans :3

**Q56 – Q65 carry 2 marks each**

56. **In one of the most stunning reversals in the history of marketing, the Coca-cola company in July 1985 yielded to thousands of irate consumers demanding that it should bring back the original coke formula**

- Demanding that it should
- Demanding to it
- And their demand to
- Who demanded it to

Ans : 1

57. **Synonym of lineal is**

- Splenic
- Tolerant
- Liasise
- Mediate

Ans : 1

58. **Synonym of abacinate**

- Blind
- Care
- Wisdom
- Deaf

Ans : 1

59. **Antonym of aboulic**

- Unneurotic
- Happiness
- Addiction
- None of the above

Ans : 1

60. **I can drive 6miles in 1hour and 20 minutes. What’s my speed in mph?**

- 7
- 4.5
- 9
- None

Ans : 2

61. **The fluid contained in the bucket can fill four large bottles or seven small bottles. A full large bottle is used to fill an empty small bottle. What fraction of the fluid is left over in the large bottle when the small one is full?**

- 2/7
- 3/7
- 4/7
- 5/7

Ans : 2

62. **The mean of 50 observations was 36. It was found later that an observation 48 was wrongly taken as 23. The corrected new mean is**

- 35.2
- 36.1
- 36.5
- 39.1

Ans : 3

63. **One man 3 woman and 4 boys can do a piece of work in 96 hours. 2 men,8 boys, can do it in 80 hours. 2men and 3 women can do it in 120 hours. 5men 12 boys can do it it**

- 4 days
- 5 days
- 6 days
- 7 days

Ans : 1

64. **Three persons are walking from place A to B. Their speeds are in the ratio 4:3:5. The time to reach B by these persons will be in the ratio**

- 4:3:5
- 5:3:4
- 15:9:20
- 15:20:12

Ans : 4

65. ** The rate at which a sum becomes four times itself in 15 years at S.I. will be**

- 15%
- 17 ½%
- 20%
- 25%

Ans : 3

« Sample paper for Biotechnology ICSE CLASS 10 ACCOUNTS SAMPLE PAPER »

## Tell us Your Queries, Suggestions and Feedback