# 3i Infotech Papers: Sample Questions 103 - 105 of 1245

Examrace Placement Series prepares you for the toughest placement exams to top companies.

## Question number: 103

### Write in Short

Why can a “group by” or “order by” clause be expensive to process?

### Explanation

• GROUP BY, ORDER BY is executed by the Oracle engine. At the end, this leads to overhead, because whole data has to be rearranged again.

• Group by: Combines all the similar rows and displays only the distinct data. Combining and displaying distinct data is an overhead.

• Order by: Sorts the data either in ascending order or in descending order. Sorting the data is an overhead.

• Processing of “group by” or “order by” clause requires creation of Temporary tables to process the results of the query, depending on the size of the result set can prove to be expensive.

## Question number: 104

### Write in Short

What is the output of the following program?

1. `main()`
2. `{`
3. `    Main();`
4. `}`

### Explanation

• Runtime error: stack overflow.

• Main function calls itself repeatedly.

• Each time the function is called its return address is stored in the call stack.

• Since there is no condition to terminate the function call, the call stack overflows at runtime.

• So it terminates the program and results in an error.

## Question number: 105

### Write in Short

What is the output of the following program?

1. `main ()`
2. `{`
3. `    int i = -1;`
4. `    + i;`
5. `    printf ( “i = %d, + i = %d  ” i, + i);`
6. `}`

### Explanation

i=-1, +i=-1

In a program

 int i =-1; Define the integer variable i=-1. + i; Apply unary operator Unary + is the only dummy operator in C. Ignore it as it has no effect in the expressions (hence the name dummy operator). printf (“i =%d, + i =%d ” i, + i); Print the i=-1 and + i=-1