All India Computer Science Engineering (CSE) Group

The ________ comparison checker is used to check “each and every” condition
  • a)
    all
  • b)
    and
  • c)
    every
  • d)
    each
Correct answer is option 'A'. Can you explain this answer?

Crack Gate answered
The all comparison checker is used to check “each and every” condition. The “each” and “every” comparison checkers do not exist in SQL.

BIOS is used?
  • a)
    By operating system
  • b)
    By compiler
  • c)
    By interpreter
  • d)
    By application software
Correct answer is option 'A'. Can you explain this answer?

Crack Gate answered
BIOS is used by the operating system. It is used to configure and identify the hardware in a system such as the hard drive, floppy drive, optical drive, CPU, and memory.

SQL subqueries that can occur wherever a value is permitted provided the subquery gives only one tuple with a single attribute are called _________
  • a)
    Exact Subqueries
  • b)
    Vector Subqueries
  • c)
    Positive Subqueries
  • d)
    Scalar Subqueries
Correct answer is option 'D'. Can you explain this answer?

Crack Gate answered
SQL subqueries that can occur wherever a value is permitted provided the subquery gives only one tuple with a single attribute are called Scalar subqueries. Scalar Subqueries can be used in the SQL update statement when they are used under the set clause.

What is the maximum length of the filename in DOS?
  • a)
    4
  • b)
    5
  • c)
    8
  • d)
    12
Correct answer is option 'C'. Can you explain this answer?

Crack Gate answered
The maximum length of the filename is 8 characters in the DOS operating system. It is commonly known as an 8.3 filename.

What is the full name of FAT?
  • a)
    File attribute table
  • b)
    File allocation table
  • c)
    Font attribute table
  • d)
    Format allocation table
Correct answer is option 'B'. Can you explain this answer?

Crack Gate answered
The FAT stands for File allocation table. The FAT is a file system architecture. It is used in computer systems and memory cards. A FAT of the contents of a computer disk indicates which field is used for which file.

Which of the following is the extension of Notepad?
  • a)
    .txt
  • b)
    .xls
  • c)
    .ppt
  • d)
    .bmp
Correct answer is option 'A'. Can you explain this answer?

Crack Gate answered
The .txt file extension is a standard text document extension that contains the unformatted text. It is the default file extension for the notepad.

When was the first operating system developed?
  • a)
    1948
  • b)
    1949
  • c)
    1950
  • d)
    1951
Correct answer is option 'C'. Can you explain this answer?

Crack Gate answered
The first operating system was developed in the early 1950's. It was also called a single-stream batch processing system because it presented data in groups.

Which of the following is not an operating system?
  • a)
    Windows
  • b)
    Linux
  • c)
    Oracle
  • d)
    DOS
Correct answer is option 'C'. Can you explain this answer?

Crack Gate answered
Oracle is an RDBMS (Relational Database Management System). It is known as Oracle Database, Oracle DB, or Oracle Only. The first database for enterprise grid computing is the Oracle database.

Suppose a database schedule S involves transactions T1, …,Tn. Construct the precedence graph of S with vertices representing the transactions and edges representing the conflicts. If S is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule? 
  • a)
    Topological order
  • b)
    Depth-first order
  • c)
    Breadth-first order
  • d)
    Ascending order of transaction indices
Correct answer is option 'A'. Can you explain this answer?

Crack Gate answered
Serial schedule is possible only when precedence graph doesn’t contain cycle. If precedence graph contains a cycle, it means schedule is not conflict serializable.
Breadth first search and Depth first search of a graph are possible even if graph contains cycle.
Topological sort in a graph will not work if graph contains a cycle.
Consider a directed acyclic graph:

 
Here Two orders possible: V2, V3, V1, V4, V5, V6 OR V3, V2, V1, V4, V5, V6.
In case of ascending order of transaction indices, two non-conflicting schedules can occur simultaneously.

Consider the following transactions with data items P and Q initialized to zero:
T1 :read (P);
read (Q);
if P = 0 then Q := Q + 1 ;
write (Q).
T2 : read (Q);
read (P);
if Q = 0 then P := P + 1 ;
write (P).
Q. Any non-serial interleaving of T1 and T2 for concurrent execution leads to
  • a)
    a serializable schedule
  • b)
    a schedule that is not conflict serializable
  • c)
    a conflict serializable schedule
  • d)
    a schedule for which a precedence graph cannot be drawn
Correct answer is option 'B'. Can you explain this answer?

Crack Gate answered
P and Q are initialized to Zero, write operation on P and Q will be executed.
Consider any non-serial schedule like R1(P), R2(Q), R1(Q), R2(P), W1(Q), W2(P). R1(P) conflicts with W2(P) Hence T1 must be before T2. R2(Q) conflicts with W1(Q) Hence T2 must be before T1. There is no serial schedule that satisfies both of them hence it does not conflict with serializable.
Hence the correct answer is a schedule that is not conflict serializable.

Consider the following transaction with data items P and Q initialized to zero:
T1 : read  (P) ;
read  (Q) ;
if P = 0 then Q : = Q + 1;
write (Q) ;
T2 : read  (Q) ;
read (P) ;
if Q = 0 then P : = P + 1 ;
write  (P) ;
Q. Any non-serial interleaving of T1 and T2 for concurrent execution leads to
  • a)
    A serializable schedule
  • b)
    A conflict serializable schedule 
  • c)
    A schedule for which a precedence graph cannot be drawn
  • d)
    A schedule that is not conflict serializable
Correct answer is option 'D'. Can you explain this answer?

Crack Gate answered
Concept:
Two or more actions are said to be in conflict if:
  • The actions are associated with various transactions.
  • A write operation is involved in at least one of the operations.
  • The actions all refer to the same thing (read or write).
If the following conditions are met, the schedules S1 and S2 are said to be conflict-equivalent:
  • The transactions in schedules S1 and S2 are the same (including ordering of actions within each transaction).
  • In both S1 and S2, the order of each pair of conflicting actions is the same.
Conflict-serializable:
A schedule is said to be conflict-serializable when the schedule is conflict-equivalent to one or more serial schedules.  Conflict-serializability is that a schedule is conflict-serializable if and only if its precedence graph/serializability graph, when only committed transactions are considered, is acyclic.
There are two possible serial schedules:
  • T1 followed by T2.
  • T2 followed by T1.
As an initial step in both serial schedules, one of the transactions reads the value written by the other transaction. As a result, any non-serial T1 and T2 interleaving will not be conflict serializable.
Hence the correct answer is a schedule that is not conflict serializable.

A B-Tree used as an index for a large database table has four levels including the root node. If a new key is inserted in this index, then the maximum number of nodes that could be newly created in the process are
  • a)
    5
  • b)
    4
  • c)
    1
  • d)
    2
Correct answer is option 'A'. Can you explain this answer?

Crack Gate answered
Concept:
Considering all nodes are completely full means every node has N − 1 key.
If a new key is inserted, then at every level there will be a new node created, and in the worst-case root node will also be broken into two parts. Since we have 4 levels, then 5 new nodes will be created
Additional Information:
Diagram needs to be updated

First, the overflow happens at the leaf, and second on the parent of that leaf, and so on until the last overflow happens at the root node.

Key Points
If the database table has h levels and the level of the root node is 1 then on a new key insertion, the maximum number of nodes newly created is h + 1

If a node has K children in B tree, then the node contains exactly _______ keys.
  • a)
    K2
  • b)
    K - 1
  • c)
    K + 1
  • d)
    √K
Correct answer is option 'B'. Can you explain this answer?

Crack Gate answered
CONCEPT:
B-tree is a self-balancing search tree that allows all operations i.e. searching, insertion, deletion in logarithmic(log) time.
Key Points
A B-tree of order m must satisfy the following properties:
  • Every node can have maximum m children.
  • Every internal node (except root) can have at least [m/2] child nodes.
  • The root, if not a leaf node, can have at least two children.
  • An internal node with k children contains k − 1 key.
  • All leaf nodes must be at the same level.
Hence, if a node has K children in B tree, then the node contains exactly k-1 keys.

A B-Tree used as an index for a large database table has 7 levels where level of the root node is 0. If a new key is inserted in this index, then the maximum number of nodes that could be newly created in the process are:
  • a)
    6
  • b)
    7
  • c)
    8
  • d)
    9
Correct answer is option 'D'. Can you explain this answer?

Crack Gate answered
At every level, one new node is created except root, at two new nodes is created.
Tips and Tricks:
If database table has h levels and level of root node is 0 then on a new key insertion, maximum number of nodes newly created is h + 2
New nodes = 7 + 2 = 9
If database table has h levels and level of root node is 1 then on a new key insertion, maximum number of nodes newly created is h + 1

Which of the following is the most widely used external memory data structure?
  • a)
    AVL tree
  • b)
    B-tree
  • c)
    Red-black tree
  • d)
    Both AVL tree and Red-black tree
Correct answer is option 'B'. Can you explain this answer?

Crack Gate answered
In external memory, the data is transferred in form of blocks. These blocks have data valued and pointers. And B-tree can hold both the data values and pointers. So B-tree is used as an external memory data structure.

Five node splitting operations occurred when an entry is inserted into a B-tree. Then how many nodes are written?
  • a)
    14
  • b)
    7
  • c)
    11
  • d)
    5
Correct answer is option 'C'. Can you explain this answer?

Crack Gate answered
If s splits occur in a B-tree, 2s + 1 nodes are written (2 halves of each split and the parent of the last node split). So, if 5 splits occurred, then 2 * 5 + 1, i.e. 11 nodes are written.

A B-tree of order 4 and of height 3 will have a maximum of _______ keys.
  • a)
    255
  • b)
    63
  • c)
    127
  • d)
    188
Correct answer is option 'A'. Can you explain this answer?

Crack Gate answered
A B-tree of order m of height h will have the maximum number of keys when all nodes are completely filled. So, the B-tree will have n = (mh+1 – 1) keys in this situation. So, required number of maximum keys = 43+1 – 1 = 256 – 1 = 255.

2-3-4 trees are B-trees of order 4. They are an isometric of _____ trees.
  • a)
    AVL
  • b)
    AA
  • c)
    2-3
  • d)
    Red-Black
Correct answer is option 'D'. Can you explain this answer?

Crack Gate answered
2-3-4 trees are isometric of Red-Black trees. It means that, for every 2-3-4 tree, there exists a Red-Black tree with data elements in the same order.

What is the best case height of a B-tree of order n and which has k keys?
  • a)
    logn (k+1) – 1
  • b)
    nk
  • c)
    logk (n+1) – 1
  • d)
    klogn
Correct answer is option 'A'. Can you explain this answer?

Crack Gate answered
B-tree of order n and with height k has best case height h, where h = logn (k+1) – 1. The best case occurs when all the nodes are completely filled with keys.

Find the number of elements in the following array.
char si [] = "India is great";
  • a)
    3
  • b)
    5
  • c)
    15
  • d)
    12
Correct answer is option 'C'. Can you explain this answer?

Crack Gate answered
char si [] = "India is great";
The above declaration is a dynamic allocation of array name si of character datatype.
Hence the correct answer is 15.

Consider the following array declaration in ‘C’ language:
int array[] = {2, 3, 4, 5};
What will be the output of the following statement?
printf("%d", 2[array]);
  • a)
    4
  • b)
    3
  • c)
    2
  • d)
    5
Correct answer is option 'A'. Can you explain this answer?

Crack Gate answered
An array is defined as the collection of similar types of data items stored at contiguous memory locations. Arrays are the derived data type in C programming language which can store the primitive type of data such as int, char, double, float, etc. C array is beneficial if you have to store similar elements.
int array[] = {2, 3, 4, 5}; This array storage be like, 
The above array at index I can be accessed by, a[i], i[a], *(a+i) or *(i+a) all the above representations all are equal and gives the i th index value.
printf(%d', 2[array]); So, it gives the 2nd  index value. i.e 4.
Hence the correct answer is 4.

Which of the following concepts make extensive use of arrays?
  • a)
    Binary trees
  • b)
    Scheduling of processes
  • c)
    Caching
  • d)
    Spatial locality
Correct answer is option 'D'. Can you explain this answer?

Crack Gate answered
 Whenever a particular memory location is referred to, it is likely that the locations nearby are also referred, arrays are stored as contiguous blocks in memory, so if you want to access array elements, spatial locality makes it to access quickly.

In C, how do you properly initialise an array?
  • a)
    int arr{}={11,12,15,16,19}
  • b)
    int arr()={11,12,15,16,19}
  • c)
    int arr{5}={11,12,15,16,19}
  • d)
    int arr[5]={11,12,15,16,19}
Correct answer is option 'D'. Can you explain this answer?

Crack Gate answered
Array:
An array is a group of data components that are stored in the same memory region at the same time. It is the most basic data structure, in which each data piece may be retrieved simply by its index number alone.
Array initialize:
Only square brackets [ ] must be used for declaring an array. The given {}, () are not useful for array initialization.
int arr[5]={11,12,15,16,19} is correct.
The above statement can store the 5 elements in a continuous manner. consider the array base address is 100.
Hence the correct answer is  int arr[5]={11,12,15,16,19}.

LB are UB are lower bound and upper bound of a linear array LA. Consider following algorithm -
  1. Repeat for K = LB to UB apply PROCESS to LA [K]
  2. Exit
The algorithm ______ the array LA.
  • a)
    sorts
  • b)
    traverses
  • c)
    merges
  • d)
    searches
Correct answer is option 'B'. Can you explain this answer?

Crack Gate answered
LB refers to the lower bound of an array ( first index element of an array ) and UB refers to the upper bound of an array, that is the last index of an array. 
Let's take an example to understand this - 
Array - [2,6,7,0,15], where 2 is the lower bound and 15 is the upper bound element.
The K is the variable that holds the index of the array. While the LA is the name of the array. A loop is used to visit to traverse the elements from LB to UB.
The K holds the index of element 2 which is 0 and reaches index 4 of element 15.
The LA array using K traverse all the elements in the array. So, Option 2 will be the answer. 

Consider the following program of ‘C’
main ( )
{
static int a [ ] = { 1, 2, 3, 4, 5, 6, 7, 8 } ;
int i;
for(i = 2; I < 6; ++i)
a [a [i] ] = a [i];
for (I = 0; I < 8 ; ++i)
printf (“%d”, a[i]);
}
Q. The output of the program is :
  • a)
    1 2 3 4 5 6 7 8
  • b)
    1 2 3 3 5 5 7 8
  • c)
    1 2 2 3 3 4 4 8
  • d)
    None of the above
Correct answer is option 'B'. Can you explain this answer?

Crack Gate answered
Array a
for(I = 2; I < 6; ++i)            // initially i = 2 and 2< 6(true)
a [a [i] ] = a [i];         
Iteration 1:
i = 2;
a[a[2]] = a[2]
a[3] = [3]
Iteration 2:
When i = 3, 3 < 6 (true)
a[a[3]] = a[3]
a[3] = 3              // as in iteration 1, a[3] becomes was 3
Iteration 3:
When i = 4
a[a[4]] = a[4]
a[5] = 5
Iteration 4:
When i = 5, 5 < 6 (true)
a[a[5]] = a[5]
a[5] = 5                // as in iteration 3 a[5] becomes 5.
In next iteration i becomes and condition 6 < 6 false here.
Content of array A are as follows:
Finally, it prints: 1 2 3 3 5 5 7 8

An array name is a
  • a)
    Subscript
  • b)
    Formal parameter
  • c)
    Memory address
  • d)
    Prototype
Correct answer is option 'C'. Can you explain this answer?

Crack Gate answered
An array is a collection of items stored at contiguous memory locations. The idea is to store multiple items of the same type together.
When an array is used as a value and array name represents the address of the first element. When an array is not used as a value its name represents the whole array.
Array name is a type of name or a type of any element name that is share by all elements of an array but its indexes are different. Array name handle as a constant pointer, it can never change during execution of a program. Array name is also used to reach its all element.
Therefore Option 3 is correct

Consider the following ANSI C program.
#include
int main()
{
   int arr[4][5];
   int i, j;
  for(i =0; i<4; i++)
  {
    for (j =0; j<5; j++)
    {
       arr [i][j] = 10 * i + j;
    }
  }
     print("%d", *(arr[1] + 9));
     return 0;
}
Q. What is the output of the above program?
  • a)
    14
  • b)
    20
  • c)
    30
  • d)
    24
Correct answer is option 'D'. Can you explain this answer?

Crack Gate answered
*(arr[1] + 9) can be written as arr[1][9].
as C doesn't follow bound check and follow the row major ordering
arr[1][5] = arr[2][0]  // arr[1][4] will be first row of array and then arr[2][0] will be second row of array 
arr[1][6] = arr[2][1]
arr[1][7] = arr[2][2]
arr[1][8] = arr[2][3]
arr[1][9] = arr[2][4]
arr[2][4] = 10*i + j = 10*2+4 = 24
Option 4 is the answer.
Fetching relevant content for you