Sunday, February 21, 2010

Oracle Campus Interview Q & A

1. given a square matrix which consists only of 1 and 0......find which rows,which cols and which diagonals consist entirely of 1's.
2. given an array of integers find all possible combinations of the numbers whose sum equal to 90.....
ans : knapsack problem (in data structures - aho ullman)
Note : for them solution was not the criteria.......but the approach was important......the solution should be generalised and optimized........optimization was given the top priority........
here is the techincal paper :
plz try to solve them urself by trying on comp.
1. const int MAX=10;
main()
{ enum a {a,b,MAX};
print MAX;
}
ans. 2
2. enum variable is a const variable which can only be assigned a value at initialization or a non const variable which can be assigned any value in the middle of the program?
ans. const variable
3. void *p;
what operation cannot be performed on p?
ans : arithmetic operation unless it is properly typecasted
4. char **p="Hello";
print p,*p,**p
ans. Hello (null)
warning: suspicious pointer conversion
5. main()
{ char str[]="Geneius";
print (str);
}
print(char *s)
{ if(*s)
print(++s);
printf("%c",*s);
}
ans. suiene
6. what does the function fcloseall() does ?
ans. fcloseall() closes all open streams except stdin,stdout,stderr,stdprn and stdaux
7. main()
{ printf("Genius %d",fun(123));
}
fun(int n)
{ return (printf("%d",n));
}
ans. 123genius3
8. difference between definition and declaration.
ans. definition once while declaration more than once
9. find the error?
main()
{ void fun();
fun();
}
void fun()
{ int i=10;
if(i<10)
return 2.0;
return 3.0;
}
ans. no error but warning
10. int a=9,b=5,c=3,d;
d=(b-c)<(c-a) ? a : b;
print d
ans 5
11. 1+2/3*4+1=?
ns. 2
12. In C++, a variable can be defined wherever needed whereas not in C
13. main()
{ int i=4;
fun(i=i/4);
print i;
}
fun(int i)
{ return i/2;
}
ans 1
14. what is an array ?
ans. contiguous collection of memory occupied by similar data types
15. printf("\"NITK %%SURAHKAL%% !\"");
ans. "NITK %SURATHKAL% !"
16. difference between scanf and gets in case of string input ans. scanf does not accepts white space while gets does
17. table t1 m rows and x cols
table t2 n rows and y cols
in t1*t2 rows? cols=?
ans. m*n ,x+y
18. symbol of realtionship between 2 entities?
19. which one cannot come in data modelling
a. customer b. student c. office d. speed
ans speed
20. can a database table exist without a primary key ?
21. whether higher normal forms better than lower forms as far redundancy is concerned ?
ans. higher
22. file is at which level
ans. conceptual level
23. what is a foreign key
ans. primary key in some other table

July 13 - Question Paper from Campus Test conducted at Chennai 2003
* some questions are Code Snippet based.
* 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
1.
#include
#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()
LBRACKET
int x=2;
printf("%d",x);
RBRACKET
a) This program will compile
b) compilation error
3.
#include
int main()
{
int x=4;
{
{
{
int x=2;
printf("%d",x);
}
}
}
}
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[])())();"

Campus Interview 21st june 2003

30 qns. technical - 30 mins. - mostly on DBMS,Oracle(like what would be the output), C, C++,Java(2-3 qns. on class and constructors) and datastructures.

30 qns. general - 30 mins. - 7 qns. aptitude, more like English (filling up prepositions, same meaning,
reading comprehension, four sentences would be given - you have to order them to form a paragraph, similarly four questions would be given - you have to say which one is a inference statement, which one is a judgement,etc.)

The technical test would be easy and general test would be little difficult.
In the interview questions.
=============

1. what are the macros other than C macros (the macros in word,excel) A macro in MS-word is used to group a sequence of jobs and make it as a button or keyboard shortcut. Suppose, if you need always to draw a table containing 2 rows and 5 cols, you can start,record a macro and make it as a button and put in taskbar, sothat when you press it, you will be provided with a fixed table.


2. can you delete a column from a table. In oracle 9i, you can do it by the statement ALTER TABLE table1 DROP COLUMN column1; In oracle 8,you can't.

3. can you store a image in oracle and by which datatype? Yes, you can and it can be acheived by using
a BLOB (binary large object) type and store upto 4GB in a single column.

4. have you used reports and forms in oracle?

5. have you written applications to retrieve stored images in a table?

6. some DOS commands and UNIX.

7. project desription (both academic and miniprojects,if any)

8. some situation questions like what would you do if your company is burning,etc.

Please have a look on DBMS, and some simple queries like 'select * from dual' for the technical test.f

2 comments: