Monday, January 20, 2014

GATE Exam Sample Paper for Computer Science with Solutions

GATE SAMPLE PAPER FOR COMPUTER SCIENCE:



1. THE SIMPLIFIED SOP (SUM OF PRODUCT) FORM OF THE BOOLEAN EXPRESSION (P + Q + R).(P + Q + R).(P + Q + R) IS


(A) (PQ + R)

(B) (P + QR)

(C) (PQ + R)

(D) (PQ + R)

2. WHICH ONE OF THE FOLLOWING CIRCUITS IS NOT EQUIVALENT TO A 2-INPUT XNOR (EXCLUSIVE NOR) GATE?



logic gates

3. THE MINIMUM NUMBER OF D FLIP-FLOPS NEEDED TO DESIGN A MOD-258 COUNTER IS

(A) 9

(B) 8

(C) 512

(D) 258

4. A THREAD IS USUALLY DEFINED AS A 'LIGHT WEIGHT PROCESS' BECAUSE AN OPERATING SYSTEM (OS) MAINTAINS SMALLER DATA STRUCTURES FOR A THREAD THAN FOR A PROCESS. IN RELATION TO THIS, WHICH OF THE FOLLOWINGS IS TRUE?

(A) On per-thread basis, the OS maintains only CPU register state.

(B) The OS does not maintain a separate stack for each thread.

(C) On per-thread basis, the OS does not maintain virtual memory state.

(D) On per thread basis, the OS maintains only scheduling and accounting information.

5. IN AN MXN MATRIX SUCH THAT ALL NON-ZERO ENTRIES ARE COVERED IN A ROWS AND B COLUMNS. THEN THE MAXIMUM NUMBER OF NON-ZERO ENTRIES, SUCH THAT NO TWO ARE ON THE SAME ROW OR COLUMN, IS

A)EUR a + b

B)EUR max {a, b}

C)EUR min {M-a, N-b}

D)EUR min {a, b}

6. THE ORDER OF AN INTERNAL NODE IN A B+ TREE INDEX IS THE MAXIMUM NUMBER OF CHILDREN IT CAN HAVE. SUPPOSE THAT A CHILD POINTER TAKES 6 BYTES, THE SEARCH FIELD VALUE TAKES 14 BYTES, AND THE BLOCK SIZE IS 512 BYTES. WHAT IS THE ORDER OF THE INTERNAL NODE?

A) 24

B) 25

C) 26

D) 27

7. THE LEXICAL ANALYSIS FOR A MODERN COMPUTER LANGUAGE SUCH AS JAVA NEEDS THE POWER OF WHICH ONE OF THE FOLLOWING MACHINE MODELS IN A NECESSARY AND SUFFICIENT SENSE?

(A) Finite state automata

(B) Deterministic pushdown automata

(C) Non-Deterministic pushdown automata

(D) Turing machine

8. LET THE PAGE FAULT SERVICE TIME BE 10MS IN A COMPUTER WITH AVERAGE MEMORY ACCESS TIME BEING 20NS. IF ONE PAGE FAULT IS GENERATED FOR EVERY 106 MEMORY ACCESSES. WHAT IS THE EFFECTIVE ACCESS TIME FOR THE MEMORY?

(A) 21ns

(B) 30ns

(C) 23ns

(D) 35ns

9. CONSIDER A HYPOTHETICAL PROCESSOR WITH AN INSTRUCTION OF TYPE LW R1, 20(R2), WHICH DURING EXECUTION READS A 32-BIT WORD FROM MEMORY AND STORES IT IN A 32-BIT REGISTER R1. THE EFFECTIVE ADDRESS OF THE MEMORY LOCATION IS OBTAINED BY THE ADDITION OF CONSTANT 20 AND THE CONTENTS OF REGISTER R2. WHICH OF THE FOLLOWING BEST REFLECTS THE ADDRESSING MODE IMPLEMENTED BY THIS INSTRUCTION FOR THE OPERAND IN MEMORY?

(A) Immediate Addressing

(B) Register Addressing

(C) Register Indirect Scaled Addressing

(D) Base Indexed Addressing

10. WHAT DOES THE FOLLOWING FRAGMENT OF C-PROGRAM PRINT?

char c "GATE2011 ;

char *p =c;

printf ("%s", p+p [3] - p [1]) ;

(A) GATE2011

(B) E2011

(C) 2011

(D) 011

11. A MAX-HEAP IS A HEAP WHERE THE VALUE OF EACH PARENT IS GREATER THAN OR EQUAL TO THE VALUE OF ITS CHILDREN. WHICH OF THE FOLLOWING IS A MAX-HEAP?



b-tree



B-tree

12. AN ALGORITHM TO FIND THE LENGTH OF THE LONGEST MONOTONICALLY INCREASING SEQUENCE OF NUMBERS IN AN ARRAY A0 :N - 1IS GIVEN BELOW. LET LI DENOTE THE LENGTH OF THE LONGEST MONOTONICALLY INCREASING SEQUENCE STARTING AT INDEX I IN THE ARRAY INITIALIZE LN-1 =1 FOR ALL I SUCH THAT 0 EUR I EUR N - 2 FINALLY THE LENGTH OF THE LONGEST MONOTONICALLY INCREASING SEQUENCE IS WHICH OF THE FOLLOWING STATEMENTS IS TRUE?

(A) The algorithm uses dynamic programming paradigm

(B) The algorithm has a linear complexity and uses branch and bound paradigm

(C) The algorithm has a non-linear polynomial complexity and uses branch and bound paradigm

(D) The algorithm uses divide and conquer paradigm.

13. LET P BE A REGULAR LANGUAGE AND Q BE A CONTEXT FREE LANGUAGE SUCH THAT QP.(FOR EXAMPLE, LET P BE THE LANGUAGE REPRESENTED BY THE REGULAR EXPRESSION P*Q* AND Q BE { N N} P Q |N N ). THEN WHICH OF THE FOLLOWING IS ALWAYS REGULAR?

(A) PQ

(B) P - Q

(C) X*P

(D) X*Q

14. IN A COMPILER, KEYWORDS OF A LANGUAGE ARE RECOGNIZED DURING

(A) Parsing of the program

(B) The code generation

(C) The lexical analysis of the program

(D) Dataflow analysis

15. A LAYER-4 FIREWALL (A DEVICE THAT CAN LOOK AT ALL PROTOCOL HEADERS UP TO THE TRANSPORT LAYER) CANNOT

(A) Block entire HTTP traffic during 9:00pm and 5:00am

(B) Block all ICMP traffic

(C) Stop incoming traffic from a specific IP address but allow outgoing traffic to the same IP address

(D) Block TCP traffic from a specific user on a multi-user system during 9:00pm and 5:00am

16. IF TWO FAIR COINS ARE FLIPPED AND AT LEAST ONE OF THE OUTCOMES IS KNOWN TO BE A HEAD, WHAT IS THE PROBABILITY THAT BOTH OUTCOMES ARE HEADS?

(A) 1/3

(B) 1/4

(C) 1/2

(D) 2/3

17. CONSIDER DIFFERENT ACTIVITIES RELATED TO EMAIL.

m1: Send an email from a mail client to a mail server

m2: Download an email from mailbox server to a mail client

m3: Checking email in a web browser

Which is the application level protocol used in each activity?

(A) m1:HTTP m2:SMTP m3:POP

(B) m1:SMTP m2:FTP m3:HTTP

(C) m1: SMTP m2: POP m3: HTTP

(D) m1: POP m2: SMTP m3:IMAP

18. A COMPANY NEEDS TO DEVELOP A STRATEGY FOR SOFTWARE PRODUCT DEVELOPMENT FOR WHICH IT HAS A CHOICE OF TWO PROGRAMMING LANGUAGES L1 AND L2. THE NUMBER OF LINES OF CODE (LOC) DEVELOPED USING L2 IS ESTIMATED TO BE TWICE THE LOC DEVELOPED WITH L1. THE PRODUCT WILL HAVE TO BE MAINTAINED FOR FIVE YEARS. VARIOUS PARAMETERS FOR THE COMPANY ARE GIVEN IN THE TABLE BELOW.



PARAMETER

LANGUAGE L1

LANGUAGE L2



Man years needed for development

LOC / 10000

LOC / 10000



Development Cost per year

Rs. 10,00,00

Rs. 7,50,000



Maintenance time

5 years

5 years



Cost of maintenance per year

Rs. 1,00,000

Rs. 50,000



TOTAL COST OF THE PROJECT INCLUDES COST OF DEVELOPMENT AND MAINTENANCE. WHAT IS THE LOC FOR L1 FOR WHICH THE COST OF THE PROJECT USING L1 IS EQUAL TO THE COST OFTHE PROJECT USING L2?

(A) 4000

(B) 5000

(C) 4333

(D) 4667

19. LET THE TIME TAKEN TO SWITCH BETWEEN USER AND KERNEL MODES OF EXECUTION BE T1 WHILE THE TIME TAKEN TO SWITCH BETWEEN TWO PROCESSES BE T2. WHICH OF THE FOLLOWING IS TRUE?

(A) t1 > t2

(B) t1 = t2

(C) t1 < t2

(D) Nothing can be said about the relation between t1 and t2

20. A COMPANY NEEDS TO DEVELOP DIGITAL SIGNAL PROCESSING SOFTWARE FOR ONE OF ITS NEWEST INVENTIONS. THE SOFTWARE IS EXPECTED TO HAVE 40000 LINES OF CODE. THE COMPANY NEEDS TO DETERMINE THE EFFORT IN PERSON-MONTHS NEEDED TO DEVELOP THIS SOFTWARE USING THE BASIC COCOMO MODEL. THE MULTIPLICATIVE FACTOR FOR THIS MODEL IS GIVEN AS 2.8 FOR THE SOFTWARE DEVELOPMENT ON EMBEDDED SYSTEMS, WHILE THE EXPONENTIATION FACTOR IS GIVEN AS 1.20. WHAT IS THE ESTIMATED EFFORT IN PERSON MONTHS?

(A) 234.25

(B) 932.50

(C) 287.80

(D) 122.40

21. WHICH OF THE FOLLOWING PAIRS HAVE DIFFERENT EXPRESSIVE POWER?

(A) Deterministic finite automata (DFA) and Non-deterministic finite automata (NFA).

(B) Deterministic push down automata (DPDA) and Non-deterministic push down automata (NPDA).

(C) Deterministic single-tape Turing machine and Non-deterministic single tape Turing machine.

(D) Single-tape Turing machine and multi-tape Turing machine.

22. HTML (HYPER TEXT MARKUP LANGUAGE) HAS LANGUAGE ELEMENTS WHICH PERMIT CERTAIN ACTIONS OTHER THAN DESCRIBING THE STRUCTURE OF THE WEB DOCUMENT. WHICH ONE OF THE FOLLOWING ACTIONS IS NOT SUPPORTED BY PURE HTML (WITHOUT ANY SERVER OR CLIENT SIDE SCRIPTING) PAGES?

(A) Embed web objects from different sites into the same page.

(B) Refresh the page automatically after a specified interval.

(C) Automatically redirect to another page upon download.

(D) Display the client time as part of the page.

23. WHICH OF THE FOLLOWING IS NOT DESIRED IN A GOOD SOFTWARE REQUIREMENT SPECIFICATIONS (SRS) DOCUMENT?

(A) Functional Requirements

(B) Non Functional Requirements

(C) Goals of Implementation

(D) Algorithms for Software Implementation

24. A COMPUTER HANDLES SEVERAL INTERRUPT SOURCES OF WHICH THE FOLLOWING ARE RELEVANT FOR THIS QUESTION.

Interrupt from CPU temperature sensor

Interrupt from Mouse

Interrupt from Keyboard

Interrupt from Hard Disk

(A) Interrupt from Hard Disk

(B) Interrupt from Mouse

(C) Interrupt from Keyboard

(D) Interrupt from CPU temp sensor

25. CONSIDER A RELATIONAL TABLE WITH A SINGLE RECORD FOR EACH REGISTERED STUDENT WITH THE FOLLOWING ATTRIBUTES.

1. RegistrationNumber: Unique registration number for each registered student.

2. UID: Unique Identity number, unique at the national level for each citizen.

3. BankAccountNumber: Unique account number at the bank. A student can have multiple accounts or joint accounts. This attributes stores the primary account number.

4. Name: Name of the Student

5. HostelRoom: Room number of the hostel

WHICH OF THE FOLLOWING OPTIONS IS INCORRECT?

(A) BankAccountNumber is a candidate key.

(B) RegistrationNumber can be a primary key.

(C) UID is a candidate key if all students are from the same country.

(D) If S is a superkey such that S UIDis NULL then SUID is also a superkey

Exp: - In case two students hold joint account then BankAccountNum will not uniquely determine other attributes.

Gate sample paper for computer science

Q. No. 26 - 51 Carry Two Marks Each

26. WHICH OF THE GIVEN OPTIONS PROVIDES THE INCREASING ORDER OF ASYMPTOTIC COMPLEXITY OF FUNCTIONS F1, F2, F3 AND F4?

F(1) = 2n, f(2) = n3/2

F(3) = n log n, f(4) = nlog2

(A) f3, f2, f4, f1

(B) f3, f2, f1, f4

(C) f2, f3, f1, f4

(D) f2, f3, f4, f1

27. FOUR MATRICES M1, M2, M3 AND M4 ARE DIMENSIONS PQ, QR, RS AND ST RESPECTIVELY CAN BE MULTIPLIED IN SEVERAL WAYS WITH DIFFERENT NUMBER OF TOTAL SCALAR MULTIPLICATIONS. FOR EXAMPLE WHEN MULTIPLIED AS ((M1 *M2) (M3* M4 )) 1 2 3 4 MMMM THE TOTAL NUMBER OF SCALAR MULTIPLICATIONS IS PQR+RST+PRT. WHEN MULTIPLIED AS ((( M1 * M2) *M3 ) *M4 )THE TOTAL NUMBER OF SCALAR MULTIPLICATIONS IS PQR+PRS+PST. IF P=10, Q=100, R=20, S=5 AND T=80, THEN THE MINIMUM NUMBER OF SCALAR MULTIPLICATIONS NEEDED IS

(A) 248000

(B) 44000

(C) 19000

(D) 25000

28. THE DATABASE CAN BE CONFIGURED TO DO ORDERED INDEXING ON AP OR HASHING ON AP. WHICH OF THE FOLLOWING STATEMENTS IS TRUE?

(A) Ordered indexing will always outperform hashing for both queries

(B) Hashing will always outperform ordered indexing for both queries

(C) Hashing will outperform ordered indexing on Q1, but not on Q2

(D) Hashing will outperform ordered indexing on Q2, but not on Q1.

29. CONSIDER THE MATRIX AS GIVEN BELOW.

1 2 3

0 4 7

0 0 3

WHICH ONE OF THE FOLLOWING PROVIDES THE CORRECT VALUES OF EIGENVALUES OF THE MATRIX?

(A) 1,4,3

(B) 3,7,3

(C) 7,3,2

(D) 1,2,3

30. CONSIDER AN INSTRUCTION PIPELINE WITH FOUR STAGES (S1, S2, S3 AND S4) EACH WITH COMBINATIONAL CIRCUIT ONLY. THE PIPELINE REGISTERS ARE REQUIRED BETWEEN EACH STAGE AND AT THE END OF THE LAST STAGE. DELAYS FOR THE STAGES AND FOR THE PIPELINE REGISTERS ARE AS GIVEN IN THE FIGURE.



WHAT IS THE APPROXIMATE SPEED UP OF THE PIPELINE IN STEADY STATE UNDER IDEAL CONDITIONS WHEN COMPARED TO THE CORRESPONDING NON-PIPELINE IMPLEMENTATION?

(A) 4.0

(B) 2.5

(C) 1.1

(D) 3.0

31. DEFINITION OF A LANGUAGE L WITH ALPHABET {A} IS GIVEN AS FOLLOWING { NK } L = A |K > 0, AND N IS A POSITIVE INTEGER CONSTANT WHAT IS THE MINIMUM NUMBER OF STATES NEEDED IN A DFA TO RECOGNIZE L?

(A) k+1

(B) n+1

(C) 2n+1

(D) 2k+1

32. AN 8 KB DIRECT MAPPED WRITE-BACK CACHE IS ORGANIZED AS MULTIPLE BLOCKS, EACH OF SIZE 32-BYTES. THE PROCESSOR GENERATES 32-BIT ADDRESSES. THE CACHE CONTROLLER MAINTAINS THE TAG INFORMATION FOR EACH CACHE BLOCK COMPRISING OF THE FOLLOWING. 1 VALID BIT 1 MODIFIED BIT AS MANY BITS AS THE MINIMUM NEEDED TO IDENTIFY THE MEMORY BLOCK MAPPED IN THE CACHE. WHAT IS THE TOTAL SIZE OF MEMORY NEEDED AT THE CACHE CONTROLLER TO STORE METADATA (TAGS) FOR THE CACHE?

(A) 4864 bits

(B) 6144 bits

(C) 6656 bits

(D) 5376 bits

33. AN APPLICATION LOADS 100 LIBRARIES AT START UP. LOADING EACH LIBRARY REQUIRES EXACTLY ONE DISK ACCESS. THE SEEK TIME OF THE DISK TO A RANDOM LOCATION IS GIVEN AS 10 MS. ROTATIONAL SPEED OF DISK IS 6000 RPM. IF ALL 100 LIBRARIES ARE LOADED FROM RANDOM LOCATIONS ON THE DISK, HOW LONG DOES IT TAKE TO LOAD ALL LIBRARIES? (THE TIME TO TRANSFER DATA FROM THE DISK BLOCK ONCE THE HEAD HAS BEEN POSITIONED AT THE START OF THE BLOCK MAY BE NEGLECTED)

(A) 0.50s

(B) 1.50s

(C) 1.25s

(D) 1.00s

34. A DETERMINISTIC FINITE AUTOMATION (DFA)D WITH ALPHABET= {A,B} IS GIVEN BELOW



WHICH OF THE FOLLOWING FINITE STATE MACHINES IS A VALID MINIMAL DFA WHICH ACCEPTS THE SAME LANGUAGE AS D?



35. THE FOLLOWING IS COMMENT WRITTEN FOR A C FUNCTION

/* This function computes the roots of a quadratic equation a.x^2+b.x+c=0. The function stores two real roots in *root1 and *root2 and returns the status of validity of roots. It handles four different kinds of cases.

i When coefficient a is zero irrespective of discriminant

ii When discriminant is positive

iii When discrimanant is zero

iv When discrimanant is negative

Only in cases ii and iii , the stored roots are valid. Otherwise 0 is stored in the roots. the function returns 0 when the roots are valid and -1 otherwise. The functin also ensures root1>=root2. int getQuadRoots float a, ( float b, float c, float *root1, float *root2);

* /A software test engineer is assigned the job of doing black box testing. He comes up with the following test cases, many of which are redundant.



WHICH ONE OF THE FOLLOWING OPTIONS PROVIDE THE SET OF NON-REDUNDANT TESTS USING EQUIVALENCE CLASS PARTITIONING APPROACH FROM INPUT PERSPECTIVE FOR BLACK BOX TESTING?

(A) T1,T2,T3,T6

(B) T1,T3,T4,T5

(C) T2,T4,T5,T6

(D) T2,T3,T4,T5

36. DATABASE TABLE BY NAME LOANRECORDS IS GIVEN BELOW.



BORROWER

BANKMANAGER

LOAN AMOUNT



Ramu

Sunderajan

10000.00



Sanjay

Ramgopal

5000.00



Mahesh

Sunderajan

7000.00



WHAT IS THE OUTPUT OF THE FOLLOWING SQL QUERY?

SELECT count(*)

FROM(

(SELECT Borrower. BankManager FROM LoanRecords) AS S

NATURAL JOIN

(SELECT BankManager, LoanAmount FROM LoanRecords) AS T

(A) 3

(B) 9

(C) 5

(D) 6

37. CONSIDER TWO BINARY OPERATORS '' AND '' WITH THE PRECEDENCE OF OPERATORBEING LOWER THAN THAT OF THE OPERATOR. OPERATORIS RIGHT ASSOCIATIVE WHILE OPERATOR, IS LEFT ASSOCIATIVE. WHICH ONE OF THE FOLLOWING REPRESENTS THE PARSE TREE FOR EXPRESSION



38. WHICH OF THE FOLLOWING STATEMENTS IS NOT TRUE?

(A) Push Down Automata (PDA) can be used to recognize L1 and L2

(B) L1 is a regular language

(C) All the three languages are context free

(D) Turing machines can be used to recognize all the languages

39. ON A NON-PIPELINED SEQUENTIAL PROCESSOR, A PROGRAM SEGMENT, WHICH IS A PART OF THE INTERRUPT SERVICE ROUTINE, IS GIVEN TO TRANSFER 500 BYTES FROM AN I/O DEVICE TO MEMORY. INITIALIZE THE ADDRESS REGISTER INITIALIZE THE COUNT TO 500

LOOP: Load a byte from device Store in memory at address given by address register Increment the address register Decrement the count

If count != 0 go to LOOP

Assume that each statement in this program is equivalent to a machine instruction which takes one clock cycle to execute if it is a non-load/store instruction. The load-store instructions take two clock cycles to execute. The designer of the system also has an alternate approach of using the DMA controller to implement the same transfer. The DMA controller requires 20 clock cycles for initialization and other overheads. Each DMA transfer cycle takes two clock cycles to transfer one byte of data from the device to the memory. What is the approximate speedup when the DMA controller based design is used in place of the interrupt driven program based input-output?

(A) 3.4

(B) 4.4

(C) 5.1

(D) 6.7

40. WE ARE GIVEN A SET OF N DISTINCT ELEMENTS AND AN UNLABELED BINARY TREE WITH N NODES. IN HOW MANY WAYS CAN WE POPULATE THE TREE WITH THE GIVEN SET SO THAT IT BECOMES A BINARY SEARCH TREE?

(A) 0

(B) 1

(C) n!

(D) 1/ n+1

41. WHICH ONE OF THE FOLLOWING OPTIONS IS CORRECT GIVEN THREE POSITIVE INTEGERS X, Y AND Z, AND A PREDICATE P (X) =(X = 1)"Y ( (X = Y * Z)(Y = X)(Y = 1))

(A) P(x) being true means that x is a prime number

(B) P(x) being true means that x is a number other than 1

(C) P(x) is always true irrespective of the value of x

(D) P(x) being true means that x has exactly two factors other than 1 and x

42. THE RELATION SCHEME STUDENT PERFORMANCE (NAME, COURSENO, ROLLNO, GRADE) HAS THE FOLLOWING FUNCTIONAL DEPENDENCIES:

A) name, courseNo -> grade

B) rollNo, courseNo -> grade

C) name -> rollNo

D) rollNo -> name

The highest normal form of this relation scheme is

43. CONSIDER A DATABASE TABLE T CONTAINING TWO COLUMNS X AND Y EACH OF TYPE INTEGER.

After the creation of the table, one record (X= 1, Y=l) is inserted in the table. Let MX and MY denote the respective maximum values of X and Y among all records in the table at any point in time. Using MX and MY, new records are inserted in the table 128 times with X and Y values being MX+1, 2*MY+1 respectively. It may be noted that each time after the insertion, values of MX and MY change. What will be the output of the following SQL query after the steps mentioned above are carried out?

SELECT Y FROM T WHERE X=7;

(A) 127

(B) 255

(C) 129

(D) 257

44. CONSIDER A FINITE SEQUENCE OF RANDOM VALUES X =X1,X2, XN. LETX BE THE MEAN AND X S BE THE STANDARD DEVIATION OF X .LET ANOTHER FINITE SEQUENCE Y OF EQUAL LENGTH BE DERIVED FROM THIS AS I I Y = A* X + B, WHERE A AND B ARE POSITIVE CONSTANTS. LET YBE THE MEAN AND Y S BE THE STANDARD DEVIATION OF THIS SEQUENCE. WHICH ONE OF THE FOLLOWING STATEMENTS IS INCORRECT?

(A) Index position of mode of X in X is the same as the index position of mode of Y in Y.

(B) Index position of median of X in X is the same as the index position of median of Y in Y.

45. A DECK OF 5 CARDS (EACH CARRYING A DISTINCT NUMBER FROM 1 TO 5) IS SHUFFLED THOROUGHLY. TWO CARDS ARE THEN REMOVED ONE AT A TIME FROM THE DECK. WHAT IS THE PROBABILITY THAT THE TWO CARDS ARE SELECTED WITH THE NUMBER ON THE FIRST CARD BEING ONE HIGHER THAN THE NUMBER ON THE SECOND CARD?

(A) 1/5

(B) 4/25

(C) 1/4

(D) 2/5

46. CONSIDER THE FOLLOWING TABLE OF ARRIVAL TIME AND BURST TIME FOR THREE PROCESSES P0, P1 AND P2.



Process

Arrival time

Burst Time



P0

0 ms

9 ms



P1

1 ms

4ms



P2

2 ms

9ms



The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of processes. What is the average waiting time for the three processes?

(A) 5.0 ms

(B) 4.33 ms

(C) 6.33 ms

(D) 7.33 ms

47. CONSIDER EVALUATING THE FOLLOWING EXPRESSION TREE ON A MACHINE WITH LOAD-STORE ARCHITECTURE IN WHICH MEMORY CAN BE ACCESSED ONLY THROUGH LOAD AND STORE INSTRUCTIONS. THE VARIABLES A, B, C, D AND E ARE INITIALLY STORED IN MEMORY. THE BINARY OPERATORS USED IN THIS EXPRESSION TREE CAN BE EVALUATED BY THE MACHINE ONLY WHEN THE OPERANDS ARE IN REGISTERS. THE INSTRUCTIONS PRODUCE RESULT ONLY IN A REGISTER. IF NO INTERMEDIATE RESULTS CAN BE STORED IN MEMORY, WHAT IS THE MINIMUM NUMBER OF REGISTERS NEEDED TO EVALUATE THIS EXPRESSION?

(A) 2

(B) 9

(C) 5

(D) 3

gate sample paper for computer science

COMMON DATA QUESTIONS: 48

else return 0;}

48. WHAT IS THE RETURN VALUE OF THE FUNCTION FOO WHEN IT IS CALLED AS FOO (513, 2)?

(A) 9

(B) 8

(C) 5

(D) 2

49. WHAT IS THE RETURN VALUE OF THE FUNCTION FOO WHEN IT IS CALLED AS FOO (345, 10) ?

(A) 345

(B) 12

(C) 5

(D) 3

COMMON DATA QUESTIONS: 50 & 51

CONSIDER THE FOLLOWING CIRCUIT INVOLVING THREE D-TYPE FLIP-FLOPS USED IN A CERTAIN TYPE OF COUNTER CONFIGURATION.



50. IF ALL THE FLIP-FLOPS WERE RESET TO 0 AT POWER ON, WHAT IS THE TOTAL NUMBER OF DISTINCT OUTPUTS (STATES) REPRESENTED BY PQR GENERATED BY THE COUNTER?

(A) 3

(B) 4

(C) 5

(D) 6

51. IF AT SOME INSTANCE PRIOR TO THE OCCURRENCE OF THE CLOCK EDGE, P, Q AND R HAVE A VALUE 0, 1 AND 0 RESPECTIVELY, WHAT SHALL BE THE VALUE OF PQR AFTER THE CLOCK EDGE?

(A) 000

(B) 001

(C) 010

(D) 011

Gate Sample Paper for Computer science

LINKED ANSWER QUESTIONS: Q.52 TO Q.55 CARRY TWO MARKS EACH

Statement for Linked Answer Questions: 52 & 53

AN UNDIRECTED GRAPH G(V,E) CONTAINS N ( N >2 ) NODES NAMED V1 , V2 , .V . TWO NODESVI , VJ ARE CONNECTED IF AND ONLY IF 0 < I - J EUR 2. EACH EDGE (VI ,V J ) IS ASSIGNED A WEIGHT I + J. A SAMPLE GRAPH WITH N = 4 IS SHOWN BELOW
Full Post

No comments:

Post a Comment