Tuesday, April 29, 2008

Oracle Impartent questions

Oracle Impartent questions

Some questions are compiler based i.e. given code snippet will compile or not, if not the reason.
* some question are from the prfix/postfix inc/dec operation based code snippets.
* More than 3 question are based on the sorting algorithms.
* some questions are from the pointers based.
* Code snippets involving memory allocation function.
* All the questions are from c
Some of the question ,i remember, are the following
#define sqr(x) (x*x)
int main()
int x=2;
printf("value of x=%d",sqr(x+1));

What is the value of x?
a)4 b)5 c)None d)can not compile
Ans: 5
2. what is the wrong in the following program?
#define LBRACKET {
#define RBRACKET }
#define MAIN main
int MAIN()
int x=2;
a) This program will compile
b) compilation error
int main()
int x=4;
int x=2;
a) 4 b)2 c)Nesting not allowed d)dependent on the compiler
4. Go through the following code sinippet
char a[20];
a="Hello Orcale Test";
will this compile?
a) Compilation Error b) Strings are allowed in c but cannot be assigned directly.
c) dependent on compiler
d) will work fine.
5. the expression a+b*c should be conveted to +a*bc. Using tree structure,
Which traversal is the correct one?
a) Postfix traversal b) prefix traversal c) infix traversal d)None
6. what about brk, sbrk
a) system calls b) function calls c) user defined functions
7. Why the use of alloca() is discouraged?
8. Macros support multiple arguments ?
9. the header file
a) contains only compiler directives and extern variables
b) contail only structures and unitions
c) a & b
10. what about "char *(*(*a[])())();"

=======oracle paper=======

1. An index is automatically generated with the following
a. Check
b. Not null
c. Primary key
d. Foreign key
2. Select mod(16,3) from emp;
a. 1
b. 2
c. 3
d. Error in the stmt
3. The data dictionary view to see the list of constraints enabled
on a
table is
a. user_tables
b. user_table_constraints
c. user_constraints
d. There is no dictionary view available for the same
4. Identify the pseudocolumns
a. rowid
b. sysdate
c. rowval
d. dual
5. select deptno, count(empno) from emp
where count(empno)>=5
group by deptno;
identify the line no which contains the error
a. 1
b. 2
c. 3
d. 1,3
6. choose the group function that can be used with any data type
a. sum()
b. min()
c. avg()
d. all
7. which of the following sequence is true
8. which of the proper keyword to deallocate memory
a. free
b. delete
c. clear
d. remove
9. what is the index no of the last element of an array with 29
a. 29
b. 28
c. 0
d. programmer defined

10. what is the final value of x when the code for(int
x=0;x<10;x++) is
a. 10
b. 9
c. 0
d. 1
11. what is the data type of FILE?
a. integer
b. union
c. pointer
d. structure
12. if "a" is an array of 5*5 dimension, a[2][4] is same as
a. **(a+2+4)
b. *(a+2) + *(a+4)
c. **(a+2)+4
d. *(*a+2)+4)
13. what is the output of ..
void main()
char buffer[10]={"Genesis"};
a. 3
b. 4
c. 0
d. illegal pointer subtraction
14. what is the output for
static int a[]={5,10,15,20};
int * ptr=a;
int ** ptr_ptr=&ptr;
printf("\n %d",**ptr_ptr++);
a. 5
b. 10
c. 15
d. 6
15. what is the value of expr..
a. 2
b. 3
c. 4
d. 4.666666
e. 5