Saturday 18 June 2016

ISRO 2007 Answer Key and Solutions Computer Science Scientist Engineer

The ISRO Computer Science (CS) Scientist Engineer test held on April 22, 2007 (Sunday). Total questions were 80 and test duration were 90 Minutes. Here is the solution of paper according to me of set A.
  • The Answer Key 2007 for Set A Non-Official by Me: Click here (By ISRO not available)
  • For complete preparation for ISRO Computer Science visit my this article: Click Here 
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2016Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2015Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2014Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2013Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2011Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2009Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2008Click here

47. Which commands are used to control access over objects in relational databases?
(a) CASCADE & MVD
(b) GRANT & REVOKE
(c) QUE & QUIST
(d) None of these

Correct Answer: (b)
Explanation: The Data Control Language (DCL) is a subset of the SQL that allows database administrators to configure security access to relational databases. It consists of only three commands: GRANT, REVOKE, and DENY.
Reference: http://databases.about.com/od/Advanced-SQL-Topics/a/Data-Control-Language-Dcl.htm

48. Which of the following is aggregate function in SQL?
(a) Avg
(b) Select
(c) Ordered by
(d) distinct

Correct Answer: (a)
Explanation: SQL aggregate functions return a single value, calculated from values in a column. Useful aggregate functions: AVG() - Returns the average value. COUNT() - Returns the number of rows.
Reference: SQL Functions - W3Schools

50. A view of a database that appears to an application program is known as
(a) Schema
(b) Subschema
(c) Virtual table
(d) None of these

Correct Answer: (b)
Explanation: The external level is the user’s view of the database and closest to the users.This level describes that part of the database that is relevant to the user.

  • Most of the users of database are not concerned with all the information contained in the database. Instead, they need only a part of  the database relevant to them.
  • An subschema describes each external view. The subschema consists of the definition of the logical records and the relationships in the external view.
The sub-schemas appears to application program to perform the operations. 
Reference: http://gateoverflow.in/51119/view-of-database-that-appears-to-an-application-programmer

51. Armstrong's inference rule doesn't determine
(a) Reflexivity
(b) Augmentation
(c) Transivity
(d) Mutual dependency

Correct Answer: (d)
Explanation: We can derive additional functional dependencies from the initial set using inference rules. Armstrongs's Axioms are most basic inference rules. These are 3 rules:
  • Reflexivity: If Y is a subset of X, then X → Y
  • Augmentation: If X → Y, then XZ → YZ
  • Transitivity: If X → Y and Y → Z, then X → Z
Additionally there are secondary rules derived from above 3 rules:
  • Union: If X → Y and X → Z, then X → YZ
  • Decomposition: If X → YZ, then X → Y and X → Z
  • Pseudotransitivity: If X → Y and WY → Z, then WX → Z
  • Composition: If X → Y and Z → W, then XZ → YW

52. Which operation is used to extract specified columns from a table?
(a) Project
(b) Join
(c) Extract
(d) Substitute

Correct Answer: (a)
Explanation: Project operation (∏) is used to select (extract) columns from a table that satisfy a given conditions.
Reference: http://www.tutorialspoint.com/dbms/relational_algebra.htm

54. BCNF is not used for cases where a relation has
(a) Two (or more) candidate keys
(b) Two candidate keys and composite
(c) The candidate key overlap
(d) Two mutually exclusive foreign keys

Correct Answer: __
Explanation: To figure out correct option, following points require our attention:
  1. When a key is composed of more than one column, it is known as a composite key.
  2. A candidate key is a column (Simple Candidate Key), or set of columns (Composite Candidate Key), in a table that can uniquely identify any database record without referring to any other data. Each table may have one or more candidate keys.
  3. BCNF asks "are all attributes to the left of the arrows candidate keys?", if yes then its BCNF.
  4. Mutually Exclusive means can't happen at the same time.
And now check options one by one: 
  • Option (a) is a case for BCNF by seeing point 3 above.
  • Option (c) is a case for BCNF because there is candidate keys are overlapping (e.g. AB, AC, AD) and it is okay for BCNF.
Reference: https://www.gatementor.com/viewtopic.php?f=268&t=8444

60. Which of the following is correct with respect to Two phase commit protocol?
(a) Ensures serializability
(b) Prevents Deadlock
(c) Detects Deadlock
(d) Recover from Deadlock

Correct Answer: None of These
Explanation: Two-phase commit (2PC) protocol should not be confused with the two-phase locking (2PL) protocol, a concurrency control protocol. 2PL is a concurrency control method that guarantees serializability. 2PC is a distributed algorithm that coordinates all the processes that participate in a distributed atomic transaction.
Reference: https://en.wikipedia.org/wiki/Two-phase_commit_protocol

69. A rule in a limited entry decision table is a
(a) row of the table consisting of condition entries
(b) row of the table consisting of action entries
(c) column of the table consisting of condition entries and the corresponding action entries
(d) columns of the table consisting of conditions of the stub

Correct Answer: (c)
Explanation: The limited-entry decision table is the simplest to describe. The condition alternatives are simple Boolean values, and the action entries are check-marks, representing which of the actions in a given column are to be performed.
Reference: https://en.wikipedia.org/wiki/Decision_table


ISRO 2008 Answer Key and Solutions Computer Science Scientist Engineer

The ISRO Computer Science (CS) Scientist Engineer test held on May 4, 2008 (Sunday). Total questions were 80 and test duration were 90 Minutes. Here is the solution of paper according to me of set E.
  • The Answer Key 2008 for Set E Non-Official by Me: Click here (By ISRO not available)
  • For complete preparation for ISRO Computer Science visit my this article: Click Here 
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2016Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2015Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2014Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2013Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2011Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2009Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2007Click here

33. The join operation can be defined as
(a) a cartesian product of two relations followed by a selection
(b) a cartesian product of two relations
(c) a union of two relations followed by cartesian product of the two relations
(d) a union of two relations

Correct Answer: (a)
Explanation: Join is a combination of a Cartesian product followed by a selection process. A Join operation pairs two tuples from different relations, if and only if a given join condition is satisfied.
Reference: http://www.tutorialspoint.com/dbms/database_joins.htm

35. Embedded pointer provides
(a) An inverted index
(b) A secondary access path
(c) A physical record key
(d) A primary key

Correct Answer: (b)
Explanation: Embedded pointer is a pointer set in a data record that provides secondary access path.
Note: Same question again asked in ISRO 2013 CS exam.
Reference: http://gateoverflow.in/44407/isro-2013-61-isro2008-35

58. Checkpointing a job
(a) allows it to be completed successfully
(b) allows it to continue executing later
(c) prepares it for finishing
(d) occurs only when there is an error in it

Correct Answer: (b)
Explanation: Checkpointing is a method of periodically saving the state of a job so that, if for some reason, the job does not complete, it can be restarted from the saved state. Checkpoints can be taken either under the control of the user application or external to the application.
Reference: Checkpointing a job - IBM


Friday 17 June 2016

ISRO 2009 Answer Key and Solutions Computer Science Scientist Engineer

The ISRO Computer Science (CS) Scientist Engineer test held on April 26, 2009 (Sunday). Total questions were 80 and test duration were 90 Minutes. Here is the solution of paper according to me of set A.
  • The Answer Key 2009 for Set A Non-Official by Me: Click here (By ISRO not available)
  • For complete preparation for ISRO Computer Science visit my this article: Click Here 
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2016Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2015Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2014Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2013Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2011Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2008Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2007Click here

70. A locked database file can be
(a) Accessed by only one user
(b) Modified by users with the correct password
(c) Used to hide sensitive information
(d) Updated by more than one user

Correct Answer: (a)

Explanation: File locking is a mechanism that restricts access to a computer file by allowing only one user or process access at any specific time.
Reference: http://edugrip.blogspot.in/2012/07/database-management-system-multiple.html

71. Which of the following contains complete record of all activity that affected the contents of a database during a certain period of time?
(a) Transaction log
(b) Query languages
(c) Report writer
(d) Data manipulation language

Correct Answer: (a)
Explanation: A transaction log (also transaction journal, database log, binary log or audit trail) is a history of actions executed by a database management system to guarantee ACID properties over crashes or hardware failures. Physically, a log is a file listing changes to the database, stored in a stable storage format.
Reference: https://en.wikipedia.org/wiki/Transaction_log

72. Purpose of 'Foreign Key' in a table is to ensure
(a) Null Integrity
(b) Referential Integrity
(c) Domain Integrity
(d) Null & Domain Integrity

Correct Answer: (b)
Explanation: A foreign key is a column (or columns) that references a column (most often the primary key) of another table. The purpose of the foreign key is to ensure referential integrity of the data.
Reference: https://www.1keydata.com/sql/sql-foreign-key.html

73. Which of the following scenarios may lead to an irrecoverable error in a database system?
(A) A transaction writes a data item after it is read by an uncommitted transaction
(B) A transaction reads a data item after it is read by an uncommitted transaction
(C) A transaction reads a data item after it is written by a committed transaction
(D) A transaction reads a data item after it is written by an uncommitted transaction

Correct Answer: (d)
Explanation:
  • In option D, there is dirty read. In case if transaction reading uncommited data commits and that uncommited transaction fails then irrecoverable error occurs.
  • In option B, there is no issue. Both transaction are reading data.
  • In option C, it is normal. Someone reading a item after committed write by someone.
  • In option A, it is recoverable. Here write committed after uncommitted read by someone, if again after read done in same uncommitted transaction then there will be phantom error only.
Note: Same question had asked in GATE 2003 CS exam.
Reference: http://gateoverflow.in/919/gate2003_29




ISRO 2011 Answer Key and Solutions Computer Science Scientist Engineer

The ISRO Computer Science (CS) Scientist Engineer test held on April 16, 2011 (Saturday). Total questions were 80 and test duration were 90 Minutes. Here is the solution of paper according to me of set A.
  • The Answer Key 2011 for Set A Non-Official by Me: Click here (By ISRO not available)
  • For complete preparation for ISRO Computer Science visit my this article: Click Here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2016Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2015Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2014Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2013Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2009Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2008Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2007Click here

15. What is the equivalent serial schedule for the following transactions?
(a) T1-T2-T3
(b) T3-T1-T2
(c) T2-T1-T3
(d) T1-T3-T2

Correct Answer: (b)

Explanation: There is easy approach is testing serializability using precedence graph. Do following steps:
  • For each transaction Ti participating in schedule S, create a node labelled Ti in the precedence graph. So the precedence graph contains T1, T2, T3.
  • For each case in S where Ti executes a write_item(X) then Tj executes a read_item(X), create an edge (Ti --> Tj) in the precedence graph.
  • For each case in S where Ti executes a read_item(X) then Tj executes a write_item(X), create an edge (Ti --> Tj) in the precedence graph.
  • For each case in S where Ti executes a write_item(X) then Tj executes a write_item(X), create an edge (Ti --> Tj) in the precedence graph.
To do above described process fast, just take transaction one by one and check that what variables are using the taken transaction and what conflict occurring for that variable with other transaction. If conflict then draw edge.
  • Take T1; It is using X and Y variables and these are not using by T3 after T1; So there will no outgoing edge from T1 to T3; But these variables using by T2 after T1 where R(X) - W(X) and many more conflicts so there will be outgoing edge from T1 to T2.
  • Take T2; It is using X, Y and Z variables and these are not using by T1 and T3 after T2; So there will no outgoing edges from T2 to T1 and T2 to T3.
  • Take T3; It is using Y and Z variables and these are using by T1 and T2 after T3 where R(Y)-W(Y) and many more conflicts with T1 and T2; So there will be outgoing edges from T3 to T1 and T3 to T1.
  • By seeing precedence graph serial schedule is T3 --> T1 --> T2.
Note: Similar question had asked in GATE CS 2003 exam.
Reference: https://en.wikipedia.org/wiki/Precedence_graph

21. Which type of DBMS provides support for maintaining several versions of the same entity?
(a) Relational Data Base Management Systems
(b) Hierarchical
(c) Object Oriented Data Base Management Systems
(d) Network

Correct Answer: (c)
Explanation: Some Object Oriented Systems provide support for maintaining several versions of the same object. An old version of an object that represents a tested and verified design should be retained until the new version is tested and verified.
Reference: Fundamentals of Database Systems - Page 726 - Ramez Elmasri - 2008

29. Which 'Normal Form' is based on the concept of 'full functional dependency' is
(a) First Normal Form
(b) Second Normal Form
(c) Third Normal Form
(d) Fourth Normal Form

Correct Answer: (b)
Explanation: Second Normal Form based on the concept of full functional dependency. A relational schema R is in 2NF if all non-key attributes are fully functional dependent on the primary key. In full functional dependency on removal of any attribute from primary key if it still hold dependency than the dependency is partial.
Reference: Fundamentals of Database Systems - Page 726 - Ramez Elmasri - 2008

53. In functional dependency, Armstrong's inference rules refers to
(a) Reflexive, Augmentation and Decomposition
(b) Transitive, Augmentation and Reflexive
(c) Augmentation, Transitive, Reflexive and Decomposition
(d) Reflexive, Transitive and Decomposition

Correct Answer: (b)
Explanation: We can derive additional functional dependencies from the initial set using inference rules. Armstrongs's Axioms are most basic inference rules. These are 3 rules:
  • Reflexivity: If Y is a subset of X, then X → Y
  • Augmentation: If X → Y, then XZ → YZ
  • Transitivity: If X → Y and Y → Z, then X → Z
Additionally there are secondary rules derived from above 3 rules:
  • Union: If X → Y and X → Z, then X → YZ
  • Decomposition: If X → YZ, then X → Y and X → Z
  • Pseudotransitivity: If X → Y and WY → Z, then WX → Z
  • Composition: If X → Y and Z → W, then XZ → YW
Referencehttps://en.wikipedia.org/wiki/Functional_dependency



Thursday 16 June 2016

ISRO 2013 Answer Key and Solutions Computer Science Scientist Engineer

The ISRO Computer Science (CS) Scientist Engineer test held on May 12, 2013 (Sunday). Total questions were 80 and test duration were 90 Minutes. Here is the solution of paper according to me of set A.
  • The Final Answer Key 2013 for All Sets by ISRO: Click here 
  • For complete preparation for ISRO Computer Science visit my this article: Click Here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2016Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2015Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2014Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2011Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2009Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2008Click here
  • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2007Click here

23. Which of the following is the highest isolation level in transaction management?
(a) Serializable
(b) Repeated Read
(c) Committed Read
(d) Uncommitted Read

Correct Answer: (a)

Explanation: Isolation means the the querying user must be able to get a complete, consistent picture of the data, unaffected by other user's actions. There are four isolation levels:
  • Serializable: It is highest isolation level. It requires read and write locks to be released at the end of the transaction. The range-locks must be acquired when a SELECT query uses a ranged WHERE clause, especially to avoid the phantom reads.
  • Repeatable reads: It keeps read and write locks until the end of the transaction. However, range-locks are not managed, so phantom reads (two identical queries are executed, and the collection of rows returned by the second query is different from the first) can occur.
  • Read committed: It restricts the reader from seeing any intermediate, uncommitted, dirty read. Keeps write locks until the end of the transaction, but read locks are released as soon as the SELECT operation is performed. Phantom reads can occur.
  • Read uncommitted: It is lowest isolation level. Dirty reads (read data that has been not yet committed) are allowed. One transaction may see not-yet-committed changes made by other transactions.
Reference: https://en.wikipedia.org/wiki/Isolation_(database_systems)

24. Consider the following relational schema:
Suppliers (sid:integer, sname:string, saddress:string)
Parts (pid:integer, pname:string, pcolor:string)
Catalog (sid:integer, pid:integer, pcost:real)

What is the result of the following query?

(SELECT Catalog.pid from suppliers, Catalog
WHERE Suppliers.sid = Catalog.pid)
MINUS
(SELECT Catalog.pid from suppliers, Catalog
WHERE Suppliers.sname <> 'Sachin' and Suppliers.sid = Catalog.sid)

(a) Pid of parts supplied by all except Sachin
(b) Pid of parts supplied only by Sachin
(c) Pid of parts available in catalog supplied by Sachin
(d) Pid of parts available in catalog supplied by all except Sachin

Correct Answer: None of These
Explanation: There is printing error in the question, so no any option is correct. Lets do solution by correcting the error. In 2nd line read like this "WHERE Supplier.sid = Catalog.sid". The 1st query (query before MINUS) gives list of all the suppliers who supply a part. And 2nd query (query after MINUS) gives all the parts that supplied by all except Sachin. So complete query gives Pids of parts available in catalog supplied by Sachin (option c).
Reference: http://gateoverflow.in/43857/isro-2013-24

25. Consider the following dependencies and the Book table in a relational database design.
Determine the normal form of the given relation.
ISBN -> Title
ISBN -> Publisher
Publisher -> Address
(a) First Normal Form
(b) Second Normal Form
(c) Third Normal Form
(d) BCNF

Correct Answer: (b)
Explanation: First find candidate key, for this follow easy approach suggested by stinaq.me, draw diagram of dependencies. The diagram shows that we need ISBN to reach every attribute of relation. So ISBN is only the candidate key in this relation. To find normal form, follow easy approach suggested by stinaq.me.
  • First normal form: Are all the attributes atomic? Yes.
  • Second normal form: Is there a non primary attribute that’s determined by parts of a candidate key? No.
  • Third normal form: Does a non primary attribute exists that is determined by another non primary attribute? Yes.
So, given relation is in Second Normal Form.
Reference: http://gateoverflow.in/16128/which-of-the-following-is-true

26. Calculate the order of leaf (Pleaf) and non leaf (P) nodes of a B+ tree based on the information given below
Search key field = 12 bytes
Record pointer = 10 bytes
Block pointer = 8 bytes
Block size = 1 KB

(a) Pleaf = 51 & P = 46
(b) Pleaf = 47 & P = 52 
(c) Pleaf = 46 & P = 51
(d) Pleaf = 52 & P = 47

Correct Answer: (c)
Explanation: A Btree is a balanced binary search tree that follows a multi-level index format. Index is stored on the disk along with the actual database files. Memory block size is given 1 KB (1024 bytes), any node size will not be more than this. Order of a leaf and non-leaf node helps to determine number total size of node. Here we need to find order n using total size of node 1 KB.
  • Any intermediary non-leaf node have n-1 search keys and n block pointers.
    ((n-1)*Search Key Field) + (n*Block Pointer) <= 1024 bytes
    ((n-1)*12) + (n*8) <= 1024 bytes
    12n - 12 + 8n <= 1024
    n <= 51.8
    So order of non-leaf node is 51  
  • The leaf node have n search key fields, n record pointers, block pointer to right leaf node.
    (n*Search Key Field) + (n*Record Pointer) + (1*Block Pointer) <= 1024 bytes
    (n*12) + (n*10) + (1*8) <= 1024 bytes
    12n + 10n + 8 <= 1024
    n <= 46.18
    So order of non-leaf node is 46
Note: Similar question had asked in GATE CS 2015 exam.
Reference: http://gateoverflow.in/8555/gate2015-3_46

27. The physical location of a record determined by a formula that transforms a file key into a record location is
(a) Hashed file
(b) B-Tree file
(c) Indexed file
(d) Sequential file

Correct Answer: (a)
Reference: http://gateoverflow.in/16991/physical-location-determined-formula-transforms-location

61. Embedded pointer provides
(a) An inverted index
(b) A secondary access path
(c) A physical record key
(d) A primary key

Correct Answer: (b)
Explanation: Embedded pointer is a pointer set in a data record that provides secondary access path.
Note: Same question had asked in ISRO 2008 CS exam.


    Wednesday 15 June 2016

    ISRO Answer Key and Solutions Computer Science Scientist Engineer 2014

    The ISRO Computer Science (CS) Scientist Engineer test held on May 24, 2014 (Saturday). Total questions were 80 and test duration were 90 Minutes. Here is the solution of paper according to me of set A.
    • The Final Answer Key 2014 for All Sets by ISRO: Click here 
    • For complete preparation for ISRO Computer Science visit my this article: Click Here
    • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2016Click here
    • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2015Click here
    • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2013Click here
    • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2011Click here
    • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2009Click here
    • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2008Click here
    • For ISRO Answer Key and Solutions Computer Science Scientist Engineer 2007Click here

    1. Consider a 33 MHz CPU based system. What is the number of wait states required if it is interfaced with a 60ns memory? Assume a maximum of 10ns delay for additional circuitry like buffering and decoding.
    (a) 0 (b) 1 (c) 2 (d) 3

    Correct Answer: (c)
    Explanation:
    • A wait state is a delay experienced by a computer processor when accessing external memory or another device that is slow to respond.
    • CPU frequency is 33 MHz means 1 clock time is 1 / (33X106) = .03030 X 10-6 sec = 30.30 ns
    • Memory access time is 60 ns + 10ns = 70 ns
    • No. of wait states = No. of clocks to need = 70 ns / 30.30 ns = 2.31
    • Implies that in 3rd clock operation will complete. So no. of wait states 2.
    Reference: https://en.wikipedia.org/wiki/Wait_state

    2. The number of states required by a Finite State Machine, to simulate the behavior of a computer with a memory capable of storing ‘m’ words, with each word being ‘n’ bits long is
    (a) m x 2n (b) 2m+n (c) 2mn (d) m+n

    Correct Answer: (c)

    Explanation: We need to find the number of different configurations possible.
    • A word is of n bits. And we have m such words. So, total number of bits = m*n
    • We need a separate state for each bit combination. So, no. of states = 2mn
    Reference: http://gateoverflow.in/3411/states-required-simulate-behavior-computer-capable-storing

    3. What is the output of the following C program?
    #include <stdio.h>
    #define SQR(x) (x*x)

    int main()
    {
      int a;
      int b=4;

      a = SQR(b+2);
      printf("%d\n",a);
      return 0;
    }
    (a) 14 (b) 36 (c) 18 (d) 20

    Correct Answer: (a)

    Explanation: Traverse the value of SQR(b+2)
    = (b+2*b+2)
    = (4+2*4+2) = 14
    Reference: http://gateoverflow.in/49877/what-is-o-p-and-explain-pls

    4. Consider the following pseudo-code
      while ( m< n)
          if ( x > y) and (a < b) then
                 a=a+l
                 y=y-1
           end if
           m=m+l
      end while
    What is the cyclomatic complexity of the above pseudo-code?
    (a) 2  (b) 3  (c) 4  (d) 5

    Correct Answer: (c)
    Explanation: Cyclomatic complexity is a quantitative measure of the number of linearly independent paths through a program's source code. Analyse the given code follows using control flow graph.
    A    while ( m< n)
    B,C    if ( x > y) and (a < b) then
    D              a=a+l
    E              y=y-1
              end if
    F        m=m+l
    G   end while

    3 different ways to compute Cyclomatic Complexity (M):
    M = E-V+2*K = 9-7+2*1 = 4
    M = C + 1 = 3 + 1 = 4
    M = Regions(CFG) = 4

    where:
    E=number of edges
    V=number of vertices
    K=number of graph components
    C=number of conditions/decision points
    Reference: http://stackoverflow.com/questions/32242464/calculation-of-cyclomatic-complexity-for-pseudocode

    5. What is the number of steps required to derive the string ((() ()) ()) for the following grammar.
    S → SS
    S → (S)
    S → ε
    (a) 10 (b) 15 (c) 12 (d) 16 

    Correct Answer: (a)
    Explanation: 10 derivation steps need to derive the given string starting from symbol S:
    1. (S)
    2. (SS)
    3. ((S)S)
    4. ((SS)S)
    5. (((S)S)S)
    6. ((()S)S)
    7. ((()(S))S)
    8. ((()())S)
    9. ((()())(S))
    10. ((()())())

    6. The process of modifying IP address information in IP packet headers while in transit across a traffic routing device is called
    (a) Port address translation (PAT) 
    (b) Network address translation (NAT)
    (c) Address mapping 
    (d) Port mapping

    Correct Answer: (b)
    Explanation: Network Address Translation (NAT) is the process where a network device, usually a firewall, assigns a public address to a computer (or group of computers) inside a private network.
    Reference: https://en.wikipedia.org/wiki/Network_address_translation

    7. What does a pixel mask mean?
    (a) string containing only l’s
    (b) string containing only 0’s
    (c) string containing two 0’s
    (d) string containing 1′s and 0’s

    Correct Answer: (d)
    Explanation: Pixel mask is formed by digits 1 and 0 to determine the positions to create a plot within the line path. For example, the mask 1111000 is used to show a dashed line with a dash length of 4 and inter point spacing of 3.
    Reference: http://www.andswaru.com/What-is-pixel-mask

    8. In the standard IEEE 754 single precision floating point representation, there is 1 bit for sign, 23 bits for fraction and 8 bits for exponent. What is the precision in terms of the number of decimal digits?
    (a) 5 (b) 6 (c) 7 (d) 8

    Correct Answer: (c)
    Explanation: Precision is the number of digits we can represent accurately. IEEE 754 floating point representation have 23 precision bits and one implied bit (bit before point) makes it 24 precision bits. With 24 binary digits we can represent ___ decimal digits?
    There is concept to determine: baseXno. of digits = baseYno. of digits
    By following the concept: 224 = 10n
    => 24 log 2 = n log 10 => n = 24 log 2 => n = 24 * .30 => n = 7.22
    Means 7 is the precision in terms of the number of decimal digits.
    Reference: http://steve.hollasch.net/cgindex/coding/ieeefloat.html

    9. Let R be the radius of a circle. What is the angle subtended by an arc of length R at the centre of the circle?
    (a) 1 degree
    (b) 1 radian
    (c) 90 degrees
    (d) π radians

    Correct Answer: (b)
    Explanation: Radian measure θ of a central angle of a circle is defined as the ratio of the length of the arc the angle subtends (s) and the radius of the circle (r).
    So, R/R = 1 Radian.
    Reference: http://www.regentsprep.org/regents/math/algtrig/atm1/arclengthlesson.htm

    10. The number of logical CPUs in a computer having two physical quad-core chips with hyper threading enabled is ____.
    (a) 1  (b) 2  (c) 8  (d) 16

    Correct Answer: (d)
    Explanation: 
    • There are two quad core chips, so total no. of physical CPU = 2 * 4 = 8.
    • In hyper threading, every physical CPU corresponds to 2 logical CPU. 
    • Here 8 physical CPU corresponds to 8 * 2 = 16 logical CPU.
    Ref: http://gateoverflow.in/16310/number-logical-computer-having-physical-threading-enabled

    11. An aggregation association is drawn using which symbol?
    (a) A line which loops back on to the same table
    (b) A small open diamond at the end of a line connecting two tables
    (c) A small closed diamond at the end of a line connecting two tables
    (d) A small closed triangle at the end of a line connecting two tables

    Correct Answer: (b)

    Explanation: An aggregation is a collection, or the gathering of things together. This question is about drawing of aggregation association in UML. The aggregation link usually used to stress the point that Class A is not the exclusive container of Class B, as in fact Class B has another container.The open diamond is used to show aggregation. Example: library has students and books. Here the student can exist without library, the relation between student and library is aggregation.
    Reference: http://aviadezra.blogspot.in/2009/05/uml-association-aggregation-composition.html

    12. How many states are there in a minimum state deterministic finite automaton accepting the language  L = { w | w ∈ (0,1)*, number of 0’s is divisible by 2 and number of l’s is divisible by 5, respectively} ?
    (a) 7 (b) 9 (c) 10 (d) 11


    Correct Answer: (c)
    Explanation:
    Whenever "case 1 and case 2" is given for DFA, just multiply no. of states need for case 1 and number of states need for case 2 to find total states in DFA. So here states = 2 * 5 = 10.

    13. Which of the following is TRUE with respect to a Reference?
    (a) A reference can never be NULL
    (b) A reference needs an explicit dereferencing mechanism
    (c) A reference can be reassigned after it is established
    (d) A reference and pointer are synonymous


    Correct Answer: (a)
    Explanation: 
    • A reference can't be NULL, reference refers to some object, although it may or may not be valid.
    • Reference doesn't need an explicit dereferencing mechanism.
    • Once a reference is created, it cannot be later made to reference another object.
    • Pointer stores the address whereas Reference is an alias of some variable.
    Reference: http://gateoverflow.in/17420/which-of-the-following-is-true-with-respect-to-reference

    14. There are 200 tracks on a disk platter and the pending requests have come in the order – 36, 69, 167, 76, 42, 51, 126, 12, and 199. Assume the arm is located at the 1001h track and moving towards track 200. If sequence of disc access is 126, 167, 199, 12, 36, 42, 51, 69, and 76 then which disc access scheduling policy is used?
    (a) Elevator
    (b) Shortest Seek-time First
    (c) C-SCAN
    (d) First Come First Served

    Correct Answer: (c)
    Explanation: These are algorithms designed for disk scheduling tasks.
    • First Come-First Serve (FCFS): doesn't provide the best results, moves to fulfill FCFS.
    • Shortest Seek Time First (SSTF): request is serviced according to next shortest distance.
    • Elevator (SCAN): behaves as a building elevator, where the elevator continues to travel in its current direction until end of directions.
    • Circular SCAN (C-SCAN): Circular Elevator Algorithm, time of the return seek is wasted because in return direction never services requests.
    • LOOK: Similar to SCAN with one change, changes direction on last request.
    • C-LOOK: Similar to C-SCAN with one change, changes direction on last request and first request.
    Reference: http://www.cs.iit.edu/~cs561/cs450/disksched/disksched.html

    15. Consider the logic circuit given below:

    Q = _______________?
    (a) A'C+BC'+CD
    (b) ABC+C'D
    (c) AB+BC'+BD'
    (d) AB'+AC'+C'D

    Correct Answer: (c)
    Explanation: NAND gate produces complement of multiplication of inputted variables. Lets traverse the given circuit:
    = (((CD)' . B)' . (AB)')'
    = ((CD)' . B) + (AB)
    = ((C' + D') . B) + (AB)
    = (BC' + BD') + (AB)
    = AB + BC' + BD'

    16. What is routing algorithm used by OSPF routing protocol?
    (a) Distance vector
    (b) Flooding
    (c) Path vector
    (d) Link state


    Correct Answer: (d)
    Explanation: Open Shortest Path First (OSPF) is a routing protocol for Internet Protocol (IP) networks. It uses a link state routing algorithm and falls into the group of interior routing protocols, operating within a single autonomous system (AS).
    • OSPF is the most widely used interior gateway protocol (IGP) in large enterprise networks.
    • The basic concept of link-state routing is that every node constructs a map of the connectivity to the network, in the form of a graph, showing which nodes are connected to which other nodes. Each node then independently calculates the next best logical path from it to every possible destination in the network. The collection of best paths will then form the node's routing table.
    • A distance-vector routing protocol requires that a router inform its neighbors of topology changes periodically. Examples of distance vector routing are RIPv1 and RIPv2, IGRP and Babel.
    Reference: https://en.wikipedia.org/wiki/Open_Shortest_Path_First

    17. If each address space represents one byte of storage space, how many address lines are needed to access RAM chips arranged in a 4 x 6 array, where each chip is 8K x 4 bits?
    (a) 13 (b) 15 (c) 16 (d) 17


    Correct Answer: (d)
    Explanation:
    Number of chips = 4 * 6 = 24 => To address chips need 5 bits
    Chip is byte addressable and number of bytes in a chip = (8K x 4) / 8 = 210+2 = 212
    => To address bytes of chips needs 12 bits
    => So total 17 address lines need in corresponding to 17 bits.
    Reference: http://gateoverflow.in/15027/how-many-address-lines-are-needed-to-access-ram-chips

    18. Consider the following segment table in segmentation scheme:
    What happens if the logical address requested is – Segment Id 2 and Offset 1000?
    (a) Fetches the entry at the physical address 2527 for Segment Id 2
    (b) A trap is generated
    (c) Deadlock
    (d) Fetches the entry at offset 27 in Segment Id 3


    Correct Answer: (b)
    Explanation: Offset 1000 in Segment Id 2 is crossing the Segment Id 2 memory area. Here Segment Id 2 memory area is 1527 to 1527+498 = 2025.
    Reference: http://gateoverflow.in/16942/what-happens-logical-address-requested-segment-offset-1000

    19. The number of bit strings of length 8 that will either start with 1 or end with 00 is ______?
    (a) 32 (b) 128 (c) 160 (d) 192


    Correct Answer: (c)
    Explanation:
    • String starting with 1 (S):
      8 places where 1 place fixed and remaining 7 places can represent 2^7 = 128 values
    • String ending with 00 (E):
      8 places where 2 place fixed and remaining 6 places can represent 2^6 = 64 values
    • Common strings (S∩E) will be there that have been counted twice.
      8 places where 3 place fixed and remaining 5 places can represent 2^5 = 32 values
    Total = (S∪E)-(S∩E) = (128 + 64) - (32) = 160
    Ref: http://gateoverflow.in/15898/the-number-strings-length-that-will-either-start-with-end-with

    20. Which of the following is not a maturity level as per Capability Maturity Model?
    (a) Initial (b) Measurable (c) Repeatable (d) Optimized


    Correct Answer: (b)
    Explanation: The CMM model's aim is to improve existing software-development processes, but it can also be applied to other processes. There are five levels defined:
    1. Initial (chaotic, ad hoc, individual heroics) - the starting point for use of a new or undocumented repeat process.
    2. Repeatable - the process is at least documented sufficiently such that repeating the same steps may be attempted.
    3. Defined - the process is defined/confirmed as a standard business processes.
    4. Managed - the process is quantitatively managed in accordance with agreed-upon metrics.
    5. Optimizing - process management includes deliberate process optimization.
    Reference: https://en.wikipedia.org/wiki/Capability_Maturity_Model

    21. Consider the following sequential circuit.
    What are values of Q0 and Q1 after 4 clock cycles, if the initial values are 00?
    (a) 11 (b) 01 (c) 10 (d) 00


    Correct Answer: (d)
    Explanation:
    • T flip flop toggles the state if input T is 1, and does not change state if input T is 0.
    • T flip flop is a clocked (synchronous or edge-triggered) flip flop.
    • Edge triggered flip flops can only change its values at the edge of a clock, in absence of edge does not change its state, remains same.
    • In given circuit, clock symbol is showing that it is positive edge triggering (low to high change). Note that there are mainly four different types of clock-triggering methods
    Now, we need to find out Q0Q1 after 4 clock cycles.
    Initial   : 00 States Q0 and Q1 are zero
    Clock 1: 11 State Q0 changed to 1 because input T is 1 and previous state was 0 and State Q1 changed to 1 because input T is 1 and previous state was 0.
    Clock 2: 01 State Q0 changed to 0 because input T is 1 and previous state was 1 and State Q1 remains same because clk value is 0.
    Clock 3: 10 State Q0 changed to 1 because input T is 1 and previous state was 0 and State Q1 changed to 0 because input T is 1 and previous state was 1.
    Clock 4: 00 State Q0 changed to 0 because input T is 1 and previous state was 1 and State Q1 remains same because clk value is 0.

    22. Consider the schema R (A, B, C, D) and the functional dependencies A -> B and C -> D. If the decomposition is made as R1 (A, B) and R2(C, D), then which of the following is TRUE?(a) Preserves dependency but cannot perform lossless join 
    (b) Preserves dependency and performs lossless join
    (c) Does not preserve dependency and cannot perform lossless join
    (d) Does not preserve dependency but performs lossless join

    Correct Answer: (a)
    Explanation: While decomposing a relational table we must verify the following properties:
    • Dependency Preserving Property: whether we can derive all the original FDs from the FDs present after decomposition? If yes then it is preserving.
    • Lossless-Join Property: whether one of the following functional dependencies exist:
      R1 ∩ R2 → R1 or R1 ∩ R2 → R2? If yes then it performs lossless join.
    Note: Same question had asked in GATE 2001 CS exam.
    Reference: http://quiz.geeksforgeeks.org/gate-gate-cs-2001-question-23/

    23. The test suite (set of test input) used to perform unit testing on a module could cover 70% of the code. What is the reliability of the module if the probability of success is 0.95 during above testing?
    (a) 0.665 to 0.95 
    (b) At the most 0.665
    (c) At the most 0.95 
    (d) At least 0.665

    Correct Answer: (b)
    Explanation: I haven't got exact solution of this question.
    Code covered for testing: 70%
    Probability of success: 95%
    Reliability = .70 * .95 = 0.665
    I do not know how we can say that this reliability is at most or at least.

    24. In a system an RSA algorithm with p = 5 and q = 11, is implemented for data security. What is the value of the decryption key if the value of the encryption key is 27?
    (a) 3 (b) 7 (c) 27 (d) 40

    Correct Answer: (a)
    Explanation: RSA algorithm is is an asymmetric cryptographic algorithm. RSA involves a public key (encryption key) and private key (decryption key).
    • Choose two different large random prime numbers p and q. Here already given p = 5, q =11.
    • Calculate n = p*q where n is the modulus for the public key and the private keys. Here n = 55.
    • Calculate the totient: ϕ = (p − 1) * (q − 1). Here ϕ = 40.
    • Choose an encryption key integer e such that 1 < e < ϕ and e is co-prime to ϕ
      i.e. e and ϕ share no factors other than 1 or we can say gcd(e, ϕ) = 1.
      Here e is already given that is e = 27.
    • Compute an decryption key d to satisfy the congruence relation d * e ≡ 1 mod ϕ.
      Here we require to find out the value of decryption key.
      d * 27 = 1 mod 40 => d = 81
    Reference: https://simple.wikipedia.org/wiki/RSA_(algorithm)

    25. Suppose you want to build a memory with 4 byte words and a capacity of 221 bits. What is type of decoder required if the memory is built using 2K x 8 RAM chips?
    (a) 5 to 32 (b) 6 to 64 (c) 4 to 16 (d) 7 to 128


    Correct Answer: (a)
    Explanation: Decoder is an electronic circuit with multiple inputs and multiple outputs. Here to built memory, decoder will help to select required memory chips as per the need.
    • 2K x 8 denotes there is 2K = 211 cells and 11 address lines needs to select a cell.
    • Total need of RAM chips is = 221 / (2K x 8) = 27 = 128
    • RAM chips will be used in groups of 4 because word size is 4 byte. At any time 4 RAM chips will be selected together and a byte can be fetched in parallel from all these, resulting in 4 bytes being fetched in 1 memory cycle. Here RAM chip groups = 128/4 = 32.
    • To select any RAM chip group out of 32 needs 5 lines to 32 lines decoder.
    Decoder will be 5 to 32 because 5 input lines can select any RAM chip groups out of 32 RAM chip groups.
    Reference: http://gateoverflow.in/4755/how-many-2k-x-8-ram-chips-are-needed

    26. The output of a tristate buffer when the enable input in 0 is
    (a) Always 0
    (b) Always 1
    (c) Retains the last value when enable input was high
    (d) Disconnected state


    Correct Answer: (d)
    Explanation:

    27. How many different BCD numbers can be stored in 12 switches? (Assume two position or on-off switches).
    (a)
    212 (b) 212-1 (c) 1012 (d) 103

    Correct Answer: (d)
    Explanation: With 4 bit we can represent BCD numbers 0 to 9. With 12 bits (12 switches) we can represent 0 to 9 numbers 3 times. Means 0 to 999; means 1000 numbers; means 10^3.
    Reference: http://gateoverflow.in/13388/solve

    28. Suppose there are eleven items in sorted order in an array. How many searches are required on the average, if binary search is employed and all searches are successful in finding the item?
    (a) 3.00 (b) 3.46 (c) 2.81 (d) 3.33


    Correct Answer: (a)
    Explanation: The question is about of number of searches. Mid (root) element will require 1 search. 2nd level elements will require 2 searches and 3rd level elements will require 3 searches and so on. In this way, total number of searches for 11 elements = 1+(2+2)+(3+3+3+3)+(4+4+4+4) = 33. And average of this is 33/11 = 3.
    Reference: http://gateoverflow.in/16124/many-searches-required-the-average-binary-search-employed

    29. Consider the following Java code fragment. Which of the following statement is true?
    Line No     Code Statement
    1 public class While
    2 {
    3    public void loop()
    4    {

    5        int x = 0;
    6        while (1)

    7        {
    8            System.out.println("x plus one is " + (x+l));
    9        }
    10   }
    11 }

    (a) There is syntax error in line no. 1
    (b) There are syntax errors in line nos. 1 & 6
    (c) There is syntax error in line no. 8
    (d) There is syntax error in line no. 6


    Correct Answer: (d)
    Explanation: Java can use reserved keywords in class name (read here), so there is no error in line 1.
    Here error is in line number 6: incompatible types: int cannot be converted to boolean.
    In java, code while(1){ System.out.println("Hello"); } gives error while code while(true){ System.out.println("Hello"); } never give any error (check code).

    30. Every time the attribute A appears, it is matched with the same value of attribute B but not the same value of attribute C. Which of the following is true?
    (a) A -> (B, C)
    (b) A -> B, A ->> C       
    (c) A -> B, C ->> A         
    (d) A ->> B, B -> C

    Correct Answer: (b)
    Explanation: Symbol ->> shows multi-value dependencies. If A ->> C is a dependency it means, for A, C has more than one value. Question is saying whenever A appears B has same value which is true in case of functional dependency A -> B, it means whenever A value repeats there be same B value. Also saying C is not same, it means for same A it contains multiple value of c.

    Reference: http://gateoverflow.in/16128/which-of-the-following-is-true

    42. Let x,y,z,a,b,c be the attributes of an entity set E. If {x}, {x,y}, {a,b}, {a,b,c} ,{x,y,z} are superkeys then which of the following are the candidate keys?
    (a){x,y} and {a,b}
    (b){x} and {a,b}
    (c){x,y,z} and {a,b,c}
    (d){z} and {c}

    Correct Answer: (b)
    Explanation: In list of all the superkeys, minimal superkeys are candidate key. In given {x} and {a,b} are minimal superkeys so they are candidate keys.
    Reference: http://gateoverflow.in/17425/which-of-the-following-are-the-candidate-keys

    63. Consider the following Table

    The table is in which normal form?
    (a) First Normal Form
    (b) Second Normal Form
    (c) Third Normal Form but not BCNF
    (d) Third Normal From and BCNF

    Correct Answer: (c)
    Explanation: To find normal form, follow this easy approach suggested by stinaq.me.
    • First normal form: Are all the attributes atomic? Yes.
    • Second normal form: Is there a non primary attribute that’s determined by parts of a candidate key? No.
    • Third normal form: Does a non primary attribute exists that is determined by another non primary attribute? No.
    • Boyce-Codd normal form: Are all attributes to the left of the arrows candidate keys? No. Here given table is also having a C -> D dependency where C is not a candidate key. So given table is not in BCNF.