DE SHAW placement papers

DE SHAW
-------

(1)A man bought two horses for Rs.924 each and sold one horse for 15% profit and the other for 15% loss.What is the net gain?
(2) Two pumps fill atank in 20 hrs. One pump fills the same tank 10hrs. faster than the other pump. In what time the other pump fills
the tank?
(3) X men in Xhrs/day finish a work in x days. Y men in y hours per day finish the work in
(a) X**2/Y**2 (b)X**3/Y**2 (c) Y**2/X**2 (d) Y**3/X**2
(4) 8 men + 2 boys finish a work in 16 days. 2 men + 5 boys finish a work in 20 days. 8 men and 8 boys finish the same work in how
many days?
(5)A & B are two trains, travell from X & Y stations to Y & X stations after crossing each other A takes 4 hrs.48 mins. To reach Y
station. B takes 3hrs.20 mins. to reach X station. The speed A is 45kmph. Speed of B is ?
(6) 5 questions on series
(a) ab--bbc---ac----accc
(b) &(c) like this 5.
(7)5 questions on alfabets.
( 10 questions on English Grammer.
(9) 20 questions on reasoning.


DE SHAW Latest fresher Engineer Placement Paper 2006


PROGRAMMING


Section 1.

1. To display the contents of a executable file the following command can be used
(a) cat (b) od (c) vi (d) ed ans : b
2. Assume the current directory contains 10 files and does'nt contain 'temp'. What will be the output of the follwing commands?
$ls > temp, $wc -l temp
(a) 9 (b) 10 (c) 11 (d) undefined. ans : b
3. If one wants the output of one command( command1) to be printed inthe printer as well as to be added to another file (outfile)
which one of the following is a currect command he can give?
(a) $command1 >>outfile|tee lpr
(b) $tee -a command1 | lpr
(c) $ command1 | tee outfile | lpr
(d) $ command | tee -a outfile |lpr ans : d
(4) In the shell program set -x will cause
A. Execution of the commands in the background
B. Execution of the commands in verbose mode
C. Exit from the shell program.
D. Exit from the shell program after executing the next command
(5) ACL in UNIX refers to
A. Acces Control List
B. Action Control List
C. Application Command Language
D. Advanced C lanuage
(6) The command echo*
A. will print * on the screen
B. will print contents of all the files in the current directory
C. will list the files in the current directory
D. will print the contents of all shell variables
(7) ls || date will
A. print the name of the files in the current directory
B. print today's date and time
C. (A) followed by (B)
D. none of the above
( The built-in shell variable $$ refers to
A. printing numbers in dollar format
B. proces id_ of last command
C. proces id_ of last background command issued
D. proces-id of current shell
(9) dd is mainly used for
A. dealing with raw, unformated data, whatever the source
B. dealing with data dictionary
C. deleting a directory
D. none of the above
(10) vis in UNIX is
A. a command that takes only one input
B. a command for deleting strange or unwanted characters that may have crept into files.
C. Points non-printable characters in understandable format
D. All of the above
(11) Which of the following is true regarding the UNIX
(i) Multiuser Operating System
(ii)Multitasking Operating System
(iii) Real timing Operating System
A. i only B. i and ii only C. i and ii and iii only D. i and ii
(12) ln command is used to
A. link object codes into a executable code
B. give two names to the same file
C. set line numbers for the file
D. none of the above
(13) nohup command is used for
A. Protecting the execution of programmes from aborting when
hangup signal is received
B. Changing the execution priority of the programs
C. Not hanging up of the modem
D. Disconnecting a node from the system
(14) SCCS is a
A. Tool for maintaining large programmes in a production environment
B. Communication Protocol
C. Shell Programming Language
D. String processing utility
(15) Which one of the following is true as long as UNIX is concerned
A. One can do programming in C only
B. It can support terminals capable of printing only uppercase characters
C. The text files are sorted as it is in MS-DOS
D. None of the above
(16) Inside vi editor to replace the string /10/$/94 with
10/$$/92 globally the following command can be used
A. :1,$ s/\/10\/\$\/94/10\/\$\$\/92/g
B. :1,$ s/\/10\/\$\/94/10\/\$\/$92/
C. :s/10/$/94/10/$$/92/g
D. :1,$ s/\/10\/$\/94/10\/$$\/92/g
(17) The ed command without any argument
A. will print the current working directory
B. will make the home directory as current directory
C. will ask for the directory to be used as the current
directory
D. will go to the previous directory
(1"0" nice command is used
A. to increase/decrease execution priority of a command
B. to compress a file
C. to run a programme at latter time
D. to set the key board responce slower
(19) What will be the output of the following command sequence
$ x='I am x'
$sh
$echo $x
A. I am x B. Blank line C. x D. None of the above
(20) The command tr a-z 0-9 <>(y)?(x)y)
main()
{
intx=5,y=5;
printf("maximum is %d",MAX(++x,++y));
}
the outpput of the programis
a)maximum is 7 (b)maximum is 5 (c)maximum is 6
d)none of the above
2)given the following definitions
int *p,*q,r;
int values[30];
p=&values[0];
q=values+29;
r=++q-p;
what will be the value of r ?
a)address of q minus p
b)number of elements in the array
c)(value pointed by q)+1-(value pointed by p)
d)none of the above
3)what will the output of the program?
#include
//print the sum of the series 1/5+1/4+....
static int =5;
main()
{
int sum=0;
do
{
sum+=(1/i);
}while(0
main()
{
intoldvar=80;newvar=-80;
int swap(int,int);
swap(oldvar,newvar);
printf("numbers are %d\t%d",newvar ,oldvar);
}
int swap(intolval,int neval)
{
int temval=olval;
olval=neval;
neval=temval;
}
the output of the program is
a)numbers are 80-80
b)numbers are 80 80
c)numbers are -80 80
d)numbers are -80 -80

5 STUDY THE PROGRAM BELOW, WHICH OF THE FOLLOWING STATEMENT WILL MAKE
PROGRAM WORK :-
main ()
{
int *! = 10 , *j=20;
i=i*j;
}

A) Replace i = i*j; as i = (int) ((int) i * (int)j);
B) No error
C) Replacei= i*j;as i = (int*) ((int)i*(int)j);
D) Replace i+i*j ; as i = (int) i* (int)j;

6 Study the following program
#include
enum mode = {green,red,orange,blue ,white};
main ()
{
green = green +!;
printf("%d,%d",green,red );

}

The output of the program will be :-

A) 1,1 B) 0,1 C) No output, error in compilation
d) None of the above


7 Study th following statements.

#define DELAYTIME 1000
volatile extern int k;
intj;

for (i=0;i
main()
{
char buff[] = "this is a test";
int i, *ptr;
ptr = (int*)buff;
for (i=0;*ptr; i++);
printf("%c",*ptr++);
}

The following will be the output

A) This is a test B) It'll print junk C) Compilation error
D) None of the above

9 Select the explanation for the following declaration
itn (*(*ptr)(int)) (void)
A) ptr is apointer pointing to a integer function that takes an
intvalues returns an integer which will points to a function with
no argument.
B) ptr is pointer to function that takes an int value returns a pointer
to a function with ano argument which returns a integer
c) This is not a valid C statement.
D) None of the above.

10 Study the following program

# include
char *c[] ={
"FILE",
"EDIT",
"SEARCH",
"COMPILE",
};

HAR **cp[] = {c+3,c+2,c+1,c};
char ***cpp = cp;
main()
{
printf("%s", **cpp);
printf("%s"< *--*++cpp+3); printf("%s", *cpp[-2]+3); printf("%s\n",cpp[-1][-1]+1); } The output of this program is A) SEARCHFILEEDITCOMPILE B) SEARCHCOMPILEEDIT C) SEARCHEPILEDIT D) None of the above 11 What is the size of ptr1 and ptr2. struct x { int j; char k[100]; unsigned i; }; int *ptr1: struct X *ptr2; A) Same depending on the model used B) 2,104 C) 2, Undefined for memory is not allocated D) 2,4 12 If i = i * 16; Which of the following is a better approach to do the operation A) Multiply i by 16 and keep it B) Shift left by 4 bits C) Add i 16 times D) None of the above 13 What is the output of the following program #include
main()
{
int i = 0;
switc(i) {
case 0 : i++;
case 1 : i++2;
case2 : ++i;
}
printf("%d",i++);
}

output of the program :-
A) 1 B) 3 C) 4 D) 5

14 In the following , where means

lseek(fd,0L,SEEK_END);
where = tell(fd);
A) End of file. B) Head of file C) Cannot be defined
D) In between head and end of file.

15 Assuming that you are using IBM PC ,you have to a file of 128 intergers into a character array of 256 characters . Which statement you use ?

char buf[256];
int word[128]'
int i;
i varies from 0 to 255 in steps of 2

a) word=buf[i+1]*0x100 + buf;
b) word=buf*0x100 +buf[i+1];
c) word[i/2] = buf *0x100 + buf[i+1];
d) word[i/2]=buf[i+1]*0x100 +buf;

16 If i=5, what is the output for printf( " %d %d %d", ++i,i,i++);

a) 5,6,7 b) 6,6,7 c) 7,6,5 d) 6,5,6

17 For the following code how many times the printf function is executed

int i,j ;

for(i=0;i<=10;i++); for(j=0;j<=10;j++); printf("i=%d,j=%d\n",i,j); a)121 b) 11 c) 10 d) None of the above 18 What is the output generated for the following code #define square (a) (a*a) printf("%d",square(4+5)); a) 81 b) 4 C) 29 D) None of the above 19 For the following statement find the values generated for p and q? int p = 0, q =1; p = q++; p = ++q; p = q--; p = --q; The value of p and q are:- a) 1,1 b) 0,0 c) 3,2 D) 1,2 20 What is the output generated by the following program ? #include
main()
{
int a , count;
int func(int);
for (count = 1 ;count <=5;++count) { a = func(count); printf("%d", a); } } int func(int x) { int y; y=x*x; return(y); A) 1234567 b) 2516941 C) 9162514 D) 1491625 1. Helmet:Head: ans: Breakplate:chest 2. Writer:Pen: ans:Carpenter:Saw 3. cargo:lorry: 4. In one shocking instance of ________________ research, one of the nations influential researchers in the field of genetics reported on experiments that were never carried out and published deliberately_________ scinetific papers on existed work. ans: Fradulent- deceptive 5. We need more men of culture eligitent we have too many ____ among us ans: philistines 6. Hide-bound choose nearest antonym ans: Open minded 7. She has been in her Bonnet She cantell _____ ans:Anto 8.If x-2y=2;2x+y=4 which of the following is right ans:d 9. If 2men and 7boys can do a work in 16days.3men and 8boys can do in12 days 8menand 8boys ? ans;6 10. Aperson wants 30% discount. But shopper gave 20% and 12%succesively discount then the person gets ans:29.6 11. The distance between A and B stations is 110 km. apart on a st.line. One train starts at A at 7am. and travels towards B at 20kmph. Another starts at B at 8am.and travels towards A at a speed of 25kmph. AT what time they will meet? ans:10am. 12. 2,2,6,52.5,157.5,630 find the wrong number ans: replace 52.5 by 45 13. 02,12,28,722,152,312,632 find the wrong number ans. replace 28 by 32 14. Air resistance is proportional to square of the velocity at a speed of 3kmph. the resistance is 0.000045 gm/cm. An aeroplance is travelling at a speed of 250 kmph. What is the air resistance offered in kg/mit ans:0.03125 15. A person gives 10% discount and he revenues 10% in bargaining. The printed price is 330. What is actual price? ans:270 16. For what period of time for 1800 at 5% interest will give interest of 390% ans:13/3 17. 10 years back thef father age is 7 times of his son. After 2 years twice the age of the father is equal to 5 times of the son. What are their ages? ans;f->38,S->14
18. Train travels 100km. in first 2hrs. and 200 km. in 3hrs. and 150 km. in 2.5hrs. What is the avg. speed? ans;60kmph
19. A number when divided by 342 gives remainder 47 When the same number is divided by 19,what would be the remainder ? ans:9
20. A and B can do work in 6 days. B alone can do in 16 days. After 3 days of combined work B left. In how many days further A completes remaining work? ans:24/5 days
21. In a parking place there are 36 vehicles. After first one scooter is there. AFter 2nd car two scooters, after 34d car and so on.How many scooters are there in second half of the row? ans; (YOU PLEASE DO THIS PROBLEM)
22. How many times do the hands of clock coincide in a day? ans;22
23. Fraction and simplification one problem is there. The exact answer is 7/13.(this damn correct)
24. The least/greatest 4 digit numbers which when divided by 15,27,35,
42 leaves in each case a remainder 7 is ans: 1897,9457
THERE IS SEPERATE SECTION FOR CRITICAL REASONING(GMAT TYPE) 6 QUESTIONS LIKE THE FOLLOWING.
25. All fans are vans. No vans are fans
26.All young scientists are optimistic. All optimists are open minded.
27. Assertion: Comets belong to the solar family. REason: Comets burst into pieces and revolve around the sun ans; Both A&R are true but R is not

Correct the sentence questions 4.
8 figures are there. Among these for 4 problems you have to find the next figure. for remaing you have find odd figure.(ALL ARE EASY )
ONE ANALYTICAL QUESTION AS FOLLOWS (THIS ALSO VERY EASY)

five people in a family named A,B,C,D,E.probable answers confirm by reading the question carefully.
ans: A,B -sons
doctor C -daughter
officer D - daughter in law ie. wife of B
using this you have to solve five questions. that is very easy
if you confirm the above.
------------------------------------------------------------------------------------------------
DE SHAW
---------
Section-A

Write the programs for the following problems in C.

1. Swap two variables x,y without using a temporary variable.


2. Write algorithm for finding the GCD of a number.


3.Write a program for reversing the given string.


4. The integers from 1 to n are stored in an array in a random
fashion. but one integer is missing. Write a program to find the
missing integer.

Ans): Hint : The sum of n natural numbers is = n(n+1)/2.
if we subtract the above sum from the sum of all the
numbers in the array , the result is nothing but the
missing number.


5. Some bit type of questions has been given on pointers asking to
to find whether it is correct from syntax point of view. and if
it is correct explain what it will do. (around 15 bits).

DE SHAW Latest Freseher Engineer Placement Papers 2006


Section-B


6. For the following C program

#define AND &&
#define ARRANGE (a>25 AND a<50) a =" 30;" r1="6.25,r2="2.5,a;" a="AREA(r1);" a="AREA(r2);">=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
a. WHERE,HAVING,GROUPBY,ORDERBY
b. GROUPBY, WHERE, HAVING, ORDERBY
c. ORDERBY,GROUPBY,WHERE,HAVING
d. NONE OF THE ABOVE
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
elements
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++)>
void main()
{
char buffer[10]={"Genesis"};
printf("%d",&buffer[4]-(buffer));
}
a. 3
b. 4
c. 0
d. illegal pointer subtraction
14. what is the output for
#include
main()
{
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..
1+2/3*4+1
a. 2
b. 3
c. 4
d. 4.666666
e. 5
16. identify the relationship between the many employees
working
in a dept..
a. one to one
b. one to many
c. many to one
d. many to many
17.there was a table given and it was asked which normal form does
it
follows..
18. the process of including some controlled redundancy for
the
sake of performance
is known as
a. normalization
b. Cartesian product
c. Denormalization
d. None
19. in a doubley linked list
a. the last node contains the address of the first node
b. each node contains the address of previous and next node
c. each node contains the address of previous node
d. none
20. in a queue each node contains
a. the address of previous node
b. address of next node
c. address of both the previous and next node
d. none of the above


************************: oracle paper


the test was of 1 hour 30 ques. g apti and 30 of
technical.......some
ques. of g apti were very lengthy so don't end up in solving
them.....time was less......some 15 ques. from arithmetic......and
rest
15
logical,statement interpretation,arrangement,tense
correction......and
like
that......
i am enclosing here the 2 C questions :
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;
}
2. enum object is a const which can only be assigned a value at
initialization or a variable which can be assigned any value in
the
middle of
the program?
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
5. main()
{char str[]="Geneius";
print (str);
}
print(char *s)
{if(*s)
print(++s);
printf("%c",*s);
}
6. what does the function fcloseall() does ?
7. main()
{printf("Genius %d",fun(123));
}
fun(int n)
{return (printf("%d",n));
}
8. difference between definition and declaration.
9. find the error?
fun()
{int i=10;
if(i<10) a="9,b="5,c="3,d;" d="(b-c)<(c-a)" 1="?" i="4;" i="i/4);" cols="?" oracle ="="="="="="" max="10;" p="Hello" i="10;" a="9,b="5,c="3,d;" d="(b-c)<(c-a)" 1="?" i="4;" i="i/4);" cols="?" x="2;" x="%d" x="2;" x="4;" x="2;" a="Hello Orcale Test">0


X<=2 ; X >=3

2)if 5x*x+14*x+k=0 having two reciprocal roots find the value of k.


3&4)two sentence are given ,in between four sentence are given in

change order . (like between 1 & 6 ,abcd four sentence are given 1 a b c

d 6)

find the correct order?

5)if first term of AP is 5 .16th term is 45.find the sum of first 16

terms.

6)x,y and z are odd no. not necessarly in sequence.then y=?

(1)mean of x and z is 114.

(2)mean of y and z is 113.

115


7)ram is 27 year old then mohan.after 7 year ram age is thrice as mohan

age .find ram age?

67/2

8)if three tapes are filling a tank of capacity of 500lit with speed of

30lit/sec,48lit/sec and 36lit/sec. Find after how long time tank will

fill?

500/114

9)find the root of given eq x-2/(x-1)=1-2/(x-2) if possible.

x = 0

10)find the point of intersection of \

15x+9y=15

5x+3y=21


NO

11)suppose in a pot 20 cards are there label 1-20 on that. find the

probability of getting two prime.

8/20 = 2 / 5

12)in an island three persons are there Jam ,Dam and Sam .sam having

pencil,dam having cap and Jam having book .we have find who is author

among them if.

(1)Sam says ,Jam is author but author wearing cap.

(2)Dam says ,I am author ,but author not having cap.

(3)Sam says, I am author ,but author having note book.

Find who is author?

jam

13)Jo ,Do and So are three person.

(1) So says Jo is football player, I also football player.

(2) Do says Jo is football player, I also football player.

(3) Jo says Do is football player, I also football player.

Find the football player player among them.

jo

14-16)quest based analogy . like LION:CUB find the pair in given

choice.

17)in a basket 3 mangos,4 apples and 4 bananas are there. Find no of

ways we select randomly 3 fruit from basket?

1Cool if a^x=b^y=c^z and b^2=ac then

find x+z/xz=?

2/y

19)(loga)^2-(logb)^2 = ? ans :- logab-loga/b

20)in a 60 liters of mixture of spirit and water is 7 %.

in order to make water 19%,how much water should be added.(some

thing like this)

21-25)A one and half page length passage will be given and 4 to 5

questions will be asked based on this passage.

26)


technical part:-
==================

pattern: 1) pl/sql--->7 quest

2) java--->5 quest

3) c & pointers--->9 quest

4) dbms and dfd's--->5 quest

5) ds--->4 quest

some quest are here:-

1.what is not a c- storage class (ans.stack)

2.if dba creates one user what are the privilages the user will

get?

3. which keyword is used to const in java (ans.final)

4.char *array[4]={"some string"}

printf("%d",&array[4]-(array)); (ans.4)

5.remote object will be in the package (ans.java.net (verity it))


6.#define sq(a) (a*a)

printf ("%d",sq (3+2)); (ans.11)

7.#define max 20

printf ("%d", ++max); (ans.lvalue required --- error)

.printf ("%d",sizeof (2>3?4?:4:3?4:2));(some thing like this

(ans.syntax error))

9. what is important of free().

10.property of constructor in java program.

11.impotance of macro.

12.underfolw condition of stack.

(1)empty,2)push,3)pop,4)none)


====================

1)Which of the following is not a storage class in C?

Static
Register

Extern

Stack

2)Which of the following 'return' statement is correct?

return, return;

return(1, 2, 3);

return(return 4);

(return 5, return 6);

3)The second argument to fopen() function is?

char

const char *
int *
FILE *

4)What is the output of the program?

#include

void main()

{

char buffer[10] = {"Genesis"};

printf(" %d ", &buffer[4]- (buffer));

}

3
4
0
Illegal pointer subtraction
4

5)If "arr" is an array of 5 x 5 dimension, arr[2][4] is same as

**(a+3+4)

*(a+3)+*(a+4)

**(a+3)+4

*(*(a+2)+4)

APTITUDE 30 questions

Log37

1: ------- = ? ( Log67 )

1 + Log32

2> log(a-b) = log a - log b; then a = ?


(b/(b2+1));

3: 3 black 7 white balls ......... prob of drawing 2 white

balls ? (7/15)

4 > In a lock of 4 rings there r five characters how

many unsuccessful

attempts can be made ? (624)...

5> sqrt(6+sqrt(6+sqrt (6 + .................))))) = ? 3

6: a solution is prepared by mixing two solution

with sprit 20% & 60%...In

what ration they should be mixed to get the 50% sprit

in resultant solution .

(1:3)



7: X2 - (A-3)X +(A+3) = 0

for what value of A the sum of square of roots will be

least ? (A=2);

8: 'a' number of persons work daily 'b' hours to

produce 'c' items. If 'd'

persons walks away from the group what will be the

number of hours to

produce 'c' items. ? (ab/(a-d))

9: - 13 Passage

14 - 18 venn diagram.

19-22 picking based (VERBAL);

23-25 picking odd once out (words )

26: m = ax , n = ay mxny = a2(x+y) find 1/x +

1/y? (1)

27 xy - 2y - 6 =0;

x <> 2 x >2 ...

y is always postive.

28

the diameter of circle can be determined from

1. area.

2. circumference.

Ans either of them..

29:

sum of 2 no. is 7 & product s 10 fnd larger number.

30:

TECHNCAL

It be really tough

They will manly concentrate on

PL/SQL

Java.

C.


1. Output of the following program is


main()


{


int i=0;


for(i=0;i<20;i++)


{


switch(i){


case 0:


i+=5;


case 1:



i+=2;

case 5:


i+=5;


default:





i+=4;


break;

}


}


}


(A) 5,9,13,17 (B)


12,17,22 (C)


16,21 (D) syntax error.



2. What will be the result of the following program?

char*g()

{

static char


x[1024];

return x;

}

main()

{
char*g1="First
String";

strcpy(g(),g1);

g1=g();

strcpy(g1,"Second


String");


printf("Answer

is:%s", g());

}

(A) Answer is: First String


(B) Answer is:


Second String


(C) Run time Error/Core Dump


(D) None of these


3: which will not complete the transaction ....


(UPDATE).



4: PL / SQL loop can be replaced by which loop to get

least number of steps.


5:regarding USER_NDEX.


6: which language is used by end user to manipulate

dbms.

DML


7: what can not be used in object names.


8: what is used to collect information from more than

one table ( JOIN).


9: program on java.swng.


10: problem on JNI


11: something on extendability or searializability


12 some more c codes.


13 on queue defintion.


14 what s orthogonal matrix.


15 Peep stack.



16 reg . class.


17 compiler intilized storage clases.


18. whch storage class allows class to be initialized

in a class.


19 on set font


20 on redundancy ...

Three beauty pageant finalists-Cindy, Amy and Linda-The winner was musician. The one who was not last or first was a math major. The one who came in third had black hair. Linda had red hair. Amy had no musical abilities. Who was first?
(A) Cindy
(B) Amy
(C) Linda
(D) None of these

2. Two twins have certain peculiar characteristics. One of them always lies on Monday, Wednesday, Friday. The other always lies on Tuesdays, Thursday and Saturdays. On the other days they tell the truth. You are given a conversation.
Person A- today is Sunday, my name is Anil
Person B-today is Tuesday, my name is Bill
What day is today?
(A) Sunday
(B) Tuesday
(C) Monday
(D) Thursday

3. The difference of a number and its reciprocal is 1/2.The sum of their squares is
(A) 9/4
(B) 4/5
(C) 5/3
(D) 7/4

4. The difference of a number and its square is 870.What is the number?
(A) 42
(B) 29
(C) 30
(D) 32

5. A trader has 100 Kg of wheat, part of which he sells at 5% profit and the rest at 20% profit. He gains 15% on the whole. Find how much is sold at 5% profit?
(A) 60
(B) 50
(C) 66.66
(D) 33.3

6. Which of the following points are collinear?
(A) (3,5) (4,6) (2,7)
(B) (3,5) (4,7) (2,3)
(C) (4,5) (4,6) (2,7)
(D) (6,7) (7,Cool (2,7)

7. A man leaves office daily at 7pm.a driver with car comes from his home to pick him from office and bring back home. One day he gets free at 5.30 and instead of waiting for driver he starts walking towards home. In the way he meets the car and returns home on car. He reaches home 20 minutes earlier than usual. In how much time does the man reach home usually?
(A) 1 hr 20 min
(B) 1 hr
(C) 1 hr 10 min
(D) 55 min

8. If m:n = 2:3,the value of 3m+5n/6m-n is
(A) 7/3
(B) 3/7
(C) 5/3
(D) 3/5

9. A dog taken four leaps for every five leaps of hare but three leaps of the dog is equal to four leaps of the hare. Compare speed?
(A) 12:16
(B) 19:20
(C) 16:15
(D) 10:12

10. A watch ticks 90 times in 95 seconds. And another watch ticks 315 times in 323 secs. If they start together, how many times will they tick together in first hour?
(A) 100 times
(B) 101 times
(C) 99 times
(D) 102 times

11. The purpose of defining an index is
(A) Enhance Sorting Performance
(B) Enhance Searching Performance
(C) Achieve Normalization
(D) All of the above

12. A transaction does not necessarily need to be
(A) Consistent
(B) Repeatable
(C) Atomic
(D) Isolated

13. To group users based on common access permission one should use
(A) User Groups
(B) Roles
(C) Grants
(D) None of the above

14. PL/SQL uses which of the following
(A) No Binding
(B) Early Binding
(C) Late Binding
(D) Deferred Binding

15. Which of the constraint can be defined at the table level as well as at the column level
(A) Unique (B) Not Null (C) Check (D) All the above

16. To change the default date format in a SQLPLUS Session you have to
(A) Set the new format in the DATE_FORMAT key in the windows Registry.
(B) Alter session to set NLS_DATE-FORMAT.
(C) Change the Config.ora File for the date base.
(D) Change the User Profile USER-DATE-FORMAT.

17. Which of the following is not necessarily an advantages of using a package rather than independent stored procedure in data base.
(A) Better performance.
(B) Optimized memory usage.
(C) Simplified Security implementation.
(D) Encapsulation.

18. Integrity constrains are not checked at the time of
(A) DCL Statements.
(B) DML Statements.
(C) DDL Statements.
(D) It is checked all the above cases.

19. Roll Back segment is not used in case of a
(A) DCL Statements.
(B) DML Statements.
(C) DDL Statements.
(D) all of the above.

20. An Arc relationship is applicable when
(A) One child table has multiple parent relation, but for anyone instance of a child record only one of the relations is applicable.
(B) One column of a table is related to another column of the same table.
(C) A child table is dependent on columns other than the primary key columns of the parent table.
(D) None of the above.

21. What is true about the following C functions?
(A) Need not return any value.
(B) Should always return an integer.
(C) Should always return a float.
(D) Should always return more than one value.

22. enum number { a=-1, b=4, c,d,e,} what is the value of e?
(A) 7
(B) 4
(C) 5
(D) 3

23. Which of the following about automatic variables within a function is correct?
(A) Its type must be declared before using the variable.
(B) They are local.
(C) They are not initialized to zero.
(D) They are global.

24. Consider the following program segment
int n, sum=5;
switch(n)
{
case 2:sum=sum-2;
case 3:sum*=5;
break;
default:sum=0;
}
if n=2, what is the value of the sum?
(A) 0
(B) 15
(C) 3
(D) None of these.


25. Which of the following is not an infinite loop?
(A) x=0;
(B) # define TRUE 0....
do{ While(TRUE){....}
/*x unaltered within the loop*/
(C) for(;Wink {....}
....}
While(x==0);
(D) While(1) {....}

26. Output of the following program is
main()
{
int i=0;
for(i=0;i<20;i++)
{
switch(i){
case 0:
i+=5;
case 1:
i+=2;
case 5:
i+=5;
default:
i+=4;
break;
}
}
}
(A) 5,9,13,17
(B) 12,17,22
(C) 16,21
(D) syntax error.

27. What does the following function print?
func(int i)
{
if(i%2) return 0;
else return 1;
}
main()
{
int i=3;
i=func(i);
i=func(i);
printf("%d",i);
}
(A) 3
(B) 1
(C) 0
(D) 2

28. What will be the result of the following program?
char*g()
{
static char x[1024];
return x;
}
main()
{
char*g1="First String";
strcpy(g(),g1);
g1=g();
strcpy(g1,"Second String");
printf("Answer is:%s", g());
}
(A) Answer is: First String
(B) Answer is: Second String
(C) Run time Error/Core Dump
(D) None of these

29. Consider the following program
main()
{
int a[5]={1,3,6,7,0};
int *b;
b=&a[2];
}
The value of b[-1] is
(A) 1
(B) 3
(C) -6
(D) none

30. Given a piece of code
int x[10];
int *ab;
ab=x;
To access the 6th element of the array which of the following is incorrect?
(A) *(x+5)
(B) x[5]
(C) ab[5]
(D) *(*ab+5} .

· 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[])())();"
-----------------------------------------------------------------------------------------------------------------



0 comments:

Post a Comment