Dec 25, 2008

D Company's

DELOITTE @ PSG Tech, Coimbatore (30. 07.2004)

They said that they are top go for 18 colleges which includes,
Pune Univ.,
Vishweshwaraya.
Anna etc...
PSG was the second campus they visited. First was College of Engg, Trivandrum

The company was open for all branches of B E and M E
They took 8 from our college.
3 – CSE
2 – ECE
1 each from M.Sc Software, M E Energy and Textile technology

The compensation package is about 2.7 lacs / annum

They expect people with very good comm.. skills

The Panel consisted of 6 members
2 electronics engineers from Mumbai univ.,
Santhosh Cherian – Former CTS HR
Padma Kiran Rao – HR (MBA from XLRI)
Manish – CEO
And also an architect.

They told that there will be one interview in ppt.
But more interviews were conducted in cases where the HR’s were not able to decide.
They were sent to CEO panel.
The Interview was full of personal and a little HR for non-circuits and technical for circuits.
They expect students to be strong in the Enterprise application and Technology integration field.

QUESTION PATTERN AND A FEW QUESTIONS
The pattern was similar to CTS pattern as the HR’s were former CTS employees.
The booklet given here was PINK

40 Qns. 60 mins. Negative marking of 0.25 per negative answer.

Three sections (Verbal, Quans and Critical)
15 Quans
10 Verbal
4 (Fitting the correct word in the given sentence)
6 (Fitting the correct sentence in the given paragraph)
15 Reasoning.

Plz work out... Don’t rely on the answer provided here. They may be wrong sometimes

I have 20 rupees. I bought 1, 2, 5 rupee stamps. They are different in numbers by the reason of no change, the shop keeper gives 3 one rupee stamps. So how many stamp(s) I have. Ans: 10
An Engine length 1000 m moving at 10 m/s. A bird is flying from engine to end with x kmph and coming back at 2x. Take total time of bird traveling as 187.5 s. Find x and 2x.
All persons know either swimming or rowing. There are 14 persons who know only swimming and 14 persons who know only rowing. 8 tickets sold for rowing. How many people are there for swimming?
Which polygon has no. of sides = diagonal (Eg. Pentagon)
One Cigar can be made from 7 bits. If there are 16 Cigars then how many bits collected? Ans: 4
A, B, C, D went to a hotel and planned to share the bill equally. But afterwards they changed their plan and to pay proportional to consumption A paid 240, B & C paid equally, D paid only half the amount that he should have paid based on the first plan. What is the amount paid by B?
There is a point P on the circle. A and B started running in two constant different speeds. A in Clockwise and B in Anti-clockwise. First time 500 m in Clockwise from P then 400 Anti-clockwise. If B is yet to complete one round, What is the circumference of the circle?
There are 5 Sub with equal high marks. Mark scored by a boy is 3:5:6:7:8 (Not sure). If his total aggregate if 3/5 of the total of the highest score, in how many subjects has he got more than 60%?
There are 11 lines in plane. How many intersections (Maximum) can be made?
There are 3 Sections with 5 Qns each. If three Qns are selected from each section, the chance of getting different Qns is________
There is a 20 X 20 array. In Each row , the tallest person is called and among them, the tallest person is A. In Each column, the shortest person is called and among them, the shortest person is B. Who is taller?
P # Q = (P-Q)(Q-P) = - 1. Then Which is true?
P = 3, Q = 2 P = 2,Q = 3 P = -1,Q = 1 P = 1, Q = -1 Ans: I & II only
7 Pink, 5 Black, 11 Yellow balls are there. Minimum no. atleast to get one black and yellow ball Ans: 17
A, B, C and D are four people. There are four houses Red, Yellow, Blue, White. P, Q, R and S are four sections not in same order
Conditions like
Three are sisters
B comes from Red
C comes from Blue
Qns were asked based on that
A Father is willing his estates like this. If a boy is born, wife has 1/3 part and remaining for boy. If a girl is born, Wife has 2/3 and remaining for the girl. But twins (Boy + Girl) are born. What is the share that the daughter would get?
MBA, GRE prob from Barrons GRE (Don know whether it is there in all GRE Editions). Ans: GMAT, CAT (Sure)
If  - Married
 - Not Married and
M- N-
N- L-
L- M-
Who is married? Ans: N
DE-Shaw Software Sample Test Paper
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).
SECTION-B
6. For the following C program
#define AND &&
#define ARRANGE (a>25 AND a<50)
main()
{int a = 30;
if (ARRANGE)
printf("within range");
else
printf("out of range");
}
What is the output?
7. For the following C program
#define AREA(x) (3.14*x*x)
main()
{float r1=6.25,r2=2.5,a;
a=AREA(r1);
printf("\n Area of the circle is %f", a);
a=AREA(r2);
printf("\n Area of the circle is %f", a);
}
What is the output?
Ans. Area of the circle is 122.656250
Area of the circle is 19.625000
8. What do the following statements indicate. Explain.
int(*p)[10]
int*f()
int(*pf)()
int*p[10]
Refer to:
-- Kernighan & Ritchie page no. 122
-- Schaum series page no. 323
9. Write a C program to find whether a stack is progressing in forward
or reverse direction.
10. Write a C program that reverses the linked list





This paper comprises of an Aptitude test and C-language test <br /> Aptitude-20 questions (2 marks each) <br /> C-language - 20 questions(3 marks each) <br />**************************************************************************** <br /> APTITUDE TEST <br /> 20 QUESTIONS;2 MARKS EACH <br /> TIME-20MINUTES <br /> 1) ONE RECTANGULAR PLATE WITH LENGTH 8INCHES,BREADTH 11 <br /> INCHES AND 2 INCHES THICKNESS IS THERE.WHAT IS THE LENGTH <br /> OF THE CIRCULAR ROD WITH DIAMETER 8 INCHES AND EQUAL TO <br /> VOLUME OF RECTANGULAR PLATE? <br /> ANS: 3.5INCHES <br /> 2) WHAT IS THE NUMBER OF ZEROS AT THE END OF THE PRODUCT <br /> OF THE NUMBERS FROM 1 TO 100 <br /> 3) in some game 139 members have participated every time <br /> one fellow will get bye what is the number of matches to <br /> choose the champion to be held? <br /> ans: 138 <br /> 4) one fast typist type some matter in 2hr and <br /> another slow typist type the <br /> same matter in 3hr. if both do combinely in how much time <br /> they will finish. <br /> ans: 1hr 12min <br /> 5) in 8*8 chess board what is the total number of squares <br /> refer odel <br /> ans:204 <br /> 6) falling height is proportional to square of the time. <br /> one object falls 64cm in 2sec than in 6sec from how much <br /> height the object will fall. <br /> 7) gavaskar average in first 50 innings was 50 . after the 51st <br /> innings his average was 51 how many runs he made in the 51st <br /> innings <br /> 8) 2 oranges,3 bananas and 4 apples cost Rs.15 . 3 ornages <br /> 2 bananas 1 apple costs Rs 10. what is the cost of 3 oranges, <br /> 3 bananas and 3 apples <br /> ans Rs 15. <br /> 9)in 80 coins one coin is counterfiet what is minimum number of <br /> weighings to find out counterfiet coin <br /> 10)in a company 30% are supervisors and 40% employees are male <br /> if 60% of supervisors are male. what is the probability <br /> that a randomly choosen employee is a male or female? <br /> 11)statement: all green are blue are blue, all blue are white <br /> conclusion: <br /> I) some blue are green II) some white are green <br /> III)some green are not white IV) all white are blue <br /> a) he has given four choices like gre type <br /> 12)all teachers are students. some students are girls. <br /> this type of questions are there. <br /> we cant able to reproduce them. <br /> <br /> D.E.shaw 1997 <br /> SECTION B (all multiple choices) <br /> (each q carries 3 marks) <br /> 1.while((*p++=*q++)!=0){} <br /> is equal to <br /> a) b) c) d) <br /> 2.the function strcmp(str1,str2) returns <br /> 3. int *x[](); means <br /> 4.#define PRINT(int) printf("int=%d",int); <br /> main() <br /> { <br /> int x,y,z; <br /> x=03;y=-1;z=01; <br /> PRINT(x^x); <br /> z<<=3;PRINT(x); <br /> y>>=3;PRINT(y); <br /> } <br /> 5. struct list{ <br /> int x; <br /> struct list *next; <br /> }*head; <br /> the struct head.x =100 <br /> above is correct / wrong <br /> 6. '-'=45 '/'=47 <br /> printfr(%d/n,'-','-','-','-','/','/','/'); <br /> o/p =? <br /> 12.o/p=? <br /> int i; <br /> i=1; <br /> i=i+2*i++; <br /> printf(%d,i); <br /> 8.{ ch='A'; <br /> while(ch<='F'){ <br /> switch(ch){ <br /> case'A':case'B':case'C':case'D':ch++;continue; <br /> case'E':case'F':ch++; <br /> } <br /> putchar(ch); <br /> } <br /> } a)ABCDEF b.EFG c.FG d.error <br /> 9. FILE *fp1,*fp2; <br /> fp1=fopen("one","w") <br /> fp2=fopen("one","w") <br /> fputc('A',fp1) <br /> fputc('B',fp2) <br /> fclose(fp1) <br /> fclose(fp2)} <br /> a.error b. c. d. <br /> 10. int a=1; b=2; c=3; *pointer; <br /> pointer=&c; <br /> a=c/*pointer; <br /> b=c; <br /> printf("a=%d b=%d",a,b); <br /> a. a=1 b=3 <br /> b a=3 b=3 <br /> c 3 2 <br /> d. error <br /> 11.#include<malloc.h> <br /> char *f() <br /> { <br /> char *s=malloc(8); <br /> strcpy(s,"goodbye") <br /> } <br /> main() <br /> { <br /> char *f()_; <br /> printf("%c",*f()='A'); <br /> } <br /> o/p=? <br /> 13. int sum(n) <br /> int n; <br /> if(n<1)return n; <br /> else return(n+sum(n-1)) <br /> a 10 b 16 c 14 d 15 <br /> 14. when a function is recursively called all , <br /> automatic variables are a. stored in stack b . c. d <br /> 15) #define MAN(x,y) (x)>(y)?(x):(y) <br /> { int i=10;j=5;k=0; <br /> k= MAN(i++,++j) <br /> printf(%d %d %d %d,i,j,k) <br /> } <br /> 16) a=10;b=5; c=3;d=3; <br /> if(a<b)&&(c=d++) <br /> printf(%d %d %d %d a,b,c,d) <br /> else printf("%d %d %d %d a,b,c,d); <br /> <br /> : ............................................. <br /> 19. what is o/p <br /> #include<stdarg.h> <br /> show(int t,va_list ptr1) <br /> { <br /> int a,x,i; <br /> a=va_arg(ptr1,int) <br /> printf("\n %d",a) <br /> } <br /> display(char) <br /> {int x; <br /> listptr; <br /> va_star(otr,s); <br /> n=va_arg(ptr,int); <br /> show(x,ptr); <br /> } <br /> main() <br /> { <br /> display("hello",4,12,13,14,44); <br /> } <br /> a) 13 b) 12 c) 44 d) 14 <br /> ............................................. <br /> <br /> 17. if the following program (my prog) <br /> main(int size of ,char *arg[]) <br /> { while(size of arg) printf("%s",arg[--size of arg) <br /> } <br /> is run from the command line as myprog jan feb mar apr <br /> what would be the o/p <br /> a)myprog jan,feb,mar,apr <br /> b)rev <br /> c)jan,feb,mar,apr <br /> d)error <br /> ............................................. <br /> <br /> 18.what is o/p <br /> main() <br /> {int i=3; <br /> while(i--) <br /> { <br /> int i=100 <br /> i--; <br /> printf("%d..",i); <br /> } <br /> } <br /> a) infinite loop <br /> b) error <br /> c) 99..99..99..99 <br /> d) 3..22..1.. <br /> ............................................. <br /> 20)what is the o/p of the program <br /> main() <br /> { <br /> int rows=3,colums=4; <br /> int a[rows][colums]={1,2,3,4,5,6,7,8,9,10,11,12}; <br /> i=j=k=99; <br /> for(i=0;i<rows;i++) <br /> for(j=0;j<colums;j++) <br /> if(a[k][j]<k) k=a[i][j]; <br /> <br /> printf("%d\n",k); <br />

THIS IS THE PAPER IN IIT KHARAGPUR

DESHAW 97
PART 1 TIME:20 MIN
* 20 QUESTIONS , EACH QUESTION CARRIES 2 MARKS

1. A SOLID ICE OF 11 X 8 X2 INCHES IS MADE INTO ROD OF DIA 4 INCH. WHAT
IS THE LENGE OF ROD?

ANS: 3.5 INCH

2. THERE WERE 750 PEOPLE WHEN THE FIRST SONG WAS SUNG. AFTER EACH
SONG 50 PEOPLE ARE LEAVING THE HALL. HOWMANY SONGS ARE SUNG TO MAKE
THEM ZERO?

ANS:16

3. A PERSON IS CLIMBING OF 60 MTS . FOR EVERY MINUTE HE IS CLIMBING 6 MTS
AND SLIPPING 4 MTS . AFTER HOWMANY MINUTES HE MAY REACH THE TOP?

ANS: (60-6)/2 +1 :28

4. HOWMANY ZEROS ARE THERE IN THE PRODUCT OF THE INTEGER FROM 1TO 100?

ANS: 24( NOT GIVEN)

1 TO 10 -2 ZEROS
21 TO 30 -3 ZEROS : BECAUSE 25 = 5*5
22 *5
24 *5

5. A CAN DO WORK IN 2 HOURS B CAN DO A WORK IN 3 HOURS WHAT IS THE
SHORTEST TIME TYEY CAN FINISH THE WORK?

ANS: 1HOUR 12 MIN.

6..SALARY IS INCREASED BY 1200 ,TAX IS DECREASED FROM 12% TO 10% BUT PAYING
SAME AMOUNT AS TAX . WHAT IS THE PREVISIOUS SALARY?

ANS:6000

7. THE LEAST NO. WHICH IS WHEN DEVIDED BY 4,6,7 LEAVES A REMAINDER OF 2 ?

ANS: 86

8. A MAN DRIVING THE CAR AT TWICE THE SPEED OF AUTO ONEDAY HE WAS DRIVEN
CAR FOR 10 MIN. AND CAR IS FAILED. HE LEFT THE CAR AND TOOK AUTO TO GOTO
THE OFFICE . HE SPENT 30 MIN. IN THE AUTO. WHAT WILL BE THE TIME TAKE BY
CAR TO GO OFFICE?

ANS:25 MIN

9. A REPORT HS 20 WHEETS, EACH OF 55 LINES AND EACH SU;CH A LINE CONSISTS
OF 65 CHARACTERS. IF THE REPORT HAS TO BE RETYPED WITH EACH SHEET HAVING 65
LINES AND EACH LINE HAVE 75 CHARACTERS, THE PERCENTAGE OF REDUCTION OF
NO OF SHEETS IS CLOSEST IS TO?


ANS: 25%



10. OUT OF 100 FAMILIES IN NEIGHBOUR HOOD , 55 OWN RADIO, 75 OWN T.V
AND 25 OWN VCR. ONLY 10 FAMILIES HAVE ALLOF THESE, AND EACH VCR OWNER
HAS TV . IF 25 FAMILIES HAVE THE RADIO ONLY, THE NO. OF FAMILIES HAVE
ONLY TV ARE?

ANS: 30




APTITUDE: ( QUESTIONS 16 T019)

KYA KYA IS AN ISLAND IN THE SOUTH PACIFI . THE INHABITANTS OF KYA KYA
ALWAYS ANSWER ANY QUESTION WITH TWO SENTENCES, ONE OR WHICH IS ALWAYS
TRUE AND OTHER IS ALWAYS FALSE.

1. YOU ARE WALKING ON THE ROAD AND COME TO A FORK. YOU ASK ,THE INHABITANTS
RAM.LAXMAN, AND LILA AS" WHICH ROAD WILL TAKE ME TO THE VILAGE?

RAM SAYS: I NEVER SPEAK TO STRANGERS. IAM NEW TO THIS PLACE
LAXMAN SAYS: IAM MARRIED TO.LILA. TAKE THE LEFT ROAD
LILA SAYS: IAM MARRIED TO RAM. HE IS NOT NEW TO THIS PLACE

ANS: LEFT ROAD TAKE YU TO THE VILLAGE

2. YOU FIND THAT YOUR BOAT IS STOLLEN. U QUESTIONED THREE INHABITANTS OT
ISLANDS AND THEIR REPLIES ARE

JOHN : I DIDNOT DO IT. MATHEW DIDNOT DO IT
MATHEW : I DIDNOT DO IT. KRISHNA DIDNOT DO IT
KRISHNA: I DID NOT DO IT; I DONOT KNOW WHO DID IT

ANS: MATHEW STOLEN THE BOAT

3. YOU WANT TO SPEAK TO THE CHIEF OF VILLAGE , U ASK THREE FELLOWS AMAR
BOBBY, CHARLES AND BOBBY IS WEARING RED SHIRT

AMAR : IAM NOT BOBBY`S SON ; THE CHIEF WEARS RED SHIRT
BOBBY : IAM AMARS FATHER ; CHARLES IS THE CHIEF
CHARLES : THE CHIEF IS ONE AMONG US; IAM THE CHIEF

ANS: BOBBY IS THE CHIEF

4. THERE IS ONLY OPNE POLOT IN THE VILLAGE(ISLAND). YOU INTERVIEWED THREEM MAN
KOISK ,LORRY AND MISHRA
U ALSO NOTICE THAT KOISK IS WEARING CAP.

M SAYS : LARRY IS FATHER IN THE PILOT .LARRY IS NOT THE PRIESTS SON
KOISK : IAM THE PRIEST ON THEIS ISLAND ONLY PRISTS CAN WEAR THE CAPS
LARRY : IAM THE PRIEST SON . KOISK IS NOT THE PREST

ANS : KOISK IS THE PILOT






THIS PAPER HAS GIVEN IN IIT DELHI , SO GO THROUGH THIS IT WILL GIVE
ROUGH IDEA;


1. typedef struct{
char *;
nodeptr next;
} * nodeptr;
what does nodeptr stand for?

2. supposing thaty each integer occupies 4 bytes and each charactrer
1 byte , what is the output of the following programme?

#include
main()
{
int a[] ={ 1,2,3,4,5,6,7};
char c[] = {' a','x','h','o','k'};
printf("%d\t %d ", (&a[3]-&a[0]),(&c[3]-&c[0]));
}
ans : 3 3

3. what is the output of the program?

#include
main()
{
struct s1 {int i; };
struct s2 {int i; };
struct s1 st1;
struct s2 st2;
st1.i =5;
st2 = st1;
printf(" %d " , st2.i);
}

ans: nothing (error)
expl: diff struct variables should not assigned using "=" operator.



4.what is the output of the program?

#include
main()
{
int i,j;
int mat[3][3] ={1,2,3,4,5,6,7,8,9};
for (i=2;i>=0;i--)
for ( j=2;j>=0;j--)
printf("%d" , *(*(mat+j)+i));
}

ans : 9 6 3 8 5 2 7 4 1

5.

fun(n);
}
int fun( int n)
{
int i;
for(i=0;i<=n;i++)
fun(n-i);
printf(" well done");

}
howmany times is the printf statement executed for n=10?


ans: zero
expl: Befire reaching to printf statement it will goes to infinite loop.


6.what is the output of the program?

main()
{
struct emp{
char emp[];
int empno;
float sal;
};
struct emp member = { "TIGER"};
printf(" %d %f", member.empno,member.sal);


ans: error. In struct variable emp[], we have to give array size.
If array size given
ans is 0, 0.00



7. output of the program?

# define infiniteloop while(1)
main()
{
infiniteloop;
printf("DONE");
}

ans: none
expl: infiniteloop in main ends with ";" . so loop will not reach end;
and the DONE also will not print.

8. output of the program?

main()
{
int a=2, b=3;
printf(" %d ", a+++b);
}

ans:5
expl: here it evaluates as a++ + b.

9. output of the program?

#define prn(a) printf("%d",a)
#define print(a,b,c) prn(a), prn(b), prn(c)
#define max(a,b) (a
main()
{
int x=1, y=2;
print(max(x++,y),x,y);
print(max(x++,y),x,y);
}


ans: 3 4 2

10. which of the following is the correct declaration for the function main() ?

ans: main( int , char *[])

11. if ptr is defined as

int *ptr[][100];
which of the following correctly allocates memory for ptr?

ans: ptr = (int *)(malloc(100* sizeof(int));

FEW MORE PROGRAMS H




SECTION-A <br /> <br /> you should write the programs for the following problems in C. <br /> <br /> 1. swapping two variables x,y without using a temporary variable. <br /> 2. a program has been given asking to find the output <br /> ans. it is algorithm for finding G.C.D <br /> 3. write a program for reversing the given string. <br /> 4. the integers from 1 to n are stored in an array in a random <br /> fashion. but one integer is missing. write a program to find the <br /> missing integer. <br /> ans. idea. the sum of n natural numbers is = n(n+1)/2. <br /> if we subtract the above sum from the sum of all the <br /> numbers in the array , the result is nothing but the <br /> missing number. <br /> 5. some bit type of questions has been given on pointers asking to <br /> to find whether it is correct from syntax point of view. and if <br /> it is correct explain what it will do.(around 15 bits). <br /> <br /> SECTION-B <br /> <br /> ANSWER AS MANY AS POSSIBLE. <br /> <br /> 6.& 7. two programs on pre-processor directions has been given asking <br /> to find the output. <br /> 8. simple question given on pointer <br /> a) kernighan & richie page no. 122 <br /> b) schaum series page no. 323 <br /> try to understand the pointer problems given here he asked to <br />explain <br /> in the interview if answer it in exam. <br /> 9. write a c program to find whether a stack is progressing in forward <br /> or reverse direction. <br /> 10. write a c program that reverses the linked list. <br /> <br /> GUIDELINES: <br /> the interview is very tough he is asking to do the problems in <br /> front of him. he is also giving some new problems to solve before <br />him. <br /> you should have a very good funda of C language. <br /> <br /> <br />----------------------------------------------------------------------- <br /> P . V . THATAYYA NAIDU <br /> M.S ( CS) Hostel : 91-044-2351326 <br /> Research Scholar (PP: #341 Naidu) <br /> <br /> 341, BrahmaPutra Hostel Infotech Lab : 91-044-2351365 <br /> IIT MADRAS - 600036 ext:3529/3530 <br /> INDIA <br /> EMAIL : naidu@indy.iitm.ernet.in <br /> naidu%bronto@iitm.ernet.in <br />----------------------------------------------------------------------- <br /> <br />ERE BUT NOT AVAI




> Deshaw99(WILCO99) <br />> <br />> <br />> THERE ARE THREE SECTIONS: <br />> <br />> SECTION A: APPITUDE TEST 20 BITS <br />> SECTION B: C BITS 20 BITS <br />> SECTION C: 1 QUESTION (NOT A BIT) <br />> IT IS LONG ANSWER <br />> THE QUESTION IS:FIND THE NEXT PERMUTATION IN <br />> LEXICOGRAPHIC <br />> ORDER FROM THE GIVEN PERMUTATION <br />> <br />> NOTE: MAXIMUM QUESTIONS ARE FROM OLD QUESTION PAPERS <br />> SECTION A: <br />> <br />> 1. THERE WERE 750 PEOPLE WHEN THE FIRST SONG WAS <br />> SUNG. AFTER EACH <br />> SONG 50 PEOPLE ARE LEAVING THE HALL. HOWMANY SONGS <br />> ARE SUNG TO MAKE <br />> THEM ZERO? <br />> <br />> ANS:16 <br />> <br />> SECTION B: <br />> <br />> 1. typedef struct{ <br />> char *; <br />> nodeptr next; <br />> } * nodeptr; <br />> what does nodeptr stand for? <br />> <br />> <br />> 2. 2 oranges,3 bananas and 4 apples cost Rs.15 . 3 <br />> ornages 2 bananas <br />> 1 apple costs Rs 10. what is the cost of 3 oranges, <br />> 3 bananas and <br />> 3 apples ANs Rs 15. <br />> <br />> <br />> 3. int *x[](); means <br />> expl: Elments of an array can't be functions. <br />> <br />> 4. struct list{ <br />> int x; <br />> struct list *next; <br />> }*head; <br />> the struct head.x =100 <br />> above is correct / wrong <br />> <br />> <br />> expl: Before using the ptr type struct variable we <br />> have to give memory <br />> to that . <br />> And also when ever the struct variable is ptr then <br />> we access the <br />> members <br />> by "->" operator. <br />> <br />> <br />> <br />> <br />> 5.o/p=? <br />> int i; <br />> i=1; <br />> i=i+2*i++; <br />> printf(%d,i); <br />> ans: 4 <br />> <br />> 6. FILE *fp1,*fp2; <br />> fp1=fopen("one","w") <br />> fp2=fopen("one","w") <br />> fputc('A',fp1) <br />> fputc('B',fp2) <br />> fclose(fp1) <br />> fclose(fp2)} <br />> a.error b. c. d. <br />> ans: no error. But It will <br />> over writes on same <br />> file. <br />> <br />> <br />> 7.#include<malloc.h> <br />> char *f() <br />> {char *s=malloc(8); <br />> strcpy(s,"goodbye")} <br />> main() <br />> { <br />> char *f(); <br />> printf("%c",*f()='A'); <br />> o/p=? <br />> <br />> <br />> 8) #define MAN(x,y) (x)>(y)?(x):(y) <br />> { int i=10;j=5;k=0; <br />> k= MAX(i++,++j) <br />> printf(%d %d %d %d,i,j,k)} <br />> 9) a=10;b=5; c=3;d=3; <br />> if(a<b)&&(c=d++) <br />> printf(%d %d %d %d a,b,c,d) <br />> else printf("%d %d %d %d a,b,c,d); <br />> <br />> : ............................................. <br />> 10. what is o/p <br />> #include<stdarg.h> <br />> show(int t,va_list ptr1) <br />> { <br />> int a,x,i; <br />> a=va_arg(ptr1,int) <br />> printf("\n %d",a) <br />> } <br />> display(char) <br />> {int x; <br />> listptr; <br />> va_star(otr,s); <br />> n=va_arg(ptr,int); <br />> show(x,ptr); <br />> } <br />> main() <br />> { <br />> display("hello",4,12,13,14,44); <br />> } <br />> a) 13 b) 12 c) 44 d) 14 <br />> ............................................. <br />> <br />> <br />> 11.main() <br />> { <br />> printf("hello"); <br />> fork(); <br />> } <br />> <br />> <br />> 12.main() <br />> { <br />> int i = 10; <br />> printf(" %d %d %d \n", ++i, i++, ++i); <br />> } <br />> <br />> <br />> 13.#include<stdio.h> <br />> main() <br />> { <br />> int *p, *c, i; <br />> i = 5; <br />> p = (int*) (malloc(sizeof(i))); <br />> printf("\n%d",*p); <br />> *p = 10; <br />> printf("\n%d %d",i,*p); <br />> c = (int*) calloc(2); <br />> printf("\n%d\n",*c); <br />> } <br />> <br />> 14.#define MAX(x,y) (x) >(y)?(x):(y) <br />> main() <br />> { <br />> int i=10,j=5,k=0; <br />> k= MAX(i++,++j); <br />> printf("%d..%d..%d",i,j,k); <br />> } <br />> <br />> 15.#include <stdio.h> <br />> main() <br />> { <br />> enum _tag{ left=10, right, front=100, back}; <br />> printf("left is %d, right is %d, front is <br />> %d, back is <br />> %d",left,right,front,back); <br />> } <br />> <br />> 16.main() <br />> { <br />> int a=10,b=20; <br />> a>=5?b=100:b=200; <br />> printf("%d\n",b); <br />> } <br />> <br />> <br />> <br />> <br />> 17.#define PRINT(int) printf("int = %d ",int) <br />> main() <br />> { <br />> int x,y,z; <br />> x=03;y=02;z=01; <br />> PRINT(x^x); <br />> z<<=3;PRINT(x); <br />> y>>=3;PRINT(y); <br />> } <br />LABLE:
Dharma Sample Test Paper Home

Back To Dharma Page

Give the output of the programs in each case unless mentioned otherwise
1.
void main()
{
int d=5;
printf("%f",d);
}
Ans: Undefined

2.
void main()
{
int i;
for(i=1;i<4,i++)
switch(i)
case 1: printf("%d",i);break;
{
case 2:printf("%d",i);break;
case 3:printf("%d",i);break;
}
switch(i) case 4:printf("%d",i);
}
Ans: 1,2,3,4

3.
void main()
{
char *s="\12345s\n";
printf("%d",sizeof(s));
}
Ans: 6

4.
void main()
{
unsigned i=1; /* unsigned char k= -1 => k=255; */
signed j=-1; /* char k= -1 => k=65535 */
/* unsigned or signed int k= -1 =>k=65535 */
if(iprintf("less");
else
if(i>j)
printf("greater");
else
if(i==j)
printf("equal");
}
Ans: less

5.
void main()
{
float j;
j=1000*1000;
printf("%f",j);
}

1. 1000000
2. Overflow
3. Error
4. None
Ans: 4

6. How do you declare an array of N pointers to functions returning
pointers to functions returning pointers to characters?

Ans: The first part of this question can be answered in at least
three ways:

1. char *(*(*a[N])())();

2. Build the declaration up incrementally, using typedefs:

typedef char *pc; /* pointer to char */
typedef pc fpc(); /* function returning pointer to char */
typedef fpc *pfpc; /* pointer to above */
typedef pfpc fpfpc(); /* function returning... */
typedef fpfpc *pfpfpc; /* pointer to... */
pfpfpc a[N]; /* array of... */

3. Use the cdecl program, which turns English into C and vice
versa:

cdecl> declare a as array of pointer to function returning
pointer to function returning pointer to char
char *(*(*a[])())()

cdecl can also explain complicated declarations, help with
casts, and indicate which set of parentheses the arguments
go in (for complicated function definitions, like the one
above).
Any good book on C should explain how to read these complicated
C declarations "inside out" to understand them ("declaration
mimics use").
The pointer-to-function declarations in the examples above have
not included parameter type information. When the parameters
have complicated types, declarations can *really* get messy.
(Modern versions of cdecl can help here, too.)


7. A structure pointer is defined of the type time . With 3 fields min,sec hours having pointers to intergers.
Write the way to initialize the 2nd element to 10.

8. In the above question an array of pointers is declared.
Write the statement to initialize the 3rd element of the 2 element to 10;

9.
int f()
void main()
{
f(1);
f(1,2);
f(1,2,3);
}
f(int i,int j,int k)
{
printf("%d %d %d",i,j,k);
}

What are the number of syntax errors in the above?

Ans: None.

10.
void main()
{
int i=7;
printf("%d",i++*i++);
}

Ans: 56

11.
#define one 0
#ifdef one
printf("one is defined ");
#ifndef one
printf("one is not defined ");

Ans: "one is defined"


12.
void main()
{
int count=10,*temp,sum=0;
temp=&count;
*temp=20;
temp=∑
*temp=count;
printf("%d %d %d ",count,*temp,sum);
}

Ans: 20 20 20


13. There was question in c working only on unix machine with pattern matching.


14. what is alloca()
Ans : It allocates and frees memory after use/after getting out of scope

15.
main()
{
static i=3;
printf("%d",i--);
return i>0 ? main():0;
}

Ans: 321

16.
char *foo()
{
char result[100]);
strcpy(result,"anything is good");
return(result);
}
void main()
{
char *j;
j=foo()
printf("%s",j);
}

Ans: anything is good.

17.
void main()
{
char *s[]={ "dharma","hewlett-packard","siemens","ibm"};
char **p;
p=s;
printf("%s",++*p);
printf("%s",*p++);
printf("%s",++*p);
}
Ans: "harma" (p->add(dharma) && (*p)->harma)
"harma" (after printing, p->add(hewlett-packard) &&(*p)->harma)
"ewlett-packard"
Back to top
Deutsche Software(India) Sample Test Home

Back To Deutsche Soft Page
1. What is the percentage represented by 0.03 * 0.05 ?
(a)0.0015
(b)0.000015
(c)0.15
(d)15
Ans.B

2. (x-a)(x-b)(x-c)....(x-z) = ?
(a) 1
(b) -1
(c) 0
(d) Can't be determined
Ans. C

3. If a = 1, b = 2, c = 3.......z = 26 what is the value of p+q+r ?
(a)33
(b)51
(c)52
(d)48
Ans. B

4. A is 8 miles east of B.
C is 10 miles north of B.
D is 13 miles east of C and E is 2 miles north of D.
Find shortest distance between A and E.
(a) 5 miles
(b) 6miles
(c) 13 miles
(d) 18 miles
Ans. C

5. If z = 1, y = 2.......a = 26. Find the value of z + y + x + .......+a.
(a) 351
(b) 221
(c) 400
(d) 200
Ans. A

6. There are 30 socks in a bag.
Out of these 60 % are green and the rest are blue.
What is the maximum number of times that socks have to be taken out so that atleast 1 blue pair is found.
(a) 21
(b) 2
(c)18
(d) 20
Ans. D

7. How many two digit numbers have their square ending with 8.
(a) 13
(b) 12
(c) 0
(d) 11
Ans. C

8. How many numbers are there between 100 and 300 with 2 in the end and 2 in the beginning.
(a) 10
(b) 9
(c) 11
(d) none of these
Ans. A

9. 0.000006 * 0.0000007 = ?
(a) 0.0000000042
(b) 0.000000000042
(c) 0.0000000000042
(d) 0.00000000000042
Ans. B

10. You have Rs 1000 with 8% p.a compounded every 6 months.
What is the total interest you get after 1 year.
(a) Rs.116.40
(b) Rs.345.60
(c) Rs.224.50
(d) Rs.160
Ans. A

11. If x + y =12,
x - y = 2
Find x + 2y.
(a) 12
(b) 17
(c) 14
(d) none of these
Ans. B

12. With one gallon of petrol a person moves at a speed of 50 mph and covers 16 miles.
3/4th of the distance is covered while moving at 60 mph.
How many gallons does he need to cover 120 miles in 60 mph.

13. A tap drains at x speed while tap B is closed.
When both taps are open they drain at y speed.
What is the speed of draining when only tap B is open
(a) x - y
(b) y-x
(c) x
(d) can't be determined
Ans. B

14. What is twenty percent of 25 % of 20.
(a) 2
(b)1
(c) 5
(d) 4
Ans. B

15. A rectangle has the dimensions 6ft * 4ft.
How many squares of 0.5 inches will it need to completely fill it.
(a) 32000
(b) 12824
(c) 13824
(d) 18324
Ans. C

Directions for questions 16-21: In each question,a series of letters satisfying a certain pattern are given. Identify the pattern and then find the letter/letters that will come in place of the blank/blanks.
16. a, c, e, g, _
(a) h
(b) i
(c) d
(d) j
Ans. B

17. a, e, i, m, q, u, _, _
(a) y, c
(b) b, f
(c) g, i
(d) none
Ans. A

18. ay , bz , cw , dx ,__
(a) gu
(b) ev
(c) fv
(d) eu
Ans. D

19. 1, 2, 3, 5, 7, 11, __
(a) 15
(b) 9
(c) 13
(d) 12
Ans. 13 , series of prime numbers

20. kp , lo , mn , __
(a) nm
(b) np
(c) op
(d) pq
Ans. A

21. abc , zyx , def , wvu , ___
(a) ghi
(b) tsr
(c) ihg
(d) str
Ans. A

22. How is my mother's sister's brother's wife's child related to me?
(a) brother
(b) uncle
(c) cousin
(d) nephew
Ans. A

23.What will my mother's husband's father-in-law's son's daughter to me?
(a) niece
(b) aunt
(c) sister
(d) none of these
Ans. D

24. A person travels 12 km in the southward direction and then travels 5 km to the right.
He then travels 5 km to the right and then travels 15 km towards the right and finally travels 5km towards the east.
How far is he from his starting place?
(a) 5km
(b) 3m
(c) 3.5km
(d) 4km
Ans. (b)

25. A person travels towards east from his house and travels a distance of 3 meters.
He then ran a distance of 7 meters southwards and then travels towards east a distance of 3 meter
Finally he travels southwards a distance of 10 meters.
What is his vertical distance from his house?
(a) 10
(b) 17
(c) 12
(d) none of these
Ans. B

26. The sum of three consecutive numbers is 132. Find the square of the largest number.
(a) 2026
(b) 640
(c) 900
(d) 2025
Ans. D

27. Father's age is five times his son's age.
Four years back father was 9 times older than his son.
Find their present ages
(a) 30yrs, 6yrs
(b) 25yrs, 5yrs
(c) 40yrs, 8yrs
(d) none of these
Ans. C

28. If x + 5y = 6 ;
7x - 2y = 5
Find x - y
(a) 1
(b) 2
(c) 0
(d) none of these
Ans. C

29. If the equation x2 + 2(k+2)x + 9k = 0 has equal roots, find k?
(a) 1,4
(b) 1,5
(c) 2,5
(d) can't be determined
Ans. A

Directions for questions 30 to 35: Select the alternative that logically follows form the two given statements.
30. All books are pages. All pages are boxes.
(a) All boxes are books
(b) All books are boxes
(c) No books are boxes
(d) Both (a) and (b) are correct
Ans. B

31. No apple is an orange. All bananas are oranges.
(a) All apples are oranges
(b) Some apples are oranges
(c) No apple is a banana
(d) None of the above
Ans. A

32. All pens are elephants. Some elephants are cats.
(a) Some pens are cats
(b) No pens are cats
(c) All pens are cats
(d) None of the above
Ans. D

33. All shares are debentures.No debentures are deposits.
(a) All shares are deposits
(b) Some shares are deposits
(c) No shares are deposits
(d) None of the above
Ans.C

34. Many fathers are brothers. All brothers are priests.
(a) No father is a priest
(b) Many fathers are not priests
(c) Many fathers are priests
(d) Both (b) and (c)
Ans. B

35. Some pens are pencils. All pencils are costly.
(a) No pens are costly
(b) Some pens are costly
(c) All pens are costly
(d) None of the above
Ans. B

36. How many two digit numbers have their squares ending with 6?
(a) 9
(b) 10
(c) 164
(d) 18
Ans. D

37. In how many years will $1200 amount to $1323 at 5%p.a. compound interest?
(a) 3 years
(b) 2 1/2 yrs
(c) 2 yrs
(d) none of the above
Ans. C

38. How many terms of the series -9 , -6 , -3 ,.........must be taken such that the sum may be 66?
(a) 11
(b) 13
(c) 9
(d) 10
Ans. A

39. The sum of three numbers in AP is 27 and their product is 504. Find the terms.
(a) 7, 9 ,11
(b) 5, 9, 13
(c) 4, 9, 14
(d) none of these
Ans. C

40. Two pipes A and B can fill a tank in 20 and 25 seconds respectively.
Both are opened at the same time and after 5 minutes the first one is closed.
How much more time will it take for the tank to be full?
(a) 13 min 45 secs
(b) 10 min
(c) 18 min
(d) 15 min 45 secs
Ans. A

41. How long will a train 150 metres long and travelling at a speed of 45 kmph,
take to cross a platform of length 250 meters?
(a) 48 secs
(b) 32 secs
(c) 30 secs
(d) none of the above
Ans. B

42.Walking at 4/5th of his usual speed, a man reaches his office 15 mins late.
Find his usual time for reaching the office?
(a) 45 mins
(b) 2 hrs
(c) 1 hr
(d) 30 mins
Ans. C

43. If the word "CODING" is represented as DPEJOH , then the word "CURFEW" can be represented?
(a) DVSGFX
(b) DVSHFX
(c) DGSHFX
(d) DTSGFY
Ans. A

44. If in a certain code "RANGE" is coded as 12345 and "RANDOM" is coded as 123678,
then the code for the word "MANGO" would be
(a) 82357
(b) 84563
(c) 82346
(d) 82543
Ans. D

45. If in a code "COPIER" is coded as 1234 and "REAM" is coded as 5421,then "DREAM" is coded as
(a) 35421
(b) 43512
(c) 35412
(d) 34521
Ans. A

Directions for questions 46-48:The questions are based on the following data
In a class of 150 students 55 speak English;85 speak Telugu and 30 speak neither English nor Telugu
46. How many speak both English and Telugu?
(a) 10
(b) 15
(c) 20
(d) 12
Ans. C

47.How many speak only Telugu?
(a) 55
(b) 45
(c) 65
(d) none of the above
Ans.C

48.How many speak at least one of the two languages?
(a) 120
(b) 100
(c) 250
(d) 50
Ans. A

49. Find the lowest of the three numbers in a GP whose sum is 38 and product 945.
(a) 12
(b) 18
(c) 4
(d) 8
Ans. D

50. A can do a piece of work in 24days.
When he had worked for 4 days B joined him.
If the complete work is finished in 16 days form the beginning, in how many days can B alone finish the work?
(a) 24 days
(b) 18 days
(c) 36 days
(d) None of the above
Ans. C
Back to top

No comments:

Post a Comment